Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

actionscript syntax question

Status
Not open for further replies.

starblood

Technical User
Feb 28, 2001
63
GB
If I have two lines of code:

PickClip = random(15);
_parent.lett_14.scroll_14.text_14=_root.v7;

how do I change the syntax on the 2nd line so that "14" in the path is replaced with the random number "PickClip"?
 
which version of flash are you using as random like that is deprecated.

however ignoring that for the momemt

PickClip = random(15);
clip = "lett_" + pickclip;
scroll = "scroll_" + pickclip;
text = "text_" + pickclip;
_parent.clip.scroll.text=_root.v7;
 
_parent['lett_'+PickClip]['scroll_'+PickClip]['text_'+pickClip]=_root.v7
 
The whole path seems a bit like overkill to me though: I make it that there are 3375 possible clips to target if there really are 15 options at each stage.

 
Brilliant!

Thanks for the swift replies wangbar and billwatson, it works like a dream. I kinda thought the square brakets came into play somewhere, but just couldn't get it right.

wangbar, I haven't got that many clips. 'text_??' is a dynamic text variable, that is changed on the fly. I've got 14 bits of animated text, playing a maximum of five at a time, in which I want to change the words dynamically. More method to the madness now, I hope :)

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top