Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-03-2001, 08:56 PM   #1
Registered User
Join Date: Apr 2001
Posts: 1


I'm trying to use variables that have been loaded into a movie using loadVariablesNum to determine where to gotoAndStop. When I load the variables in using the code below, I can see the variables and their values in the variables debug window and I can write them to a text area on the stage, but if I try to use them in any kind of statement, the statement is not executed.

For example:
var lastvisit;
loadVariablesNum ("http://www.zapplets.com/lastvisit.html", 0);
gotoAndStop ("\"" + lastvisit + "\"");

I also tried this, to no avail:
var lastvisit;
loadVariablesNum ("http://www.zapplets.com/lastvisit.html", 0);
if (lastvisit=="3") {
gotoAndStop ("3");


I am loading the following text file:

...and am trying to jump to the frame labeled with the value in the variable lastvisit but the script is not working. Is there something I need to do to the loaded variable (lastvisit) before I can use it in a statement?

Thanks in advance!
Jamie Gehrlich

zapplets is offline   Reply With Quote
Old 04-03-2001, 11:03 PM   #2
Registered User
Join Date: Feb 2001
Location: vancouver
Posts: 2,219


You can't load Variables and utilize them in the same script, you need to use some sort of loop that will check to see if all variables are finished loading before using them...

Best way to do this is to load the varibles into a movie clip, using an onClipEvent(data) handler...this handler will trigger once all data has been received...


deadbeat is offline   Reply With Quote
Old 04-04-2001, 04:03 AM   #3
ActionScript.org Founder
Jesse's Avatar
Join Date: Nov 2000
Location: New York
Posts: 8,736

Or you can use a looping clip which tests if a variable exists:

if (!variableName ) {
// still not loaded
} else {
// loaded



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

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
LoadVariablesNum Question Aquilo1974 ActionScript 2.0 1 09-28-2004 08:56 AM
LoadVariablesNum & GoToAndStop nockles ActionScript 2.0 1 04-14-2004 05:47 AM
External text in external SWF: Loadvars Vs. LoadVariablesNum marclalosh ActionScript 1.0 (and below) 6 02-09-2004 02:14 PM
loadvariables vs loadvariablesnum rflorico Server-Side Scripting 1 09-16-2003 08:05 AM
loadVariablesNum remote? OH GOD SOMEBODY HELP ME!!! BEEJAY ActionScript 1.0 (and below) 1 12-16-2002 01:48 PM

All times are GMT. The time now is 11:45 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.