Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-25-2005, 05:33 AM   #1
lrempel
Registered User
 
Join Date: Jan 2005
Posts: 6
Default Problems loading PHP file into Flash

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.
lrempel is offline   Reply With Quote
Old 01-25-2005, 11:11 AM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

You get the else block executed because if condition is never met...
You said... if (success), right??? You did not define where that 'success' is...
You will need to define it here...
ActionScript Code:
main_lv.onLoad = function([b]success[/b]){
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.