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
Solved

set flash movie embed object  path from javascript var.

Posted on 2013-01-23
2
443 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
2 Comments
 
LVL 22

Accepted Solution

by:
Kim Walker earned 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

792 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