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. Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/ Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 What is the problem? Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410734 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. Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410736 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"); } Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410743 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 Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410758 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 Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410760 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. Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410763 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; } Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410784 Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Any ideas out there? Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-410951 Share on other sites More sharing options...
BillyBoB Posted December 10, 2007 Author Share Posted December 10, 2007 Any ideas out there? Link to comment https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/#findComment-411360 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.