| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: May 2001
Posts: 8
|
Hi Gang, I am trying to load variables from a text file and soon I will be trying to pull from a db like in Jesse's Tutorial on pulling from a db. (http://www.actionscripts.org/tutorials/intermediate/loadVariables_script_interaction/index.shtml)
Anyway back to the question 1. Does the loadVariablesNum() need to be in a on "event"() to fuction correctly? What I am trying to do is load my var's on the second frame then show them on frame 3 for rest of the movie, but what happens is I have to run through the entire movie then replay it and then my var's will display code for frame 2 loadVariablesNum ("test.txt", 0); var_output1 = var1+" "+var2; var_output1 = String(var_output1); if (var_output1.length == 0) { gotoAndPlay (1); } else if (var_output1.length == 1) { gotoAndPlay (3); } With the above code I belive that I am checking to see if the var's are loaded and if not do a loop and keep checking untill they load well my movie loads and plays frame 3 but no var's erver show up untill I run the movie again Thanks murphDOG |
|
|
|
|
|
#2 |
|
Flash-dB
Join Date: May 2001
Location: Boulder Colorado, USA
Posts: 51
|
I've found that if you give it a little more time to load the data it works better. It won't work, at least I don't think it will work if it's all in one frame. Spread it out. Call the text.txt in frame 2 then give it a couple of frames maybe 10 or so then do the check loop in between those frames. Maybe keep setting your var_output1 = var1+" "+var2; var_output1 = String(var_output1); on different frames then on the last frame use the
if (var_output1.length == 0) { gotoAndPlay (1); } else if (var_output1.length == 1) { gotoAndPlay (11); } Well maybe that helps, it's probably an inefficent way of doing it but it should work better. Also I'd watch out for the string function, it's probably returning a value even know there's not one. There for it goes to frame 3 in your code. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: May 2001
Posts: 2
|
for me it works this way...
put in some frame before (i always put it at the begining of the movie): var check="off"; and type in the text file with all of your other variables: check="on"&your_var1=123&your_var2="my+mamma+loves +me"&..... and then in some frame after (let's say label "loading"): loadVariablesNum ("variables.txt", 0); and then in frame just after that: if (check eq "off") { gotoAndPlay ("loading"); } else { gotoAndPlay ("wherever_you_want_coz_you_have_your_variables_lo aded"); } m@rcell.net |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LoadVariablesNum Question | Aquilo1974 | ActionScript 2.0 | 1 | 09-28-2004 09:56 AM |
| External text in external SWF: Loadvars Vs. LoadVariablesNum | marclalosh | ActionScript 1.0 (and below) | 6 | 02-09-2004 03:14 PM |
| loadvariables vs loadvariablesnum | rflorico | Server-Side Scripting | 1 | 09-16-2003 09:05 AM |
| loadVariablesNum remote? OH GOD SOMEBODY HELP ME!!! | BEEJAY | ActionScript 1.0 (and below) | 1 | 12-16-2002 02:48 PM |
| loadVariablesNum gotoAndStop | zapplets | ActionScript 1.0 (and below) | 2 | 04-04-2001 05:03 AM |