Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-06-2002, 06:12 PM   #1
jmguitard
Registered User
 
Join Date: Feb 2002
Posts: 7
Unhappy Problems with loadVariables();

Hey, ummm

Well ...Later, I plan on getting my entry information from a database... but for the moment, I simply want to get my variables from a external text file. Umm.... I "think" I have used loadVariables(); correctly.... but I'm not to sure....


//File name is "January_2002.text"
//I wanted to place the info on the _root
// would this be correct way to access the file? I always thought it was.

loadVariables('January_2002.txt',0,"GET");

Anyway.... I think my problem may have more to do with finding a correct way to access the variables, after I have brought them into Flash. I don't get any errors from the output window when I test it.... So it does find the file.

So, let say the content my external file looks like this: var1=Ron&var2=Jeremy

In Flash, could I see the variable simply by doing something like:

trace(var1+var2);

or

firstName=var1;
lastName=var2;

I have tried using the variables directly, like in the examples above... but that doesn't seem to work.

Any thoughts?

Thanks,
JM Guitard







jmguitard is offline   Reply With Quote
Old 02-06-2002, 09:08 PM   #2
Syn09
Registered User
 
Join Date: Feb 2002
Posts: 3
Default

Hey,

I think I had a similar problem a couple of weeks ago. I have a .txt file with 28,000 variables in it that I had to stream into Flash. I wound up using an #include statement to access the .txt file as an .as file.

But looking at what you've written I think this might work for you;

Quote:
loadVariablesNum ("./January_2002.txt",0);
Good-Luck
Syn09 is offline   Reply With Quote
Old 02-06-2002, 09:12 PM   #3
jmguitard
Registered User
 
Join Date: Feb 2002
Posts: 7
Default

I'll give it a try... thanks for replying....
Cheers,
JM Guitard
jmguitard is offline   Reply With Quote
Old 02-07-2002, 06:21 AM   #4
nic
Registered User
 
Join Date: Nov 2001
Location: Australia
Posts: 248
Default

loadVariables ("path/anotherPath/yourTextFile.txt", _root);
if (_root:flag == "done") {
gotoAndPlay ("main", "ready");
}...

The if statement is looped to check for the last var, called "flag" with a value of "done". This makes sure all yer vars are loaded before anything happens:: this has been referred to on this site as swonking - do a search if you don't believe me!

Enjoy.

timeToGoHome = rightNow
nic is offline   Reply With Quote
Old 02-07-2002, 06:22 AM   #5
nic
Registered User
 
Join Date: Nov 2001
Location: Australia
Posts: 248
Default Ps

Ps. the path to the txt file should be relative to the htm file, rather than wherever the embedded .swf is living...

Really home going now!
nic is offline   Reply With Quote
Old 02-15-2002, 06:47 AM   #6
guernica
Registered User
 
Join Date: Feb 2002
Posts: 6
Default

Hi

I've used #include for both .txt & .as files and yet each time I make changes to the external file I have to republish the .fla in order for the changes to take effect. Why is this? Can I get around it some way?
guernica is offline   Reply With Quote
Old 02-16-2002, 01:29 AM   #7
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

include is a p ublish time operation. That is, the code is pasted in when you publish from Flash. There's no way to get around that in Flash 5.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Loading Text Into a Textbox holdaway ActionScript 2.0 6 02-03-2004 04:21 AM
Problems accessing text with loadvariables russhuntington ActionScript 1.0 (and below) 1 01-20-2004 09:04 PM
levels, linkage of audio, and load movie problems to a specfic frame problems ooolie ActionScript 1.0 (and below) 0 12-05-2002 07:54 PM
loadVariables, subdomains, and ports joelk42 ActionScript 1.0 (and below) 0 07-05-2002 10:15 PM
Animation stops during loadVariables DaveAMS ActionScript 1.0 (and below) 2 01-05-2002 04:23 AM


All times are GMT. The time now is 10:46 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.