For example, if you have an active state and a passive state for something, you can jump between the two with gotoAndStop(2), gotoAndStop(1); or you can manipulate whatever property is changing directly (e.g. if it’s alpha, then symb.alpha=0.5, symb.alpha = 1.0).
I’ve found myself jumping between the two, and I don’t like it (I like to have a standard, or at least a usual). What’s considered a good practice, and why?
If you’re using AS2 using frames and
gotoandstopis fine, in AS3 you really need to assess whether that will work for you. For me, most often the cons outweigh the pros, and so I use frames sparingly.The big difference between as2 and as3 is that in as2 the resources are accessible right away. In AS3 the resources cannot be accessed right after.
for example if you have a movieclip named _mc1 on frame 3, in as2 you could do
in AS3 that would not work, you would get errors, and would need to add an onrender listener and add the code there. Doing this is a nightmare.
That’s not to say I don’t use frames, for example, when I’m using movieclips as buttons, I don’t have any resources that I need to access and so I’m not worried about using frames.
The other thing you should keep in mind is the memory that is being used. If you have objects that have listeners or have expensive creation and removal, having these objects on a timeline that you go back and forward on will use more memory and processing than if you did it using pure code.