How would one go about creating a function inside a for loop that does not have a button action attached to it while still having access to the current index number.
This code was found on senocular:
var curr_button; for (var i=1; i<=3; i++){
curr_button = this["button"+i];
curr_button.num = i;
curr_button.onRelease = function(){
trace(i); // would trace 4 for each button
trace(this.num); // the value of i when the onRelease was created
}
}
This is all great however i would like the functions to just be regular old functions, not button actions (onPress), is this possible?
Thanks, lurker here for years.