Current location: Hot Scripts Forums » Programming Languages » PHP » PHP & FlashVars


PHP & FlashVars

Reply
  #1 (permalink)  
Old 08-22-05, 05:12 PM
robtour robtour is offline
New Member
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
PHP & FlashVars

Hi,

I couldn't find anything about this via search, so I hope this isn't redundant. What I'd like to do is set a FlashVars embed and object value via a PHP variable that's set further up the page. So if I set a PHP variable as, say,

$nav_section='section1';

How do I get this inserted in the FlashVars below? That part is outside the <?php section, so it doesn't seem to know how to read that php variable in.

I've tried it like this:

<param name=FlashVars VALUE="$nav_section">

But it doesn't work. Any ideas? Thanks in advance!

Rob
Reply With Quote
  #2 (permalink)  
Old 08-22-05, 06:08 PM
DetroitGuy DetroitGuy is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

<?php

print "<param name=FlashVars VALUE=\"$nav_section\">";
?>
Reply With Quote
  #3 (permalink)  
Old 08-22-05, 06:12 PM
robtour robtour is offline
New Member
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks, I'll try that. Does that work for embed and object tags? It seems like it would work for the object tags, as each parameter gets its own tags. But I can't put that script in the middle of the embed tag, can I?

Thanks!
Reply With Quote
  #4 (permalink)  
Old 08-22-05, 07:11 PM
DetroitGuy DetroitGuy is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Yep. You can place it anywhere in a page. PHP is pre-processing the page and then, in this case, writing the output to an HTML document. For instance:

PHP Code:

<?php

$classid 
"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
$codebase "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0";
$height "320";
$width "240";
$id "MyMovie";
$align "middle";

print 
"
<object classid=\"
$classid\" codebase=\"$codebase\" width=\"$width\" height=\"$height\" id=\"$id\" align=\"$align\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"movie\" value=\"
$id.swf\" />
<param name=\"quality\" value=\"high\" />
<param name=\"bgcolor\" value=\"#ffffff\" />
<embed src=\"
$id.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"$width\" height=\"$height\" name=\"$id\" align=\"$align\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
</object>"
;
?>
This becomes much more efficient when you include a database of files and pull the data to display the movie.
Reply With Quote
  #5 (permalink)  
Old 08-22-05, 07:18 PM
robtour robtour is offline
New Member
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Wow, thanks so much for such a great, detailed response. I'll give it a try.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
PHP Downside--Solutions? Amulet PHP 10 07-15-05 08:26 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM
PHP / Graphic Developers someotherguy582 Job Offers & Assistance 1 06-05-05 07:40 PM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 12:31 AM


All times are GMT -5. The time now is 07:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.