1 Reply Latest reply on Jun 5, 2007 12:48 PM by Newsgroup_User

    _root alternative in AS3

    j0mills
      So, I made the decision to start using AS3. Turns out it wasn't that great of an ideas because now I'm trying to meet a deadline and figure out stupid little problems, like for an example:

      I have a preloader that runs a movie clip. I want this movie clip to play through regardless of whether or not the preloading has completed. In AS2 I had a single line that said _root.preloader_done = 1; This no longer works. I get 1120: Access of undefined property _root.
        • 1. Re: _root alternative in AS3
          Level 7
          j0mills,

          > In AS2 I had a single line that said _root.preloader_done = 1;
          > This no longer works. I get 1120: Access of undefined property _root.

          The closest analogue is the DisplayObject.stage property. Anything that
          inherits from DisplayObject (say, MovieClip) has an instanceName.stage
          property that points to what is arguably the "_root" of the movie (there is
          only one Stage object in a Flash application).


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."