Flasher Archive

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


Subject: Re: FLASH: F5 better actionscripting - looping question
From: jmerrill
Date: Fri, 22 Dec 2000 19:49:42 GMT


Thanks. However this script still will not work for me. Could it be
becasue "_root" is not finding the variable I am referring to, which is a
string variable loaded from an external text file in the same script using:

onClipEvent (load) {
loadvariables ("text.txt", "");
}

Will "_root" still be applicable if I am loading variables this way? I
assume so, the script is an action assigned to a MC. It should work,
right? Since the variables are loaded into the same level?

Helen's example:

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


Jason Merrill
Multimedia/Courseware Developer @ ELF, Issaquah, WA
425.369.5214
SerengetiUS.com - "Where Law Does Business"

Seattle Macromedia Authorware User's Group



Helen Triolo
<designer@i-tec To: flasheratchinwag [dot] com
hnica.com> cc:
Sent by: Subject: Re: FLASH: F5 better actionscripting - looping question
owner@chinwag.c
om


12/22/00 11:00
AM
Please respond
to flasher






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





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
  Re: FLASH: F5 better actionscripting - l, Helen Triolo

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