Ask a Question related to Macromedia Flash, Design and Development.
-
cowiefr@yahoo.com #1
Dynamic Text Value???
Hi all,
I'm stumped by the following code:
for(i=0; i<100; i++) {
tellTarget ("sq"+(i+1))
{numval = i};
trace(i+1);
}
I have 100 instances of a movieclip named "sq1...100" each with a
dynamic text box with a variable named "numval". The code above traces
1 to 100 but the movieclip.dynamictext for each is BLANK!!. If I
replace {numval = i} with {numval = 30) they all have a thirty in them.
If I use {numval = "x") they all have an x in them.
Please help.
Fain
cowiefr@yahoo.com Guest
-
load external text to dynamic text field in levels
Dear Sir I found the Tech Noe Index #16238 is useful in creating dynamically loaded text from external text file. However, the method mentioned... -
Dynamic text box within dynamic movie clip
I'm having a similar problem. On mine I noticed that although the text doesn't show and the border doesn't show, the cursor changes appropriately... -
How to center text in dynamic HTML text field ???
In Flash MX 2004 I suddenly find myself comletely helpless trying to align all text to the center in my dynamic text field. I dont recall running... -
Dynamic text fields. Continuing text over columns
Hi I'm doing a mock up news paper article over 4 columns in flash mx and the text loads in dynamically. I have 4 dynamic text boxes sitting side... -
Dynamic Text Loaded from Text files -> Flash 5 <-
I was wondering how I can dynamically load text into a text box from a text file using Flash 5. I've seen plenty infos how to do it with Flash MX but... -
Jeckyl #2
Re: Dynamic Text Value???
for(i=0; i<100; i++) {
tellTarget ("sq"+(i+1))
{numval = i};
trace(i+1);
}
that is going to copy the value of 'i' in your sq1 to variable 'numval' in
sq1 etc .. it won't even look at the value of 'i' in your loop, because of
the tellTarget.
if the above code was in a function , and you used
for (var i=0; i<100; i++) {
....
}
then it would work, as local variable are found first regardless of the
tellTarget saying to look elsewhere.
--
All the best,
Jeckyl
Jeckyl Guest
-
JP #3
Re: Dynamic Text Value???
Try changing it to:
for(i=0; i<100; i++) {
eval("sq"+(i+1)).numval = i;
}
or, if the i+1 bit misbehaves,
for(i=1; i<=100; i++) {
eval("sq"+i).numval = i-1;
}
not the neatest thing ever, but I use it loads!
-JP
[url]http://www.maths-pgce.co.uk/[/url]
JP Guest
-
cowiefr@yahoo.com #4
Re: Dynamic Text Value???
Thanks guys. I got it working.
cowiefr@yahoo.com Guest



Reply With Quote

