Skip to main content
Known Participant
November 4, 2009
Question

problem on gotoAndStop on OO

  • November 4, 2009
  • 1 reply
  • 821 views

here, I have one movieClip with class name EngLang. I found my movieClip on my stage and when I click on that movieClip , Actually, I need to go on frame no 10 but I got some errors


Call to possibly undefined method gotoAndStop
Warning:1060 Migration issue : The method gotoAndStop is no longer supported . For more information, see MovieClip.gotoAndStop()..

Why I am not triger to frame ? What was the cause ?

Language.as


package gallery{


     import flash.display.MovieClip;
     import flash.display.Sprite;
     import flash.events.MouseEvent;
     import flash.display.Sprite;
     import flash.text.TextField;


    public class Language{


              public var engLang:MovieClip;


             //Constructor

             public function Language(){


                engLang=new EngLang();


                engLang.addEventListener(MouseEvent.CLICK,engLangClick);

             }


            function engLangClick(event:MouseEvent):void{
                gotoAndStop(10);
           }


    }

}

main.fla in frame1

import gallery.*;
import flash.display.MovieClip;
import flash.text.TextFormat;
import flash.display.*;


var language:Language=new Language();

this.addChild(language.engLang);

,

This topic has been closed for replies.

1 reply

Participating Frequently
November 4, 2009

Your Language class doesn't extends the MovieClip class so it can't have gotoAndStop method.

If you want the engLang to go to frame 10 and stop try this ...

function engLangClick(event:MouseEvent):void{
      event.currentTarget.gotoAndStop(10);

}

or

function engLangClick(event:MouseEvent):void{
      engLang.gotoAndStop(10);

}