I did my best to explain those but we really need to do a few examples to get a proper understanding. Let's consider our previous example:


  1. is on the main timeline.
  2. is within .
  3. The Main Timeline can be reference using "_root".
So, the path to is:
_root.clip1.clip2
Note that Flash 4's "slash-syntax" for pathing is still supported but I no longer teach it in my tutorials as it's outdate. See the archived versions of the tutorials for Flash 4 pathing info. Also note that, as of Flash MX 2004, references to Objects are case sensitive, which means is not the same as .

While you're a beginner I always recommend using the full path to objects, this means using the "_root" at the beginning of every reference! This way you're much less likely to get silly but crippling debugging errors. Once you're confident you have the hang of pathing it's wise to drop full paths (known as 'absolute paths') and get into relative paths (see the Advanced Pathing tutorial) because they make your code much more extensible.

Now it's your turn. In the example below note the following:
  1. Oldest is within Middle.
  2. Middle is within Youngest
  3. Youngest is within/on the Main Stage

Finally, when loading movies within movies, using the LoadMovie command, people often encounter problems. This is often because their Objects which did exist on _level0 are now on _level1 or _level2 (depending on what Level you loaded to), or within a targeted Movie Clip. Remember that you can check paths to objects and variables in the Test Movie environment within Flash (Ctrl-Enter), by pressing Ctrl-Alt-V (variables) or Ctrl-L (Objects and Layers). If you need to reference an Object on another layer, it's as easy as: _levelX.objectName or _levelX.objectPath.objectName where X is the Level number.

Paths to Variables:

Variables are just a type of Object, so paths to variables (in Flash 5 and above) are specified in exactly the same manner as has been described above. For instance, to set the value of a variable called 'foo' within in our ongoing example from above, you would enter:
_root.clip1.clip2.foo = "Some Value";
Paths to variables in Flash 4 were different; for more information see the archived version of this tutorial at the bottom of the Tutorials index.

That's it. I did my best on this one but it's hard to teach this stuff and assume no knowledge. I'm always open to suggestions.

Also note that there's now an Advanced Pathing tutorial (see Related Articles, below) but it's late in the Intermediate set because you're expected to read a few of the Intermediate tutes (like the arrays tutorial) before you try it. Good luck.

Jesse Stratford is the Co-Master of ActionScript.org and a freelance Flash developer and teacher. He is based in Australia and enjoys all things Flash.

NB: If you have comments or feedback please feel free to email me, but please do not email me Flash questions; the forums are provided for that purpose and you will get a faster answer by posting you question there.

If you have found this tutorial helpful, I hope that you will take 30 seconds to visit The Hunger Site where, with just one click you can make a free donation of food to a starving person in a third-world country. We do not benefit financially from this action; it is purely an act of charity.
This tutorial is protected by International Intellectual Property Rights laws and may not be reproduced or redistributed in full or part, without the prior written consent of the author. Unauthorized reproduction of this tutorial or its contents may result in prosecution. I've worked hard on this tutorial, please don't steal it.