Access <object> from Code Behind (Flash Movie)

B

Brad

I have several movies being presented to the web on a single page and
each one is dependant on a link selected. On the .aspx page I have
the following code for a single movie.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<OBJECT id="fMovie" runat="server"
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,29,0
height=406 width=502 align=middle
classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 VIEWASTEXT>
<PARAM NAME="_cx" VALUE="13282">
<PARAM NAME="_cy" VALUE="10742">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="Videos/movieplayer.swf">
<PARAM NAME="Src" VALUE="Videos/movieplayer.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
</OBJECT>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I would like to be able to access this object from the code behind and
change the Movie and Src tags but I am not sure how to access the
Object tag to do so. Any help is greatly appreciated.

~Brad
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


I would like to be able to access this object from the code behind and
change the Movie and Src tags but I am not sure how to access the
Object tag to do so. Any help is greatly appreciated.

I don't think you can do so, that object runs in the client (the flash
player) so there is no way for it to be visible in the server code.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Brad said:
I have several movies being presented to the web on a single page and
each one is dependant on a link selected. On the .aspx page I have
the following code for a single movie.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<OBJECT id="fMovie" runat="server"
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,29,0
height=406 width=502 align=middle
classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 VIEWASTEXT>
<PARAM NAME="_cx" VALUE="13282">
<PARAM NAME="_cy" VALUE="10742">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="Videos/movieplayer.swf">
<PARAM NAME="Src" VALUE="Videos/movieplayer.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
</OBJECT>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I would like to be able to access this object from the code behind and
change the Movie and Src tags but I am not sure how to access the
Object tag to do so. Any help is greatly appreciated.

~Brad

Then you have to turn those tags into server tags by adding an id and
runat="server". They are not part of the object tag, they are just
inside the object tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top