|
-
Senior Member
Inconsistent bahavior just KILLING me. Any suggestions?
This is just driving me nuts. I have my basic "move object around" code in my MovieClip subclass, but every 1 in 20 or so times I tell it to do something, it fails and does something weird. Like the code skipped a step. It isn't just one method that is failing either, but any number of them can do weird things.
For example, I can have two objects start next to each other and move one into the other. This should trigger my hittest. But if I completely close down the flash environment, start up the fla, and test the movie, it will fail. The hittest won't register.
So I close down the test, right away test it again with NO CHANGES and this time the hittest works fine.
Another example
I have a rotate_right method that basically just checks a facing property and then calls a 'setfacing' method with the correct angle that just takes that facing, assigns it to the internal facing variable, and tells the class to move to a new internal animation frame to show that it has rotated (dealing with 90 degree turns and sprites that are not pure topdown). Basically switching from a back view to a right side view if rotate_right is called when the facing was 0 to start with. Sometimes the movieclip won't change to the sideview though! I KNOW the 'setfacing' method is being called since it is changing the facing value, but the sprite still shows the back view but then acts like it is going right.
Any idea what would be causing a vague problem like this? It sure makes me want to punch my monitor when it works fine one time, and then skips instructions another time. I cannot reproduce ANY of these errors in debug mode. It always does just what I want in debug mode.
It's driving me nuts. I have a very object intensive setup, with each tile of a 32x32 board being an object in an array (anything off screen is just set as _visible = false). I don't go through that array too often though, except when scrolling or scaling the board. And these problems happen when the board is still.
Could having too many objects cause flash to skip lines of code? I know it can slow down framerate, but the when a hittest misses, it will miss while it should be true for probably 10-15 frames. These objects are not moving that fast.
-
I had problems with AS2 and FlashMX2004+Flash8 as it cached the AS classes and it wouldn´t update it even after some restarts- sounds the same as what you have
-
Senior Member
If it was a cacheing issue, wouldn't that basically mean that my main script would be calling old versions of my classes?
If that would work how I would think it would work, then the 'rotate_right' script would still either call the 'this.gotoAndPlay("framename")' command correctly to set visual facing or it wouldn't. How would caching cause it to sometimes set the facing and other times leave the current one? All during the same testing of the swf? I can keep hitting my test button to call the turn_right method and watch as it usually works fine, but seemingly randomly fails to update visual facing. Odd that it always seems to update the actually _facing property.
Or am I misunderstanding what you are saying?
Is there maybe something wonky about gotoAndPlay? I remember last time I was coding in flash I was getting really mad that gotoAndStop would not actually STOP all of the time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|