Working by itself but not in an MC

I have an SWF (a guestbook) that calls on PHP and works great when you open the swf by itself.

i tried to have the SAME thing dynamically loaded into another mc and it doesnt work.
The clip shows up but it looks as though the PHP isn’t getting called correctly.

Any thoughts, or if anyones got a good guestbook tut laying around it would be much appreciated

Happy Holidays!:goatee:

can you post some code? How are you loading the mc? How are you loading the PHP?

the MC is 3 deep heres the heirarchy (spell that?)
HTMLPAGE->MAIN.swf->loads->guestbook.swf->loads-> PROBLEMFILE.swf
on the guestbook clip,
gb.loadMovie(URL); in an action frame (bg being the instance name of the lcip areea that the file is being loaded into)

The actual guesbook clip has the following in it:
NumLow = 0;
NumHigh = 10;
loadVariablesNum (“GuestBook.php?NumLow=”+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);

any other info needed, please lemme know
you can see it in action if you’d like
goto (URL)
click on guests (thisis what doesnt work)
goto (URL)
this is the exact clip that is being loaded into the MC on the other page, but when loaded by itself it works…

loadVariablesNum ("GuestBook.php?NumLow="+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);

that is the problem, When specifiying 0 as the depth, you are telling Flash to load the vars into the root, instead of guestbook.

sendVars = new LoadVars();
getVars = new LoadVars();
sendVars.NumLow = NumLow;
sendVars.NumHigh = NumHigh;
sendVars.R = Math.random() * 9999;
sendVars.sendAndLoad("GuestBook.php", getVars, "GET");
getVars.onLoad = function(){
//put all your recieving actions in here.

all of the vars you are recieving will placed in the object getVars
and are recieveable via: getVars.yourVarName or if you are referencing them from the getVars.onLoad you can use this.yourVarName.

pardon my ignorance, but im not sure i follow.

Are you saying to ditch what i have as code and use what you posted, or is that in addition to what i have?

Sorry, im a newb.

i have 2 buttons that load the next and previous 10 entries.
code being:
on (release) {
NumLow = Number(NumLow)+Number(10);
NumHigh = Number(NumHigh)+Number(10);
GuestBook = “Loading Comments Numbered “+NumLow+” to “+NumHigh+” Please Hold”;
loadVariablesNum (“GuestBook.php?NumLow=”+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);
would that then need to change as well? (i would think any code that called on that php would need to be changed?)
Thanks, this may be going somewhere, (i dunno where) but hopefully to my resolution

i meant in replacement of your code. How are you loading the data into the text fields? Can you post your fla(s)?

I’d love to post it… but…
I feel so dumb… how do you attach a file on the forum?

you can grab it at

umm it’s empty

please retry the file…
i forgot to upload the fla file… i only uploaded the swf

sorry bout that :slight_smile:

Would anyone be able to explain the code above… I still cannot get this to work when loaded into a movie clip… And where
getVars.onLoad = function(){
//put all your recieving actions in here.
Im not too sure as to what should really go there.

I put this.variablenamebelow that but nothing worked in or out of a movie clip.
Thanks a ton, happy holidays!!

*Originally posted by sr1200 *
**getVars.onLoad = function(){
//put all your recieving actions in here.
Im not too sure as to what should really go there.

This is where you would tell the fla what to do with the variables that were returned. If you go here:
You can see the little example that I made. It uses the code that norie suggested.

You type something into the first input box and then hit the red button. The php file then checks to see if you typed anything in or if you left it blank. If you did type something in then it sends that information back to the fla and it is then displayed in the second box.

Lemme know if that helps. I was having the exact same problem you were having and this is the solution that worked for me.

also dude, you misspelled vocals on your vocals page, just FYI.

Thanks, fixed the spelling error.

What i still dont understand is: I dunno what to do with the variables that i get back!:frowning:
Usually when i get a variable, i put the variable name into the variable field in the properties of the dynamic text box… However here it looks as though i need to tell the variables to go there. I’m about 4 seconds from offering a fist full of money to someone to finish up this pain in the butt!!! :slight_smile:

perhaps you could put the fla file up for me to have a gander at. Thanks

what fla? i could let you see the fla for my gbook, but it’s not the prettiest thing in the world.

I actually like what youve got going a lot better than what i have…
I would LOVE to see and with your permission use some of that code. as long as that will work when loaded into another clip then I’d be set!
Thank you! :slight_smile:

check your pm’s

My bad, I had meant to include the fla in that link.

Alright if you go there now you can grab the fla.