problem creating class to change scene
Hello!. I need a little help (I think).
This code works great in the action panel:
selectArrow.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_29);
function fl_ClickToGoToScene_29(event:MouseEvent):void{
if (option_440.currentLabel == "uno" && dminorItalian.currentLabel == "uno"){
MovieClip(this.root).gotoAndPlay(1, "Standars_All");
}
else if (option_440.currentLabel == "uno" && bminorItalian.currentLabel == "dos"){
MovieClip(this.root).gotoAndPlay(2, "Standars_All");
}
else if (option_415.currentLabel == "dos" && dminorItalian.currentLabel == "uno"){
MovieClip(this.root).gotoAndPlay(3, "Standars_All");
}
else if (option_415.currentLabel == "dos" && bminorItalian.currentLabel == "dos"){
MovieClip(this.root).gotoAndPlay(4, "Standars_All");
}
else{
MovieClip(this.root).gotoAndPlay(1, "Standars_All");
}
}basically it is an MC (selectArrow) that takes the film to a different scene and, depending on which frames the other four MCs are in, it goes to one frame or another of the "Standars_all" scene.
when I create a class for this code it doesn't work.
package componentes {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Controladores {
var _415:MovieClip;
var highKey:MovieClip;
var lowKey:MovieClip;
var rightArrow:MovieClip;
public function Controladores(_440:MovieClip, _415:MovieClip, highKey:MovieClip, lowKey:MovieClip, rightArrow:MovieClip)
{
var _440:MovieClip = new MovieClip();
_415 = new MovieClip();
highKey = new MovieClip();
lowKey = new MovieClip();
rightArrow = new MovieClip();
rightArrow.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_29);
function fl_ClickToGoToScene_29(event:MouseEvent):void{
if (_440.currentLabel == "uno" && highKey.currentLabel == "uno"){
MovieClip(this.root).gotoAndPlay(1, "Standars_All");
}
else if (_440.currentLabel == "uno" && lowKey.currentLabel == "dos"){
MovieClip(this.root).gotoAndPlay(2, "Standars_All");
}
else if (_415.currentLabel == "dos" && highKey.currentLabel == "uno"){
MovieClip(this.root).gotoAndPlay(3, "Standars_All");
}
else if (_415.currentLabel == "dos" && lowKey.currentLabel == "dos"){
MovieClip(this.root).gotoAndPlay(4, "Standars_All");
}
else{
MovieClip(this.root).gotoAndPlay(1, "Standars_All");
}
}
}
}
}
the MC "selectArrow" does nothing .... but does not give an error ...
Thank you very much for the help
