|
-
Senior Member
LoadVariablesNum problems
I am trying to use the loadvariablenum actionscript to load a external text file. It works but the text opens in its own internet explorer window and not the text box that I want it to load into. This is the code I am using
loadVariablesNum("Otterspecs.txt","textbox");
What am I doing wrong?
thanks
-
Junior Member
welll... wrong syntax, loadVariablesNum requires two inputs, a path to the file, and a number.
assuming your text file is formatted corrcetly, eg
Code:
&textbox=a long string of text
then
code:
loadVariablesNum("Otterspecs.txt",0);
should safely load text into a text box with variable name "textbox" in the _root of your movie.
However, I'd suggest not using loadVariablesNum, instead the loadVars object is much nicer!
code:
var ld=new loadVars
ld.onLoad=function(success){
if(success) {
_root.textbox=ld.textbox;
} else {
trace("an error occured!")
}
}
ld.load("Otterspecs.txt")
Hariyemadzisawira nhaka yedu! Down the SCUD and win!
I'm too lazy to read Private Messages.
-
Senior Member
Ok, I tried both and it still doesn't work.. I am using MX 2004 does that matter???
-
Junior Member
wait 1 minutre, i'll make a .fla for you.
Hariyemadzisawira nhaka yedu! Down the SCUD and win!
I'm too lazy to read Private Messages.
-
Senior Member
thanks.. how do I add a scroll bar to it.. I can't get that to work either.. newbie sorry
-
Junior Member
sorry- sloppy code I wrote out the first time!
attached a working example.
Hariyemadzisawira nhaka yedu! Down the SCUD and win!
I'm too lazy to read Private Messages.
-
Junior Member
and this one has a scroll bar attached..
Hariyemadzisawira nhaka yedu! Down the SCUD and win!
I'm too lazy to read Private Messages.
-
Senior Member
Thanks alot that worked.. the scrollbar didn't though.. my text seems to be spread out thats why i was going to use a scroll bar..
-
Junior Member
The scrollbar should work, as long as the text is long enough.
anyway, you can add your own easily enough: just create a textBox on the stage. Give it an instance name. Now drag a scrollBar componant from the componants panel onto it.
Look at the properties panel of the scrollbar- in the parametres, you'll see that the instance that it is targeting is the textbox you've just created.
Now, feel free to move the scrollbar to whereveer you wish, and to resize it to whatever pleases you.
Hariyemadzisawira nhaka yedu! Down the SCUD and win!
I'm too lazy to read Private Messages.
-
Senior Member
Thanks for you help.. I must be doing something wrong because it wont work.. anyway, I appreciate all your help..
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
|