-
Dynamic variable name with text file
hello guy,
is it possible to make dynamic text field name dynamic name?
example
here is a simple text file containing the variable names (mytext.txt)
sentence1=mytext1
&sentence2=mytext2
&sentence3=mytext3
&sentence4=mytext4
and so on..
action script:
loadVariables("mytext.txt", "_root");
in the main stage i have a dynamic text field with var name "sentence"
i need something like this:
sentence="sentence"+._currentframe
so if ._currentframe = 2 the text box should display "mytext2" not "sentence2"
any help is appreciated
Thank you
-
Remove the quotes so you don't use the String "sentence" but the variable. Ex:
sentence=sentence+_currentframe;
Also remove the dot before _currentframe. Use it only if you add a path, ec: this._currentframe.
gparis
-
i need the the dynamic text field read the value from the loaded text file not from flash, i am using eval function but it return undefined.
sentence=eval ("sentence"+_currentframe);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|