Skip to main content
Inspiring
December 25, 2012
Question

How to use nextScene.gotoandplay link using class property (external code.as)

  • December 25, 2012
  • 1 reply
  • 500 views

i try this code but i got error

package  {

           

                        import flash.display.SimpleButton;

                        import flash.display.MovieClip;

                        import flash.events.MouseEvent;

           

                        public class np extends SimpleButton {

                       

                        public function np() {

                                                this.addEventListener(MouseEvent.CLICK, clickF);

                                                }

                                                private function clickF(e:MouseEvent):void{

                                                MovieClip(this.root).nextScene(),gotoAndStop(1);

                                                           

                        }

            }

           

}

Call to possibly undefined method gotoanStop

Note: i want to go next scene

This topic has been closed for replies.

1 reply

71081Author
Inspiring
December 25, 2012

Thx guys

I got the solution

package  {

          

                        import flash.display.SimpleButton;

                        import flash.display.MovieClip;

                        import flash.events.MouseEvent;

          

                        public class np extends SimpleButton {

                      

                        public function np() {

                                                this.addEventListener(MouseEvent.CLICK, clickF);

                                                }

                                                private function clickF(e:MouseEvent):void{

                                                MovieClip(this.root).nextScene();

                                                          

                        }

            }

          

}