user3121611
user3121611

Reputation: 17

Flash as3 stop(); not working?

I put my code in a out side as3 file and when i try to use the trace it works fine, but when a i add a stop after, it won't work, why? here is my code:

package {
    import flash.display.Sprite;
        public class TDSBMaze extends Sprite {
            public function TDSBMaze() {
                trace("Test");
                stop();
    }
  }
}

And also when i try to just put the code in a frame it also won't work unless i unlink the outside .as file.

Upvotes: 0

Views: 654

Answers (2)

Anil
Anil

Reputation: 2554

You need to extend MovieClip if you wish to make use of a timeline. Sprites do not have timelines.

package {
    import flash.display.MovieClip;

    public class TDSBMaze extends MovieClip {
        public function TDSBMaze() {
            trace("Test");
            stop();
        }
    }
}

Upvotes: 1

Alex
Alex

Reputation: 21

Sprites do not have a timeline, so it can't stop since it never plays. If you need a timeline, you should extend MovieClip.

Upvotes: 2

Related Questions