limecity Posted June 1, 2007 Share Posted June 1, 2007 my question is about flash object code and php. how do i embed a php varible into a flash <object> coding? this is my varible : <{$photo.imgsrc_photo}> this is the flash object code : <param name="FlashVars" value="id=undefinedsrc= < == http://imageURL.jpg == > width=600height=600" > Quote Link to comment https://forums.phpfreaks.com/topic/53813-php-variable-in-flash-object/ Share on other sites More sharing options...
bagpiperdude90 Posted June 1, 2007 Share Posted June 1, 2007 This is (part of) the code that needs to go in your HTML or PHP page. I've only included the first part of the embed tag; I assume you know everything else: <EMBED src="[flashmovie].swf" FlashVars="myFlashVar=<?php echo(urlencode($myPHPVar));?>&myFlashVar2=<?php echo(urlencode($myPHPVar2));?>" Hopefully that should work! Make sure you add a dynamic text area in flash, and the variable name should match the flash variable (i.e. "myFlashVar" or "myFlashVar2". Quote Link to comment https://forums.phpfreaks.com/topic/53813-php-variable-in-flash-object/#findComment-266026 Share on other sites More sharing options...
limecity Posted June 1, 2007 Author Share Posted June 1, 2007 thanks for the quick reply. this is what I did earlier <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="600" width="500" > <param name="movie" value="http://www.britepic.com/britepic.swf"> <param name="FlashVars" value="id=305546src= {$photo.imgsrc_photo} width=500height=600" > <param name="allowscriptaccess" value="always"> <param name="wmode" value="transparent"> <embed src="http://www.britepic.com/britepic.swf" flashvars=";id=305546src= {$photo.imgsrc_photo} width=500height=600" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" height="500" width="600"> </embed></object> I was trying to embed the bridepic ad code into my existing cms gallery which the template shows this <a href="<{$photo.ahref_photo}>" target="_blank" onClick="window.open('<{$photo.ahref_photo}>','','width=<{$photo.window_x}>,height=<{$photo.window_y}>');return(false);"> <img src="<{$photo.imgsrc_photo}>" border="0" align="center" vspace="3" hspace="7" alt="<{$photo.title}>" title="<{$photo.title}>" <{$photo.width_height}> /></a> do i replace the urlencode with my site's url? Quote Link to comment https://forums.phpfreaks.com/topic/53813-php-variable-in-flash-object/#findComment-266042 Share on other sites More sharing options...
limecity Posted June 1, 2007 Author Share Posted June 1, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/53813-php-variable-in-flash-object/#findComment-266160 Share on other sites More sharing options...
bagpiperdude90 Posted June 1, 2007 Share Posted June 1, 2007 I *think* this should work.... just replace from <embed> to </embed> in your code with this: <embed src="http://www.britepic.com/britepic.swf" FlashVars="id=305546&src=<?php echo(urlencode($photo.imgsrc_photo));?>&width=500&height=600"allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" height="500" width="600"> </embed> You will have 4 flash vars: id (which is set to 305546 in here) src (which is the php variable) width (which is set to 500) height (which is set to 600) From what I could tell, you wanted all those variables, right? If you don't want any, just move them after the Flashvars="[content]" block. The example below doesn't have the height and width variables... they are listed as separate embed parameters (although, you already had those listed as the very last parameters, so they now are conflicting). <embed src="http://www.britepic.com/britepic.swf" FlashVars="id=305546&src=<?php echo(urlencode($photo.imgsrc_photo));?>" width="500" height="600" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" height="500" width="600"> </embed> Quote Link to comment https://forums.phpfreaks.com/topic/53813-php-variable-in-flash-object/#findComment-266264 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.