-
Hi friends,
Pls help me to call text file into flash by using javascript or other script language.
I would like to call text from text file(sample.txt) & i want to show in input box through scripiting.
regards
shree
-
loadvariables
You can use the loadvariables function to do this
create an mc with a text box in. set the text box to dynamic text and set variable to "textField".
drop an instance of the move into scene one and name it "text_box".
in the action layer set a keyframe as
loadVariables ("text.txt", "_root.text_box");
stop();
now make a .txt file and start it with the line
textField=
your text here
and save it in the same folder as the .fla (.swf)
this will load the .txt file into the text are when the .swf has loaded
-
hi Morris,
Thank you very much for ur instant reply on my problem.It really worked out to be fruitful and i am able to import text successfully into a flash file.Once again thank you very much.
shree
-
remember if u want to load several variables you need to do like this
variable=masa&variable2=masa2&variable3=masa3
-
How can I give variables in a textfile loaded
with loadVariables, a different variable ??
(Instead of showing them in a dynamic textbox...)
for example:
var1 = variable1_text.txt
var2 = variable2_text.txt
var3 = variable3_text.txt etc. etc.
Please help...Thank you!
-
Can anyone reply to my last post in this thread please ?
-
I'm not entirely sure what you mean, but do you want to have the variables in he text file renamed so you can use them elsewhere?
If you load in variable1="text here" you can just put in the actionscript:
newvariable = variable1
and when you call newvariable it will display "text here".
Is this what you mean? If not can you please elaborate.
-
Yes , this is what I mean...
I understand your explenation but how to write the
actionscript.
for loading it into a text box I use:
loadVariables ("text.txt", "instance.textbox")
I'm not sure how to write it for loading only...
just loadVariables ("text.txt") ??
Thanks for your reply
-
You could do one of two things. You could do
loadVariables("text.txt", ""); or
loadVariablesNum("text.txt", 0);
You dont need to load variables into text boxes. The text boxes just show what the value of the variable is.
-
oke...
and how can I target a variable in a text file ?
example:
button 1 shows "text.txt" variable 1 in main_textbox
button 2 shows "text.txt" variable 2 in main_textbox
etc.
-
well if you have a text field called "textfield" for instance you would do this:
load in the variables and in button1 have
on (release) {
textfield = variable1;
}
on the other one:
on (release) {
textfield = variable2;
}
nothing to it really.
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
|