Page 1 of 1
php & flash
Posted: Sat Feb 20, 2010 7:30 pm
by cspster
I'm very new to php and my question is:
Can I load an flv into a swf using php & mysql.
I want to pull the flv from a database and load it into a swf & I can't figure it out or find any info online.
Thanks
Re: php & flash
Posted: Sat Feb 20, 2010 7:38 pm
by cspster
I forgot to mention I'm using actionscript 3
Re: php & flash
Posted: Sat Feb 20, 2010 7:48 pm
by Eran
It's technically possible, but it's a roundabout way to go about it. Why not serve the FLV from a regular file?
Re: php & flash
Posted: Sat Feb 20, 2010 7:56 pm
by cspster
I need to create a cooking site. each page would be a different chef with two videos, two recipe pdf and other misc content. I want to load everything using php and mysql. My first thought was to create .swf for every chef allowing them to pick between the two videos. But I thought that would be a pain if there were hundreds of chefs.
So I want to make a swf that lives on every page that I can load the two video into. Is your suggestion to cut out the swf and just load the flv?
if so how would I do that? display the flv?
Re: php & flash
Posted: Sat Feb 20, 2010 8:04 pm
by Eran
Create one SWF that loads FLVs dynamically depending on parameters you pass to it (such as fillename and path). Allow users to upload movies and save them as FLVs on the server - store only the filename in the database. You have the nice FLVPlayback component just for that purpose -
http://livedocs.adobe.com/flash/9.0/Act ... yback.html
Re: php & flash
Posted: Sat Feb 20, 2010 8:21 pm
by cspster
That exactly what I've tried to do but I don't know enough to pull the filename from the database and load it into the swf and I can't find anything online that helps.
It amazes me that I can't find a tutorial on the subject.
Re: php & flash
Posted: Sat Feb 20, 2010 8:27 pm
by Eran
I wouldn't think you will find a tutorial that targets FLVs specifically, but uploading files with PHP is quite common so I'm sure there are plenty of resources. What have you tried so far?
Re: php & flash
Posted: Sat Feb 20, 2010 8:35 pm
by cspster
I'm able to pull the file path from the database and echo it back. But I have no idea where to begin in flash to load it. I assumed if I could create a variable with the file path I could load that into flash. but I can't.
I'm using mysql_fetch_row to pull the file path from my database.
Re: php & flash
Posted: Sat Feb 20, 2010 8:44 pm
by Eran
You can use flashvars to pass the value of the FLV into the flash embed -
http://www.adobe.com/livedocs/flash/9.0 ... 00668.html
Re: php & flash
Posted: Sat Feb 20, 2010 9:44 pm
by cspster
I will give that a try. Thanks for the help.