BillyBoB Posted December 10, 2007 Share Posted December 10, 2007 I'm working on my site http://dreamshowstudios.net and I am trying to make a recent projects flash to display the recent projects with a thumbnail. I have the flash worked out everything is ready I just need a little advice or a pointer of what I'm doing wrong. Here is what I have now: PHP: <?php require_once("config.php"); if($_GET['num']) { $i = 0; $query = mysql_query("SELECT * FROM portfolio ORDER BY id DESC LIMIT '$_GET[num]',5"); while($result = mysql_fetch_array($query)) { $i++; $string .= "pic" . $i . "=" . $result['image']; if($i>0 or $i<5) { $string .= "&"; } } print $string; }else{ $i = 0; $query = mysql_query("SELECT * FROM portfolio ORDER BY id DESC LIMIT 5") or die(mysql_error()); while($result = mysql_fetch_array($query)) { $i++; $string .= "pic" . $i . "=" . $result['image']; if($i>0 or $i<5) { $string .= "&"; } } print $string; } ?> Flash: The flash can be seen at my development folder not at the main site. http://dreamshowstudios.net/development/DSS ActionScript: loadVariables("slider.php", ""); _root.text1.text = pic1; if (pic1 ne undefined) { Pic1.contentPath = "portfolio/" & pic1; } The _root.text1.text = pic1 is for debugging. Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 What is the problem? Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 The problem is that i cant retrieve the varible named pic1 from my php and use it to set a contentloader in flash. Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted December 10, 2007 Share Posted December 10, 2007 To pass variable from php to flash you should do like this <?php // in Flash if you have kept dynamic text box, set Var as myVar print "&myVar=$string"; ?> this is actionscript for that dynamic text box onClipEvent (load) { loadVariables("nameofthefile.php", this, "GET"); } Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Ok I'm making some progress. I have pic1 coming in and going into the box under ContentLoader1. Im trying to get that text to be the contentpath in the ContentLoader. _root.Pic1.contentPath = _root.pic1.text; But its not working. The php file is at http://dreamshowstudios.net/development/DSS/slider.php Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted December 10, 2007 Share Posted December 10, 2007 I didn't understand you, and where is the Flash file in the link you gave. ??? CONFUSED Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Sorry bout the mix-up. The flash is on my mainpage http://dreamshowstudios.net/development/DSS/ the link i gave you was just to the php file. i have all the textboxes set to the varible i want to come up. how do i set the contentpath to the text in the textboxes. Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Here is my update. Same URLS as above. I have the textboxes filling but when i set the contentpaths equal to the pic1.text it comes up with this error Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic5' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic4' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic3' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic2' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic1' which means it is really not finding the string that lies within it is just taking the actually text in the code and using it. Code: loadVariables("http://dreamshowstudios.net/development/DSS/slider.php", this, "GET"); if(_root.pic1.text ne "") { _root.Ctrls.Pic1.contentPath = _root.pic1.text; _root.Ctrls.Pic2.contentPath = _root.pic2.text; _root.Ctrls.Pic3.contentPath = _root.pic3.text; _root.Ctrls.Pic4.contentPath = _root.pic4.text; _root.Ctrls.Pic5.contentPath = _root.pic5.text; } Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Any ideas out there? Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Any ideas out there? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.