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

I don't understand why my code is not working please help!

New Here ,
Apr 06, 2014 Apr 06, 2014

Copy link to clipboard

Copied

import(flash.events.MouseEvent);{

 

}

stop();

button1.addEventListener(MouseEvent.CLICK,showpic1);

button1.addEventListener(MouseEvent.CLICK,showpic2);

button1.addEventListener(MouseEvent.CLICK,showpic3);

button1.addEventListener(MouseEvent.CLICK,showpic4);

function showpic1(Event:MouseEvent);{

          gotoAndstop("pic1");

}

function showpic2(Event:MouseEvent);{

          gotoAndstop("pic2");

}

function showpic3(Event:MouseEvent);{

          gotoAndstop("pic3");

}

function showpic4(Event:MouseEvent);{

          gotoAndstop("pic4");

 

}

TOPICS
ActionScript

Views

279

Translate

Translate

Report

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 ,
Apr 06, 2014 Apr 06, 2014

Copy link to clipboard

Copied

AS3 is case sensitive. gotoAndStop() method must have capital "S"

Votes

Translate

Translate

Report

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 ,
Apr 06, 2014 Apr 06, 2014

Copy link to clipboard

Copied

Also, what are these brackets around and after import statement? Use just this:

import flash.events.MouseEvent;

Votes

Translate

Translate

Report

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 ,
Apr 06, 2014 Apr 06, 2014

Copy link to clipboard

Copied

LATEST

And another thing. Event (with capital E) is a particular datatype in AS3. You should avoid using reserved words. The handlers should look like this:

function showpic1(event:MouseEvent);

{

          gotoAndStop("pic1");

}

Votes

Translate

Translate

Report

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