/    Sign up×
Community /Pin to ProfileBookmark

get url and flashvars

I have a flash document set up so that when i embed it i can load a small string(videoname)to tell it what video to load. i want to be able to have it choose depending on the url. so “mysite.com?video1” will let me use the string “video1” while embedding my flash document. heres what im using:

[CODE]

<?$vid = $_GET[0];?>
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″
codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0″ width=”320″
height=”277″>
<param name=”movie” value=”http://nineclicks.com/flash/miniplayer.swf”>
<param name=”quality” value=”high”>
<embed src=”http://nineclicks.com/flash/miniplayer.swf” quality=”high”
pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” width=”320″
height=”277″ FlashVars=”videoname=<? echo $vid; ?>”></embed>
</object>

<?}?>

[/CODE]

i dont know php too well, and i got this off of yahoo answers. but when i replace “<? echo $vid; ?>” with an actual videoname, it works fine. so i know thats not the problem. its just the actual php code that im trying to use.

when i have that “<?}?>” at the end, the page is blank, and without it, its as if none of those”<? ?>” bits were there.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@dzysyakJul 14.2007 — For mysite.com?video=filename.flv

[code=html]
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="320"
height="277">
<param name="movie" value="http://nineclicks.com/flash/miniplayer.swf">
<param name="quality" value="high">
<param name="FlashVars" value="videoname=<?=$_GET['video'];?>">
<embed src="http://nineclicks.com/flash/miniplayer.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320"
height="277" FlashVars="videoname=<?=$_GET['video'];?>"></embed>
</object>
[/code]
×

Success!

Help @nineclicks_com spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...