optimizing AS Q
- Started
- Last post
- 8 Responses
- stewart
i'm using an actionscript where a MaskMc moves to other coordinates when the mouse is rolling over a specified area.
the same moment also two MC's containing images are fading out and one is fading.
my problem is that the script not running that fast because i used a couple of onEnterFrame functions.
what's the best way to clean this script (without using onEnterFrame) to make it less processor intensive and optimize the performance?
- monNom0
your alpha blending is probably doing most of the computation. you're not going to do much with AS to fix flash being clunky in displaying the graphics.
if you can't get reasonable performance from your current setup, maybe rethink the idea a bit.
you could also try splitting the actions to two frames (alpha 1, move 2)...that will effectively halve the speed of the animation, but it may make things look cleaner.
- imakedesign0
you can delete the onenterframe after you have used it.
use setInterval instead
Use the mxtransitions.
avoid scaling or alpha
- stewart0
anyone with a better method ?
- JamesEngage0
I think the enterframes don't make much difference coz if you need to draw something you need to draw it. Just make sure you aren't doing stuff that you don't need to. But then you know that :)
Might be wrong though?!?
- unfittoprint0
recently I turned all my transitions to v2 classes [slide, fades, etc...] while adding an event dispatcher to 'alert' when they're finished.
all things started to run smoother/faster.
- fusionpixel0
when you are done using the script do
delete MC.onEnterFrame
and when you need it again just enable it. that saves heck lots of CPU usage when you dont need it.
- stewart0
v2 classes
that's MX2004 right?
- fusionpixel0
V2 classes are AS2