strantheman
Programmer
I hope this isn't confusing. Im using instances to setup some buttons. In frame one I have:
but_1.onRollOver = function(){
rollover (2);
}
but_2.onRollOver = function(){
rollover (3);
}
Using instances, I can setup all of my responses in one frame for much better code organization than having code in other frames. When you rollover button 1, it executes rollover(2); and when you rollover button 2, it executes rollover(3); ... but I will eventually have about 30 of these buttons. I want to loop over the creation of these instances so I don't have to hand code every one. Here's my for loop:
for (i=0;i<2;i++)
{
incr = i+1;
xxx = "but_" + i + ".onRollOver = function(){ rollover (" + incr + "
; }";
evaluate(xxx);
}
So, it creates a string that sets up the instance and looks exactly like the hand coded one, and then theoretically it would evaluate the string and action script would understand it. I figured the evaluate() command would do this since its description in the Help library is "Action; creates a new empty line and inserts a semicolon (
for writing statements to be evaluated in the Actions panel. "
I really hope someone out there has done evaluations/ delayed evaluations like this before, and also has knowledge of instancing, a very new MX feature.
thanks for your time
strantheman
but_1.onRollOver = function(){
rollover (2);
}
but_2.onRollOver = function(){
rollover (3);
}
Using instances, I can setup all of my responses in one frame for much better code organization than having code in other frames. When you rollover button 1, it executes rollover(2); and when you rollover button 2, it executes rollover(3); ... but I will eventually have about 30 of these buttons. I want to loop over the creation of these instances so I don't have to hand code every one. Here's my for loop:
for (i=0;i<2;i++)
{
incr = i+1;
xxx = "but_" + i + ".onRollOver = function(){ rollover (" + incr + "
evaluate(xxx);
}
So, it creates a string that sets up the instance and looks exactly like the hand coded one, and then theoretically it would evaluate the string and action script would understand it. I figured the evaluate() command would do this since its description in the Help library is "Action; creates a new empty line and inserts a semicolon (
I really hope someone out there has done evaluations/ delayed evaluations like this before, and also has knowledge of instancing, a very new MX feature.
thanks for your time
strantheman