Jump to content

variable within a flash object echo string


alpharay

Recommended Posts

Could someone help me crack this issue.

 

I am trying to insert a variable into an flash object echo string's src. I've try many variations but can't figure it out. Below is the code.

 

cheers

 

ray

 

<?php

$var = 'map.swf';

 

echo ' <OBJECT ID="map" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

CODEBASE="http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,0"

WIDTH="50%" HEIGHT="50%">

<PARAM NAME="Movie" VALUE="map.swf">

<PARAM NAME="Play" VALUE="false">

<PARAM NAME="Quality" VALUE="best">

<PARAM NAME="swLiveConnect" VALUE="true">

<PARAM NAME="loop" VALUE="false">

<EMBED NAME="slav" SRC=" map.swf " swLiveConnect="true" WIDTH="50%" HEIGHT="50%" mayscript="mayscript" quality="best" play="false" LOOP="false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash2">

</EMBED>

</OBJECT>';

 

echo "<br/>";

echo $var;

echo "<br/>";

 

?>

 

Goal

 

<?php

$var = 'map.swf';

 

echo ' <OBJECT ID="map" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

CODEBASE="http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,0"

WIDTH="50%" HEIGHT="50%">

<PARAM NAME="Movie" VALUE=" $var ">

<PARAM NAME="Play" VALUE="false">

<PARAM NAME="Quality" VALUE="best">

<PARAM NAME="swLiveConnect" VALUE="true">

<PARAM NAME="loop" VALUE="false">

<EMBED NAME="slav" SRC=" $var " swLiveConnect="true" WIDTH="50%" HEIGHT="50%" mayscript="mayscript" quality="best" play="false" LOOP="false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash2">

</EMBED>

</OBJECT>';

?>

Link to comment
Share on other sites

Variables are not interpolated in single quoted strings.

 

<?php
$var = 'map.swf';

echo ' <OBJECT ID="map" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
CODEBASE="http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,0" 
WIDTH="50%" HEIGHT="50%">
<PARAM NAME="Movie" VALUE=" $var ">
<PARAM NAME="Play" VALUE="false">
<PARAM NAME="Quality" VALUE="best">
<PARAM NAME="swLiveConnect" VALUE="true">
<PARAM NAME="loop" VALUE="false">
<EMBED NAME="slav" SRC="' . $var . '" swLiveConnect="true" WIDTH="50%" HEIGHT="50%" mayscript="mayscript" quality="best" play="false" LOOP="false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash2">
</EMBED>
</OBJECT>';
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.