Skip to main content
Participating Frequently
July 1, 2013
Pregunta

How to Ensure Symbol State Persists?

  • July 1, 2013
  • 1 respuesta
  • 707 visualizaciones

Okay, so I have a symbol that I want to show/hide; it's a named MovieClip with two labelled frames ("show" and "hide" in that order), the default is to be shown, and both frames have a stop() command.

This seems fine however at one point in my animation I trigger the symbol to hide via foo.gotoAndStop("hide"), but when the animation loops the symbol reappears (or rather, returns to the "show" frame).

Now, obviously this is annoying, but other symbols that function in the exact same way appear to be working as expected, so I'm at a complete loss as to why this one symbol in particular seems to be resetting? Is there some characteristic of the animation that might be causing Flash to see the symbol as if it were a new instance? I've checked that the symbol's name is constant throughout the animation, and I'm really only using classic tweens; certainly nothing that stands out as different in way compared to the other, working symbols.

Aside from completely re-creating the animation for that symbol I'm not sure what else I can try, so any suggestions are welcomed!

Este tema ha sido cerrado para respuestas.

1 respuesta

Ned Murphy
Legend
July 1, 2013

If the object exists in multiple keyframes then it can reset when you move to a new one.  If that's the case you should have this object in its own layer and have only one keyframe for it in that layer.

Participating Frequently
July 1, 2013

I'm afraid that's not really an option as the object needs to move as part of the animation, but I also need to be able to show and hide it as required. It also wouldn't explain why other symbols work fine, as they are also part of keyframed animations and show/hide exactly as expected.

Inspiring
July 1, 2013

Just put the animation to move the movieclip around within another movieclip. To set the visibility of a movieclip through code, give it an identifier name and type:

movieclipNameHere._visible = false; (or true).