Don't wanna be here? Send us removal request.
Text
Changing the brightness of a MovieClip in as3
There isn't a .brightness property, unlike the .alpha property. I wanted a silhouette, so I set my values to the lowest possible. The range is -255 to 255.
var color:ColorTransform = new ColorTransform(); color.redOffset = -255; color.greenOffset = -255; color.blueOffset = -255; cup.transform.colorTransform = color;
0 notes
Text
the difference between .length and .length() in as3
When dealing with xml, use .length()
When dealing with arrays, use .length
More info
0 notes
Text
Exporting stored filter presets
Filter presets are amazing. I use them to make my text look amazing. One gripe is that Flash doesn't have a built-in gradient filter, so I have to make do by experimenting around. I find the bevel filter and the gradient glow filter give the best effects, though not perfect.
If you need to export these saved filter presets, they can be found in
C:\Users\<User>\AppData\Local\Adobe\Flash <Version>\<Language>\Configuration\Filters
More information can be found on Adobe's site.
1 note
·
View note
Text
Resetting the Registration Point
Sometimes I forget that
You can't change the registration point, you can only change the position of graphical elements in relationship to it.
- the author of the linked post
But in case you ever want to, here's how.
0 notes
Text
Show all defined variables
Show all defined variables in php:
var_dump(get_defined_vars());
0 notes
Text
Xampp 1.7.4 only for Windows 32 bit
Please note that despite what is written on the linked readme at xampp's website for windows, xampp does NOT play well with windows 7 64 bit (for me at least). If you download the zip, the readme_en.txt says:
* System Requirements:
+ 64 MB RAM (RECOMMENDED) + 350 MB free fixed disk + Windows NT, 2000, 2003, XP (RECOMMENDED), VISTA + Only 32 Bit (NOT for 64 bit systems)
which is different from what's on the website. And when I try to run it, it tells me:
XAMPP Component Status Check Failure [3]. Current directory: C:\xampp Run this program only from your XAMPP root directory.
:( guess it's back to 1.7.3 for me. If anyone has had any luck, let me know. Thinking of just installing apache/mysql/php/phpmyadmin separately so I can update the components separately too.
Edit: I've swapped to Wamp instead.
11 notes
·
View notes
Text
Getting around greyed-out font styles in Flash
If you do not have the bold and/or italic versions of a font, the Style box in Flash becomes greyed out because there are no corresponding glyphs that it can use. You can get around this by going to Text -> Style -> Faux Bold/Italic.
0 notes
Text
Coding MovieClips as Buttons in AS3
So here's my problem, I have a Button in Flash that has 3 states: Up, Over and Down. In my Up and Down state, my MovieClip is its normal size. In the Over state, my MovieClip becomes bigger. I need to change this Button into a MovieClip and keep the behaviours.
I came across a post on IHeartActionscript but it didn't give the exact effect I wanted. When I click on the MovieClip and roll out without unclicking, I want the MovieClip to react the same way a Button would, which will be to go to the Up state. Using IHeartActionscript's code however meant that the MovieClip stayed in the Down state.
Here's my fix, which also uses less listeners than IHeartActionscript's solution:
function buttonize(obj, anim=true) { obj.buttonMode = true; obj.useHandCursor = true; obj.mouseChildren = false; if (anim) { obj.addEventListener(MouseEvent.MOUSE_DOWN, buttonDown); obj.addEventListener(MouseEvent.ROLL_OVER, buttonOver); obj.addEventListener(MouseEvent.ROLL_OUT, buttonOut); } } function buttonOver(event:MouseEvent) { if(event.buttonDown) { event.currentTarget.gotoAndStop(1); } else { event.currentTarget.gotoAndStop(2); } } function buttonOut(event:MouseEvent) { if(event.buttonDown) { event.currentTarget.gotoAndStop(2); } else { event.currentTarget.gotoAndStop(1); } } function buttonDown(event:MouseEvent) { event.currentTarget.gotoAndStop(1); }
The different states of my MovieClip button are contained in the frames of my MovieClip.
0 notes
Text
Adding syntax highlighting into Tumblr
After much googling around, I found two popular ways to add syntax highlighting into Tumblr:
Alex Gorbachev’s Syntax Highlighter
Google's Prettify
I tried the Syntax Highlighter at first and spent a really long time trying to get it to work. When it finally did, it slowed the loading time by a huge amount, so I switched to the Prettify.
Prettify was a lot simplier to install. The code below automatically adds the prettyprint class to any <code> tag. Alternatively, you can leave out the script and add the class manually.
<!-- For Syntax Highlighting --> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <link rel="stylesheet" type="text/css" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"></link> <script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script> <script> function styleCode() { if (typeof disableStyleCode != 'undefined') { return; } var a = false; $('code').each(function() { if (!$(this).hasClass('prettyprint')) { $(this).addClass('prettyprint'); a = true; } }); if (a) { prettyPrint(); } } $(function() {styleCode();}); </script>
This assumes you don't already have jQuery.
When posting code, use a text editor to change all the angle brackets to < and > and enclose it in <pre><code></code></pre> tags. The <pre></pre> is necessary to keep the formatting.
Note: The highlighting won't show up in RSS feeds or the dashboard.
190 notes
·
View notes