?
Solved

set flash movie embed object  path from javascript var.

Posted on 2013-01-23
2
Medium Priority
?
447 Views
Last Modified: 2013-01-23
In Html page I have javascript variable named as "gameFile" that contain swf path.
How can I set the following embed flash movie code to this javascript Var?
I need to replace the "test.swf" with  "gameFile" var..
I do not have ID for  "gameFile".

<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="640" height="480">
					<param name="movie" value="test.swf">
					<param name="quality" value="High">
					<embed src="test.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="640" height="480"></object>

Open in new window

0
Comment
Question by:yaron89
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
Kim Walker earned 2000 total points
ID: 38809571
If I understand your question, you have the statement
var gameFile = "<swf path>";

Open in new window

somewhere in your javascript code (where <swf path> is the actual path). Correct?

Is there only one embed tag in your html page?

If the answers to both questions above are "yes," the following javascript code should accomplish your task.
document.getElementsByTagName("embed")[0].src = gameFile;

Open in new window

0
 

Author Closing Comment

by:yaron89
ID: 38809633
Thank you !
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses

765 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