Copy link to clipboard
Copied
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);
}
*/
}
}
The class "animationinterface.as" file must be saved in the same directory of the flash project & swf files, Then test the movie..
Copy link to clipboard
Copied
You have to link the "animationinterface" class to some movie clip and add it to the stage or make it the main class..
Copy link to clipboard
Copied
Hey,thanks for the help,but it didnt work(
Copy link to clipboard
Copied
The class "animationinterface.as" file must be saved in the same directory of the flash project & swf files, Then test the movie..
Copy link to clipboard
Copied
oh im so sorry,thanks a lot!)
Copy link to clipboard
Copied
You're welcome.