Esquared
05-26-2002, 04:48 PM
OK...I have a game that contains about 12 animated movie clips, each controlled by actionscript. They consist of the following:
1. A "Field" movie clip that contains mouseDown and keyDown handlers
controlling basic quit commands and stuff
2. A "Piece" movie clip containing 9 "Block" movie clips and scripted with
simple x axis motion
3. Nine "Block" movie clips each containing a mouseDown handler to check
when they are clicked on
4. A "Crosshair" movie clip with an enterFrame handler to reset it to the
mouses current position
So my question is this...I get slowup...how do I get rid of it?? I don't see that this is too many handlers for Flash to handle or anything, but I want it to run at 30 fps or so and I'm currently getting about 10-15. The biggest issue is the crosshair, which produces noticeable slowup when in motion, but not when the mouse is still. This makes no sense to me since Flash should be setting the coordinates of the clip regardless of the motion of the mouse. Also, I suppose I could somehow alter my code so that the individual hit tests weren't assigned to "block", but instead existed in a for loop in "Field". That would knock out 9 handlers, but I want to know if this is worth doing before I start messing with all the target paths and such. And of course, I still have to add some additional code dealing with my matrices to check for when the "Block" movie clips "land", which is essentially 9 if statements in a for loop. THANKS!
Oh, and I can post the .fla if someone wants to see it...just let me know.
1. A "Field" movie clip that contains mouseDown and keyDown handlers
controlling basic quit commands and stuff
2. A "Piece" movie clip containing 9 "Block" movie clips and scripted with
simple x axis motion
3. Nine "Block" movie clips each containing a mouseDown handler to check
when they are clicked on
4. A "Crosshair" movie clip with an enterFrame handler to reset it to the
mouses current position
So my question is this...I get slowup...how do I get rid of it?? I don't see that this is too many handlers for Flash to handle or anything, but I want it to run at 30 fps or so and I'm currently getting about 10-15. The biggest issue is the crosshair, which produces noticeable slowup when in motion, but not when the mouse is still. This makes no sense to me since Flash should be setting the coordinates of the clip regardless of the motion of the mouse. Also, I suppose I could somehow alter my code so that the individual hit tests weren't assigned to "block", but instead existed in a for loop in "Field". That would knock out 9 handlers, but I want to know if this is worth doing before I start messing with all the target paths and such. And of course, I still have to add some additional code dealing with my matrices to check for when the "Block" movie clips "land", which is essentially 9 if statements in a for loop. THANKS!
Oh, and I can post the .fla if someone wants to see it...just let me know.