This content has been marked as final. Show 3 replies
Of course that is what you get for reading the documentation! :) If you read the next sentence it says, "Initializing a variable helps you track and compare the variable’s value as the SWF file plays." So that seems to contradict the sentence you have quoted.
So I think this is a case of technical writers having something really important to share, but a serious lack of understanding of the English language. I really have no idea what they are trying to tell you, but I think it has to do with the importance of declaring variables and the change between Flash 6 and 7.
In any event you seem to be overlooking a REALLY important point. It is all well and good to ask questions here, but you could easily have answered this yourself far quicker than posting here and waiting for an answer.
Make a new file.
Add a keyframe at frame two or 30 or what have you.
Declare a variable on Frame 1.
Trace the variable on whatever next frame you added.
Actually, I have had really bizarre problems in the past declaring a variable within an FLA file and then having it be completely invisible elsewhere in the movie. I've tried creating it all sorts of different ways, using _root and this and whatever else, and gone nuts trying to figure out the issue. So my guess is there was something extra-bizarre going on either in my copy of Flash or in the way I built the file.
In either way, I also submitted this message on the livedocs area itself, so if the documentation is incorrect or misleading, at least they'll know. I write documentation for a living myself - it's a real headache keeping up with all the changes that happen constantly.
You shouldn't flail around with _root, this, and whatever else. You should develop a strategy for making sure variables are where they need to be. I'm guessing it isn't your copy of Flash. :)
If it is a variable that everything needs, most likely a _global variable would be a good choice. If you are keeping it within this object or that movie clip, but can't find it when needed, use the Debug–>List variables and it will show you where everything is.
It sometimes does get tricky when trying to combine Actionscript with timeline stuff. Personally I try and limit the amount of playhead jumping around within my files. If I do run into a problem, the best approach I've found is to set aside my current project and try and develop the simplest model of the problem. Then I can see how Flash works and how I can get what I need. In the end, regardless of what the documentation says or how I want it to work, Flash does what it does.
I'm sure they are trying to tell us something important, but I don't know what it is from those sentences. Perhaps that if a variable is defined within an object, like a movieclip and if that movieclip doesn't exist at a later frame, then you won't be able to get the variable? I really don't know.