Skip to main content
olejkane
Participant
November 27, 2015
Answered

Next/previous buttons that are moving between different animations.

  • November 27, 2015
  • 1 reply
  • 531 views

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);

  }

  */

  }

}

This topic has been closed for replies.
Correct answer nezarov

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

1 reply

Inspiring
November 27, 2015

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

olejkane
olejkaneAuthor
Participant
November 27, 2015

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

nezarovCorrect answer
Inspiring
November 27, 2015

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