Groups | Blog | Home
all groups > flash data integration > august 2007 >

flash data integration : Trying to load vars into a text area & loader


dm34175
8/23/2007 4:30:50 PM
So I am trying to load variables from a .php file into a movie clip and then
plug in those variables to various fields and for some reason its not
working...so heres whats going on...(this is for the staff page for my church)
(and yes I have read the tutorials :P )

In the primary timeline we have this line...

loadVariables("./middleware/staff.php?id=" + staffID, staff_panel, "GET");

We are loading the variables into the movie clip which contains our various
fields...the value for staffID is created in the previous frame when the user
click on that person's icon, we know for sure that this is being passed
correctly to this frame, because I have a text box in the main timeline which
displays the number.

The resulting string from the .php file looks like this...


staffNameE=Jason+Webb&staffTitleE=Lead+Pastor&staffDescE=Jason's+bio+goes+here..
..&picLoader=./images/staff_pics/jwebb.jpg&staffEmail=webmaster@brooklife.org

Within the movie clip that the variables are being loaded into we have
this....it loops till the var load is done and then writes the information to
the fields...

while (L ne "stop"){
if (staffNameE ne ""){
staffName = staffNameE;
staffTitle = staffTitleE;
staffDesc.text = staffDescE;
staffPhoto.load(picLoader);
L = "stop";
}
}

So lol what am I doing wrong, it all seems right to me but I am kind of new at
the flash thing...thanks for the help. :)
Gorka Ludlow
8/24/2007 2:21:37 PM
Try using the LoadVars object and google for a tutorial on it.

Cheers,
Gorka
http://www.AquiGorka.com/blog
dm34175
8/24/2007 3:25:17 PM
Gorka Ludlow
8/27/2007 2:01:38 PM
The LoadVars object works like this:

You load data into the instance name created. Once the data is loaded you can
call the data inside the LoadVars instance: LV_instance.Var. So what you should
do is read a text file, then when the onLoad event is trigerred asign the
variables inside the LoadVars instance to their respective holders (loader,
text area or text boxes): Text_Area_Instance_Name.text =
Load_Vars_Instance.Variable;

Cheers,
Gorka
http://www.AquiGorka.com/blog
AddThis Social Bookmark Button