Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why isn't this working.. ahhh..

Status
Not open for further replies.

kisell

Technical User
Jan 10, 2004
5
0
0
CA
This is how things are set up in the fla:
Frame 1 has a stop action and i have the checkboxes on the main stage with each having a component name, then i have a button with this actions:
on (release){
formdata= new loadvars( );
formdata.name=name.getvalue( );
formdata.age=age.getvalue( );
formdata.send("1.asp", myVars, "POST");
gotoAndPlay(2);
}

// in the asp i do some computation with the true / false of the checkboxes and a new value of email & name are created.

On frame 2 i have text that says "loading...." and frame 2 has this action:
loadVariablesNum("1.asp", 0);

on frame 3 i have:
if (_root.Counter == 1) {
gotoAndStop(4);
} else {
gotoAndPlay(2);
}

// I have the asp record set incremented by a counter for each returned record

on frame 4 I have on the main stage a movie clip with instance of name and another movie clip with instance of age, each movie clip contain 1 fram of a dynamic text box. Boththe name & age box have a var of 'info'

the actions of frame 4 are as follows:
// depth
depth = -1;
// hide the origional clips
Name._visible = 0;
Age._visible = 0;
// split up the array by looking for the commas
Name_array = output.split(",");
Age_array = eoutput.split(",");
// get the length of the array
Name_length = Name_array.length;
Age_length = Age_array.length;
// set the start y position (x position depends on where you put it on the screen)
yposition = 38;
// looping everything
for (i=0; i<Name_length; i++) {
// Name
duplicateMovieClip(Name, &quot;Name&quot; add i, depth);
setProperty(&quot;Name&quot; add i, _y, yposition);
Name.Name = Name_array[1];
set(&quot;Name&quot; add i add &quot;.info&quot;, Name_array);
depth--;
// Age
duplicateMovieClip(Age, &quot;Age&quot; add i, depth);
setProperty(&quot;Age&quot; add i, _y, yposition);
Age.Age = Age_array[1];
set(&quot;Age&quot; add i add &quot;.info&quot;, Age_array);
depth--;
// Set the y position plus 30
yposition = yposition+30;

stop();
}

So how i planned this to work was the user selects the checkboxes and presses the send button and the movie goes to frame 2 which checks if the data is present and if so displays it. Any thought on this on why it isn't working? what happening is that when i submit the ceckbox data the &quot;loading....&quot; displays only and the internet connect opens as it searches but it never returns/displays any data.
 
ok I changed the button action that send the data to the asp page to this:

formdata = new loadvars();
formdata.onLoad = function() { _root.play(); }
dummy = new loadvars();
formdata.name=name.getvalue( );
formdata.age=age.getvalue( );
formdata.sendAndLoad(&quot;1.asp&quot;, dummy, &quot;POST&quot;);

I figured out that frame 1 sent the data (actually to a new browser window); So I did some more re-reading and I now use sendandload here even I do not expect data back.

But the movie hange on trying to load the asp info starting on frame two. I can post the fla if some MVP is will ing to help
 
Well, you need to print the variable to the browser to send them back to Flash.

Response.Write(&quot;var1=&quot; & var1) & &quot;<br>&quot;
Response.Write(&quot;var2=&quot; & var2) & &quot;<br>&quot;
Response.Write(&quot;var3=&quot; & var3) & &quot;<br>&quot;

Not sure if this is the right syntax, but thats the concept on how to get it. There's a good tutorial on about loadVars and PHP, but it will help you along with figuring out the PHP.

FLASHfreak :)

FLASHfreak :)
- The Flash Experience
 
Thanks Flashfreek i got it working but i'm unhappy with how i envisioned the results to be displayed and how they actually are displayed. Thank you very much I really appreciate your help. i need help with, in the swf i'm displaying the request asp results of ranme & phone in two seperate movies, each containing a dynamic text boxe, so for each in the record set the results look like this:
1stTextBox 2ndTextBox
name1 phone1
name2 phone2
name3 phone3
name4 phone4
name5 phone5

I was wondering how i could change things so that the record set displays like so:
name1
phone1

name2
phone2

name3
phone3

name4
phone4

This is the action scripts for the call an display of the original way. Thanks

Action script:

// depth
depth = -1;
// hide the origional clips
rname._visible = 0;
phone._visible = 0;

// split up the array by looking for the commas
rname_array = output.split(&quot;,&quot;);
address_array = eoutput.split(&quot;,&quot;);

// get the length of the array
rname_length = rname_array.length;
phone_length = phone_array.length;

// set the start y position (x position depends on where you put it on the screen)
yposition = 30;
// looping everything
for (i=0; i<rname_length; i++) {
// Name
duplicateMovieClip(rname, &quot;rname&quot; add i, depth);
setProperty(&quot;rname&quot; add i, _y, yposition);
rname.rname = rname_array[1];
set(&quot;rname&quot; add i add &quot;.info&quot;, rname_array);
depth--;
// Age
duplicateMovieClip(phone, &quot;phone&quot; add i, depth);
setProperty(&quot;phone&quot; add i, _y, yposition);
phone.phone = phone_array[1];
set(&quot;phone&quot; add i add &quot;.info&quot;, phone_array);
depth--;

// Set the y position plus 30
yposition = yposition+30;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top