php & flash

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cspster
Forum Newbie
Posts: 6
Joined: Sat Feb 20, 2010 7:26 pm

php & flash

Post 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
cspster
Forum Newbie
Posts: 6
Joined: Sat Feb 20, 2010 7:26 pm

Re: php & flash

Post by cspster »

I forgot to mention I'm using actionscript 3
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: php & flash

Post 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?
cspster
Forum Newbie
Posts: 6
Joined: Sat Feb 20, 2010 7:26 pm

Re: php & flash

Post 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?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: php & flash

Post 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
cspster
Forum Newbie
Posts: 6
Joined: Sat Feb 20, 2010 7:26 pm

Re: php & flash

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: php & flash

Post 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?
cspster
Forum Newbie
Posts: 6
Joined: Sat Feb 20, 2010 7:26 pm

Re: php & flash

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: php & flash

Post 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
cspster
Forum Newbie
Posts: 6
Joined: Sat Feb 20, 2010 7:26 pm

Re: php & flash

Post by cspster »

I will give that a try. Thanks for the help.
Post Reply