?
Solved

changing source of embedded flash video using javascript

Posted on 2008-10-02
5
Medium Priority
?
2,297 Views
Last Modified: 2012-05-05
Greetings EE Gods.

Using ASP.net, I can employ this line:
<img id="product_fullimage" alt="" runat="server" />

From other images, I can change the source of the img tag on the fly using javscript:
onclick=\"",fullimage,".src='/Content/images/products/", previewimage.fullimage, "';\""

Can I do this with embedded SWF and FLVs?
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="400" HEIGHT="300"
CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
<PARAM NAME="MOVIE" VALUE="sample.swf">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="QUALITY" VALUE="best">
<PARAM NAME="LOOP" VALUE="true">
<EMBED SRC="sample.swf" WIDTH="400" HEIGHT="300" PLAY="true" LOOP="true" QUALITY="best"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>

Thanks.
0
Comment
Question by:Evan Cutler
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 22631418
Hello arcee123,

AFAIK changing Object param attribute dynamically using javascript is not allowed. You have to first delete the object and create a new object with new param

HTH
I
0
 
LVL 22

Accepted Solution

by:
Ivo Stoykov earned 2000 total points
ID: 22631425
Here's a sample


function setFlashSrc(newSrc)
{
      var flash='<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="210" HEIGHT="210">';
      flash+='<PARAM NAME=movie VALUE="'+newSrc+'"><PARAM NAME=quality VALUE=high>';
      flash+='<EMBED SRC="'+newSrc+'" QUALITY=high PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ';
      flash+='TYPE="application/x-shockwave-flash" WIDTH="210" HEIGHT="210">';
      flash+='</EMBED>';
      flash+='</OBJECT>';
      document.getElementById("urgeo").innerHTML=flash;
}

Open in new window

0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 22631671
can I embed that function in the middle of the body?

Thanks
0
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 22631935
where ever you want.
RegisterClientScripBlock will do it or attach to onclik or onload or other suitable event.

HTH

I
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 31502662
Thank you.
I'll get this to work.

Evan
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month16 days, 4 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question