corillo181 Posted October 3, 2007 Share Posted October 3, 2007 hey i got a flash player working with php i got a few file mp3.as = the flash coding mp3.swf = the player songs.php = the php xml of songs and a few songs. it works great. my question is how can i use php to pass get values to flash.? if this belongs in another forum don't mind changing it, i only use php so i think all my problem can be solve by it. Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/ Share on other sites More sharing options...
michaellunsford Posted October 3, 2007 Share Posted October 3, 2007 flash accepts variables passed to it in the URL. So, in your flash source parameter, you could just put "mp3.swf?song1=one.mp3&song2=two.mp3" etc. you could also have flash query a URL occasionally to grab a new song. The php output would look much the same as before "song1=one.mp3&song2=two.mp3". the difficult end will be creating a flash actionscript that knows when to call for the next song -- but that's a question for a flash forum. Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-361071 Share on other sites More sharing options...
corillo181 Posted October 3, 2007 Author Share Posted October 3, 2007 thats no problem i already got all that workin, but what i wanted to implement is on using "mp3.swf?song1=one.mp3&song2=two.mp3" the problem with this is that my xml file is located at the mp3.as so if i do add that line how will the .as know when to look only for what ever is in the url and not what i wrote on it the load file is xml.onload("songs.php"); so wouldn't i have to change that to something like xml.onload("songs.php?song1=one"); the problem is how do i get inside a .as file to do that. or is there a better way? by not using .as? Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-361109 Share on other sites More sharing options...
corillo181 Posted October 3, 2007 Author Share Posted October 3, 2007 would FlashVars do the trick? Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-361140 Share on other sites More sharing options...
corillo181 Posted October 4, 2007 Author Share Posted October 4, 2007 any one know how i would read that inside of flash if i use mp3.swf?name=$name Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-361361 Share on other sites More sharing options...
Crew-Portal Posted October 4, 2007 Share Posted October 4, 2007 $name = $_GET['name']; mp3.swf?name=$name Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-361400 Share on other sites More sharing options...
corillo181 Posted October 4, 2007 Author Share Posted October 4, 2007 i know that, but how would i read that name inside the swf file do i just use name in anywhere where i want $name ? Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-361405 Share on other sites More sharing options...
michaellunsford Posted October 5, 2007 Share Posted October 5, 2007 it simply becomes a variable in flash so, mp3.swf?name=songtitle would translate to a variable in flash called "name" that contains the value "songtitle" Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-362519 Share on other sites More sharing options...
emehrkay Posted October 5, 2007 Share Posted October 5, 2007 anything less than AS3 the var should be _root.varname Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-362522 Share on other sites More sharing options...
corillo181 Posted October 9, 2007 Author Share Posted October 9, 2007 thank you guys i try to get this help at a flash board and they made it so complicated. i told them that phpfreaks = great! Quote Link to comment https://forums.phpfreaks.com/topic/71709-solved-flash-player/#findComment-365403 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.