Where can I find your home?

"Addressing in Flash" is known as "Targetting". The way we say joe's house address is like below

joe,street no 16,city Mycity,myCoutry

But how can I address my movieclips in flash? Well targeting in flash is done by dot (.) notation. Suppose we want to target a movieclip lying on stage, then we say "_root.myClip", where "myClip" is the name of movieclip on stage.Similarly a movieclip inside a movieclip is targetted by "_root.myClip.insideClip", where "myClip" is on stage and "insideClip" is placed inside "myClip".Ohh, ok then what's "_root" ? "_root" is the main time line of flash. Whe we publish our "fla" file it becomes "swf" file. Now we can say to target our base "swf" file we write "_root".This "_root" is the holder of all other things inside the movie. To better understand the situation, if we say "Earth" contains everything from trees, plants, water to humen, then we can target "Earth" as "_root" and all other things with a dot(.) .Say we want to target "water" we will say

Earth.water

similarly in flash environment we would say

_root.myClip

 Now, lets see the full address of your home

Earth.MyCountry.MyState.MyTown.MyStreet.MyHome

So, if there is a movieclip inside another movieclip, which is inside another movieclip (called nested movieclips), then we target them as

_root.firstClip.insideClip.myClip

As to find somebody's place you must know the complete address of his/her house, to do something wiht a particular clip flash must know the complete "target path" to it.
😉

Advertisements

Author: saumya

designer / developer / maker / educator @saumya

1 thought on “Where can I find your home?”

  1. Hi,
    The method of explanation is very nice and as such can grasp the contents with ease.
    I would ask Saumya to write a book on flash scripting with such good examples therein.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s