Very basic variable question
I can get my way around Javascript and PHP, but simple things in AS3 stump me.
The following code works fine:
slideIn();
function slideIn():void
{
var myTween:Tween = new Tween(_root.content_txt1,"y",Strong.easeOut,-150,5,3,true);
}
I want to reuse the function for different items by inserting an argument (num) in the function. The trace function shows me that the variable has the correct value. However, the Tween doesn't parse the variable "item". It looks for an item named "item", resulting in an error.
slideIn(1);
function slideIn(num):void
{
var item = "_root.content_txt" + num;
trace(item);
var myTween:Tween = new Tween(item,"y",Strong.easeOut,-150,5,3,true);
}
Thanks.