FlashVar function how to insert variables

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
crison22
Forum Newbie
Posts: 1
Joined: Sat Oct 17, 2009 7:24 pm

FlashVar function how to insert variables

Post by crison22 »

<embed
src='player-viral.swf'
width='263'
height='220'
bgcolor='undefined'
allowscriptaccess='always'
allowfullscreen='true'
flashvars='file=dsc.flv'
/>

Guys this is the code. I want to have a variable inside the flashvar. the dsc.flv is a fix video. i want to loop video so i want a variable inside it. sorry for my grammar. thanks
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: FlashVar function how to insert variables

Post by Eric! »

I assume you know php, so just make this php echo

Code: Select all

echo "<embed src='player-viral.swf' width='263' height='220' bgcolor='undefined' allowscriptaccess='always' allowfullscreen='true' flashvars='file=".$your_variable."'/>";
or do it in-line

Code: Select all

<embed
src='player-viral.swf'
width='263'
height='220'
bgcolor='undefined'
allowscriptaccess='always'
allowfullscreen='true'
flashvars='file=<?php echo $your_variable ?>'
/>
Post Reply