I am trying to load a PHP file into Flash using loadVars() and it doesn't work, no matter what I try. I've looked at several examples and followed their steps, but I just can't load the file.
Link to my PHP file:
www.kameleoncreative.com/test/newMain.php.
Actionscript code:
Code:
this.stop();
main_lv = new LoadVars();
main_lv.load("http://www.kameleoncreative.com/test/newMain.php");
getURL("newMain.php", "_new"); //loading php file into new page for debug only
debug.text = "created loadVars"; //textbox display for debug only
main_lv.onLoad = function(){
if(success){
debug.text = "showElementsFunction";
featurepicture.loadMovie("images/" + main_lv.featurephoto);
thumb1.loadMovie("images/" + main_lv.subphoto1);
thumb2.loadMovie("images/" + main_lv.subphoto2);
thumb3.loadMovie("images/" + main_lv.subphoto3);
thumb4.loadMovie("images/" + main_lv.subphoto4);
featuretitle.text = main_lv.featuretitle;
featurebody.text = main_lv.featuretext;
subtexttitle1.text = main_lv.subtitle1;
subtextbody1.text = main_lv.subtext1;
subtexttitle2.text = main_lv.subtitle2;
subtextbody2.text = main_lv.subtext2;
subtexttitle3.text = main_lv.subtitle3;
subtextbody3.text = main_lv.subtext3;
subtexttitle4.text = main_lv.subtitle4;
subtextbody4.text = main_lv.subtext4;
} else{
debug.text = "php not loaded"; //textbox display for debug only
trace("PHP not loaded");
}
}
I have saved my .swf file and .php file in the same directory. I am testing via my hosting environment because I don't have php installed on my development computer. The php page loads fine in a new window, outputting the string of variables the way I want, but I always get the "else" condition of my onLoad function - "php not loaded".
What have I done wrong? What can I try to do differently? (I have tried both relative and absolute pathing for loading the php file - and neither work). Please help, I only have a few days to get this figured out.
Thanks.