Here we are again with a new tip which could reveal itself very useful.
This idea comes from this topic: Document Class .
We have seen until now that often we need to be able to pass the value of the main root of our application from the Document Class to the classes which build our application.
Sometimes, it is necessary to retrieve a MovieClip placed on stage and without the value of the root passed to the Document Class we would not be able to retrace that Movieclip.
In few words, with Actionscript 2.0 it was an easy task, using simply _root.MovieClipName (the so called Composition) from any classes to get to a MovieClip placed on stage.
With Actionscript 3.0, _root has been removed as the entire concept of levels and timeline have been changed.
As an example:
I have main.fla associated to the Document Class ‘Main.as’ and on stage, I have a MovieClip named ‘test_mc’. In the library of ‘main.fla’, I have another MovieClip associated to a Class (linkage or id) named ‘Clip.as’ that I would like to attach ( ex method attachMovie ) from the Document Class.
The first question to be asked is: how to I retrieve ‘test_mc’ on stage of ‘main.fla’ from ‘Clip.as’?
Let us look at it…







{ 0 comments… add one now }