This is my first time posting and I’m very new to as3 but I came over from as2 and was fairly comfortible there with scripting. But alas the times are changing and I must upgrade my syntax or risk becoming a forgotten dinosaur…lol
I was curious if there is an easier way to build a set of functions dynamically? any help is appreciated. Each function cooresponds to a unique event on the timeline of playme. I would like to be able to build a for loop and do this in 8-9 lines of code insead of this hot mess…lol
this is in my document class and the other fucntions referenced are located in custom classes.
var funcArray:Array = [func0, func1, func2, func3, func4, func5, func6];
function func0(e:MouseEvent):void{
trace(“func0 = null”);
}
function func1(e:MouseEvent):void{
playme.gotoAndPlay(“one”);
playme.getCurrentMarker();
mainButtonsToggle();
}
function func2(e:MouseEvent):void{
playme.gotoAndPlay(“two”);
playme.getCurrentMarker();
mainButtonsToggle();
}
function func3(e:MouseEvent):void{
playme.gotoAndPlay(“three”);
playme.getCurrentMarker();
mainButtonsToggle();
}
function func4(e:MouseEvent):void{
playme.gotoAndPlay(“four”);
playme.getCurrentMarker();
mainButtonsToggle();
}
function func5(e:MouseEvent):void{
playme.gotoAndPlay(“five”);
playme.getCurrentMarker();
mainButtonsToggle();
}
function func6(e:MouseEvent):void{
playme.gotoAndPlay(“six”);
playme.getCurrentMarker();
mainButtonsToggle();
}