|
-
383,890,620 polygons
strange swapDepths behaviour
... mhm today i experienced the following:
my new game has a cursor which is visible only during the game.
when you finish a level the playhead jumps to "LevelDone" where the cursor has NO frames (so the mc should be removed, along with it's events)
this worked fine UNTILL i needed the cursor to be over some generated tiles so i used swapDepths ... bad idea
i noticed that the cursor is not removed correctly from the stage - it is invisible or something else, 'cause when i now start a new level, the playhaid jumps to "Play" and the cursor appears on the stage again.
AND ALL THE F***ING EVENTS ARE FIRED TWICE !?
for testing reasons i added a mouseup to the cursor with nothing more than a trace inside.
when played for the first time, only one trace was executed, but when the second level started there where 2 and after the third 3 ...
i solved the problem by adding a container_mc ... so i don't have to bother anymore...
but the 2hours i needed to get behind this where wasted, damn!
just to let you know ...
<olli/>
-
DOT-INVADER
that's not something new, but i wasted several evenings with that method several months ago (around one year ago in fact). simply because your swaped MC, even with no frame, is still here at its "virtual" depth. i say virtual because it changes its depth while swapping, and is not on the timeline anymore...
> to avoid that, simply remove it via the simple removeMovie code...
OR do a containerMC like you did, and the thing is removed.
-
383,890,620 polygons
... but i still believe that the events should NOT be executed twice 
<olli/>
-
DOT-INVADER
when played for the first time, only one trace was executed, but when the second level started there where 2 and after the third 3 ...
that's because the "old" cursor was still there, at its depth, so each time you think it's deleted and add another one (via attachMC/duplicateMC i suppose), there were 2 cursors, then 3...
well yes, it was terrible when it happened to me the first time; i remember that all my swaped elements where all around when i changed the map (it was a zelda-like view)...
-
383,890,620 polygons
think it's deleted and add another one (via attachMC/duplicateMC i suppose),
... nope, i didn't, that's why i find this SO strange ... the cursor was just "attached" via timeline and the swapdepths was executed everytime the "Play" frame was reached ...
so i thought that in the worst case the old cursor would just be replaced with the new one AND only one cursor is shown in the variable dump (ctrl+alt+v), too.
<olli/>
-
Senior Member
I usually avoid using swapDepths on anything that hasn't been attached/duplicated because of the scary things that happen.
-
383,890,620 polygons
... i have never used it on a "timeline-object" before and i sure will not do it again ...
<olli/>
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
|