Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Load Variables/Targetting Movies
From: Jason Nugent
Date: Mon, 22 Jan 2001 15:14:57 -0000


Greetings, folks,

I've been fiddling with a bit of Action Script for a project I'm working on
and I was wondering if anyone could shed some light on why this bit of code
isn't working. Essentially, the script iterates over a small list and makes
a call to a servlet that queries a database and prints out a urlencoded
string containing the values of variables each instance of a particular
movie should have. I'm then trying to use a small FS command call to see
if it's getting set (it's not).

Here's the code. It's in a frame action.

for (var i = 1 ; i <= no_of_calls ; i ++)
{
fscommand ("checkCode", "test"); // this one works fine.
var name = "movie" + i;
duplicateMovieClip (_root.defaultMovieClip, name, i);
loadVariables
("http://register.thestompinggrounds.com/screensaver/get_info.php",
eval("_Level" + i + "/" + name), "GET");
fscommand ("showMessage", eval("_Level" + i + "/" + name + ":title"));
}

Essentially, I'm a bit unclear on the reference to the loadVariables call
for whatever "name" is supposed to be. I assumed my duplicateMovieClip
function call duplicates a movie called defaultMovieClip in _root, which is
fine, calls it movie1, movie2, etc, and stores it in an increasingly higher
level (1, 2, 3,....). However, in the loadVariables call, I am a bit unsure
of the syntax for storing the variables returned by the servlet in the
specific level and movie. If i was 1 and name was "movie1", would that eval
statement properly evaluate to _Level1/movie1? Would the fscommand on the
next line properly evaluate to _Level1/movie1:title? title is the name of
one of the variables being sent back from the servlet.

The final fscommand call should just print out the value of the title
variable stored in the movie clip, since that is the name of one of the
variables returned by the servlet. It gets called, but the value of the
variable passed into it is empty (not even "undefined").

I've got about a decade of programming experience in a whole pile of
languages and would be very appreciative of anyone who could either point me
to a better reference than the docs that ship with flash 5. I've had a look
at the flashbible and that was pretty helpful, but it doesn't quite cover
what I'm looking for, I think.

Anyway, thanks in advance. Much appreciated.

Jason




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]