4 Replies Latest reply on May 15, 2007 10:28 AM by Newsgroup_User

    stage.invalidate()

    romked
      I run stage.invalidated and I get this error: Error #1065: Variable stage is not defined. What am I doing wrong here?
        • 1. Re: stage.invalidate()
          kglad Adobe Community Professional & MVP
          did you mean to use:

          • 2. Re: stage.invalidate()
            romked Level 1
            ha yes that's what I mean: stage.invalidate();
            • 3. Re: stage.invalidate()
              kglad Adobe Community Professional & MVP
              and you see that error message? if so, copy and paste the code you used in your fla.
              • 4. Re: stage.invalidate()
                Level 7
                if called correctly, then it means you are calling it in a scope where stage
                is not accessible.

                The stage property is only available to DisplayObject instances (including
                all subclasses like MovieClip). In addition the stage property will be null
                if the DisplayObject instance is not a child of a display list attached to
                the stage.

                So if you are using this in a class definition that is not a DisplayObject,
                you will need to pass in a reference to stage into that class so that it can
                be referenced (or use the stage property of a display object accessible
                within that class) or if you are in the scope of a display object, you need
                to make sure it is attached to the stage. In Flash Player 9.0.28.0+ you can
                use the Event.ADDED_TO_STAGE ("addedToStage") event to determine this.

                "romkeedehaan" <webforumsuser@macromedia.com> wrote in message
                news:f2cpga$pk8$1@forums.macromedia.com...
                > ha yes that's what I mean: stage.invalidate();