Flash tip of the day
- Started
- Last post
- 47 Responses
- lvl_130
not to get into it with devs vs. designers but this tread should stay visible.
can we drop the battle armor and get back to the source of this thread please? useful tips of flash. something you have found in flash that may be useful to others.
go!
- Cptn_Uncanny0
//Quick & Dirty way to disable all button handlers for a level and/or movieclip
for (var prop in mcInstance_mc) {
if (typeof (mcInstance_mc[prop]) == "movieclip") {
mcInstance_mc[prop].enabled = false;
}
}--
flipping an mc:
whatever.onPress = function():Void{
this._xscale *= -1
};--
Random Positive or Negative Value
to get -50 -> 50 :
var x:Number = (Math.random() * 100) - 50;
or
function generateRandomBiPolar(range:Numb...
{
return ((Math.random() * range) - (range / 2));
}--
- lvl_130
^ Nice! i can't wait to try this out. i can't tell you how many times i have had to make buttons into movieclips with the inevitable 2 frame label code of "off" and "on"!
"off" when there is no button within the mc, and "on" where there is.
- Cptn_Uncanny0
Thanks!
In the days of AS 2 fp7 I used to find these useful too (deactivates hand cursor for all mc's and btns):MovieClip.prototype.useHandCurso... = false;
Button.prototype.useHandCursor = false;--
And then there's this which I find/found invaluable in some odd circumstances:
//retrieve name of swf
SWFName = function () {
return this._url.split("/").pop();
};
- kumori040
Always use weak references when you register an event listener. Garbage collection is important!
- mightyj0
some authoring environment tips:
1. rounded square: select the square tool and click and drag on the stage before letting go hit the up and down arrows to set your rounded rectangle to the roundness you want.
2. use commands/extensions to save time, here is a small collection I use all the time: http://www.mighty55.com/flash_ extensions.zip
3. when creating a tween on the timeline you can now create one and then right click on that tween and then right click with a different movieclip and paste that tween to that movieclip. I think this has been possible since cs3.
- woops extensions link: http://www.mighty55.…mightyj
- You can also make rounded square by using the Square Primitive tool. Makes the rounding radius non-destructive.kumori04
- yes true but it's nice to see the rounding edges change on the fly
mightyj
- ********0
what keys kern? I know it's the right/left button + ?