Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error #2109 Help -

Community Beginner ,
Sep 30, 2009 Sep 30, 2009

Hi, I'm trying to drag a movieclip on stage, and with nine existing button instances, cause that movie clip to jump around and run at different labels (which are within the movie clip itself. I'm not sure what I'm doing wrong, but I get the error #2109 which says (similar error for each button):

ArgumentError: Error #2109: Frame label this.FlashLogo.logo1 not found in scene Scene 1.
at flash.display::MovieClip/gotoAndPlay()
at flash_fla::MainTimeline/logo1Over()

Any idea what I'm doing wrong? Here is my script:

function logo1Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo1");
}
function logo2Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo2");
}
function logo3Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo3");
}
function logo4Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo4");
}
function logo5Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo5");
}
function logo6Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo6");
}
function logo7Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo7");
}
function logo8Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo8");
}
function logo9Over(event:MouseEvent):void {
gotoAndPlay("this.FlashLogo.logo9");
}

// Event Listeners for all logo buttons
pbutton.addEventListener(MouseEvent.ROLL_OVER, logo1Over);
wfbutton.addEventListener(MouseEvent.ROLL_OVER, logo2Over);
fbutton.addEventListener(MouseEvent.ROLL_OVER, logo3Over);
bafbutton.addEventListener(MouseEvent.ROLL_OVER, logo4Over);
mbutton.addEventListener(MouseEvent.ROLL_OVER, logo5Over);
tbutton.addEventListener(MouseEvent.ROLL_OVER, logo6Over);
wbutton.addEventListener(MouseEvent.ROLL_OVER, logo7Over);
gbutton.addEventListener(MouseEvent.ROLL_OVER, logo8Over);
fbutton.addEventListener(MouseEvent.ROLL_OVER, logo9Over);

FlashLogo is the name of the movieclip instance that I placed on the stage with the other buttons.

Thanks, Dan Pearce

TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 01, 2009 Oct 01, 2009

You would want to make a set of listeners for ROLL_OUT events, similar to what you did for the ROLL_OVER events.  But if they all involve the same movieclip, you would only need one event handler function for all of them since the result is the same for all of them, telling the movie to go to its first frame.

Just as a note, if the buttons are all controlling the same movieclip, then you could probably reduce your coding effort substantially by renaming the buttons and using their names in the co

...
Translate
LEGEND ,
Sep 30, 2009 Sep 30, 2009

I think what you need to do is change the lines to something like the following...

function logo1Over(event:MouseEvent):void {
     this.FlashLogo.gotoAndPlay("logo1");

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 30, 2009 Sep 30, 2009

Thanks, worked like a charm!

Ned, any idea how I would make that symbol start itself over at frame one (frame one within the symbol) when the user went off of it with their mouse?

Thanks, Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2009 Oct 01, 2009

You would want to make a set of listeners for ROLL_OUT events, similar to what you did for the ROLL_OVER events.  But if they all involve the same movieclip, you would only need one event handler function for all of them since the result is the same for all of them, telling the movie to go to its first frame.

Just as a note, if the buttons are all controlling the same movieclip, then you could probably reduce your coding effort substantially by renaming the buttons and using their names in the code.  If you named them as the frame labels you go to, then you could have one event handler function work for all of them that works something like...

function btnClicked(evt:MouseEvent):void {

     this.FlashLogo.gotoAndPlay(evt.currentTarget.name);

}

// Event Listeners for all logo buttons
logo1.addEventListener(MouseEvent.ROLL_OVER, btnClicked);
logo2.addEventListener(MouseEvent.ROLL_OVER, btnClicked);
logo3.addEventListener(MouseEvent.ROLL_OVER, btnClicked);

etc....

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 01, 2009 Oct 01, 2009

Thanks so much Ned.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 02, 2009 Oct 02, 2009
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines