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

Next/previous buttons that are moving between different animations.

New Here ,
Nov 26, 2015 Nov 26, 2015

Gyazo - 0260741e4ce22250745972c4f8122aef.png

here is an image of my interface, I have 5 buttons : left,right,3 buttons with animations in it, my code doesnt show any errors but when i try to run swf file ,nothing happens,here is my code,any suggestions?

package {

  import flash.display.MovieClip;

  import flash.events.MouseEvent;

  public class animationinterface extends MovieClip {

  //var interfacewindow:Interfacewindow;

  var interface1:Interface1;

  //var animation3:Animation3;

  var animation2:Animation2;

  var animation1:Animation1;

  public function animationinterface() {

  //interfacewindow = new Interfacewindow();

  interface1 = new Interface1();

  //animation3 = new Animation3();

  animation1 = new Animation1();

  animation2 = new Animation2();

  addChild(interface1);

  //Add event listeners

  interface1.buttonleft.addEventListener(MouseEvent.CLICK, left);

  interface1.buttonright.addEventListener(MouseEvent.CLICK, right);

  //interfacewindow.animation1.addEventListener(MouseEvent.CLICK, an1);

  //interfacewindow.animation2.addEventListener(MouseEvent.CLICK, an2);

  }

  //Event handlers

  function left(event:MouseEvent): void {

  addChild(animation1);

  removeChild(interface1);

  }

  function right(event:MouseEvent): void {

  addChild(animation2);

  removeChild(interface1);

  }

  /* function an1(event:MouseEvent):void

  {

  addChild(animation1);

  removeChild(interfacewindow);

  }

  function an2(event:MouseEvent):void

  {

  addChild(animation2);

  removeChild(interfacewindow);

  }

  */

  }

}

TOPICS
ActionScript
470
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

Enthusiast , Nov 27, 2015 Nov 27, 2015

image.jpg

The class "animationinterface.as" file must be saved in the same directory of the flash project & swf files, Then test the movie..

Translate
Enthusiast ,
Nov 26, 2015 Nov 26, 2015

You have to link the "animationinterface" class to some movie clip and add it to the stage or make it the main class..

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
New Here ,
Nov 27, 2015 Nov 27, 2015

Hey,thanks for the help,but it didnt work(

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
Enthusiast ,
Nov 27, 2015 Nov 27, 2015

image.jpg

The class "animationinterface.as" file must be saved in the same directory of the flash project & swf files, Then test the movie..

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
New Here ,
Nov 27, 2015 Nov 27, 2015

oh im so sorry,thanks a lot!)

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
Enthusiast ,
Nov 27, 2015 Nov 27, 2015
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