Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-28-2006, 06:02 PM   #1
DruidAnimal
Registered User
 
Join Date: Aug 2005
Posts: 9
Default having problems with loadVariables

Here is the code i have:

Code:
_root.loadVariables("plantData.txt");

_root.photoNumber = Number(photonumber);
_root.plantName = String(plantname);
trace (photoNumber)

photo_mc.loadMovie("photo"+photoNumber+".jpg");
stop ();
in the plantData.txt file i have the following:

Code:
photonumber=15&plantname=rose
When i run it, it traces photoNumber as 0 no matter what i have for the number. Any ideas what i am doing wrong here?
DruidAnimal is offline   Reply With Quote
Old 04-28-2006, 06:12 PM   #2
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

try it this way
ActionScript Code:
myVars = new LoadVars (); myVars.onLoad = function (success) {     if (success)     {     trace(this.photonumber);     trace(this.plantname);     photo_mc.loadMovie("photo"+this.photonumber+".jpg");    } } myVars.load("plantData.txt");
I think the problem you may be having is that the code is executing before the text file is loaded.
__________________
Color Wars™ | (kul′ər wôrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 04-28-2006, 06:28 PM   #3
DruidAnimal
Registered User
 
Join Date: Aug 2005
Posts: 9
Default

Thanks, that was it, there wasnt enough time for it to load. I loaded the variables in frame 1 and ran the code in frame 3 and it solved it. Thanks a bunch.
DruidAnimal 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
loadVariables problems sunlis ActionScript 2.0 1 02-17-2006 05:29 PM
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
Problems with loadVariables(); jmguitard ActionScript 1.0 (and below) 6 02-16-2002 01:29 AM


All times are GMT. The time now is 07:18 PM.

///
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.