Reputation: 239
I was thinking of making a function which can be called and will send to the called label..
Well, I currently do this for all buttons:
myButtonSomething.addEventListener(Event, GoToLabelSomething);
function GoToLabelSomething (e:Event):void{
this.gotoAndStop("Something");
}
Would it not be possible to do so that.. Like in PHP it would be this:
GoToLabel("something");
function GoToLabel($label) {
// gotoAndStop($label); or something....
}
I hope I make sense :D
Upvotes: 1
Views: 639
Reputation: 13532
Are you looking for something like this :
var labelName:String = "something";
myButtonSomething.addEventListener(Event, function(e:Event){
GoToLabel(labelName);
});
function GoToLabel (name:String):void{
this.gotoAndStop(name);
}
Upvotes: 1