Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: F5 better actionscripting - looping question
From: Helen Triolo
Date: Fri, 22 Dec 2000 19:19:00 GMT

combinedVars = "";
for (i=1; i<10; i++) {
_root["var"+i] = othervar1 + _root["name"+i] + othervar2 + newline;
combinedVars = combinedVars + _root["var"+i];
}

(if the variables are in a mc instead of on the main timeline, then
change _root to _root.mcname)

Happy holidays and New Year to everyone! (had to get one last
actionscript post in before heading off to la bella Roma to see in the
new year ;-) have a safe and happy one, everyone!

Ciao,
Helen
-----------------------------------------------------
i-Technica � http://i-technica.com � 301.424.6037
developer resources: http://i-technica.com/whitestuff

jmerrillatelftech [dot] com wrote:
>
> I have an "improvement" question. The following F5 actionscript works OK
> for me:
>
> var1 = otherVar1+name1+otherVar2+newline
> var2 = otherVar1+name2+otherVar2+newline
> var3 = otherVar1+name3+otherVar2+newline
> var4 = otherVar1+name4+otherVar2+newline
> var5 = otherVar1+name5+otherVar2+newline
> var6 = otherVar1+name6+otherVar2+newline
> var7 = otherVar1+name7+otherVar2+newline
> var8 = otherVar1+name8+otherVar2+newline
> var9 = otherVar1+name9+otherVar2+newline
> combinedVars = var1+var2+var3+var4+var5+var6+var7+var8+var9;
>
> However, I know this is not the most efficient way of doing this, and
> comming from Authorware, I know this can be done with a repeat loop. I
> just don't know how to say it in actionscript. Would it be something like,
>
> n=1;
> while (n<10) {
> var(n) = otherVar1+name(n)+otherVar2+newline;
> n++;
> }
>
> ? I know this isn't quite right, can someone see what I'm trying to do,
> and point me in the right direction?
>
> Thanks
>
> Jason Merrill

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: F5 better actionscripting - loopi, jmerrill

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]