Search tutorials
The
_globalobject, introduced in Flash MX, finally provides an elegant way to create global varialbes and functions visible on all timelines. As mentioned earlier,
_globalis an object and adding properties to the
_globalobject means that we are adding global variables visible on all timelines. Here's a sample declaration:
_global.name = "yo";
Now the variable is available to all timelines. If we want to retrieve the value of the variable, we need to write only
namenot
_global.name.
The same means for global functions:
_global.sayMyName = function () {
trace("Mirza");
}
Now you can use
sayMyName()like other global functions
duplicateMovieClip(),
attachMovie()or
play().
Cao
Mirza
| » Level Basic |
|
Added: 2003-07-28 Rating: 7 Votes: 16 |
| » Author |
| Mirza Hatipovic, freelance developer from Bosnia and Hercegovina. |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!