• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

Link to a flash file in my asp.net page

Hello,

I want to link to a flash file (not a local file, but a remote url), and have it display in my webpage.  Is this possible?  How do I do it?
0
BobBarker_99
Asked:
BobBarker_99
  • 3
  • 2
2 Solutions
 
CyanBlueCommented:
Use SWFObject to embed the SWF file and provide the proper URL to the SWF...  
   http://code.google.com/p/swfobject/

For example...
   swfobject.embedSWF("http://www.domain.com/flash.swf", "test", "400", "300", "10.0.0");

CyanBlue
0
 
BobBarker_99Author Commented:
I added this:
<script type="text/javascript" srcScripts/swfobject.js"></script>
to my masterpage in the head tag

And this:
<script type="text/javascript">
            var so = new SWFObject("images/flash.swf", "banner", "580", "145", "6", "#FFFFFF");so.write("leftContent");so.addParam("WMode", "Transparent")
        </script>

In the "leftContent" div.  

But when I run the page, I get this error:
Microsoft JScript runtime error: 'SWFObject' is undefined

Do you see what I am doing wrong?
0
 
CyanBlueCommented:
The only reason I can think of is when your HTML page is not able to find the swfobject.js file...  That might be abit different if you are using template file in .NET...  Try creating a simple HTML page to test if that works so that you can isolate the issue...

CyanBlue
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
BobBarker_99Author Commented:
I tried that and get the same error.  This is my first time using scripts... is there something basic I may be missing?

0
 
CyanBlueCommented:
Can you post the HTML code you were using???

CyanBlue
0
 
robastaCommented:
1. You need to add the SWFObject.js file (download it here: http://swfobject.googlecode.com/files/swfobject_2_2.zip) [>>>>you can also reference it from google, without downloading it<<<<<<]

2.Extract the file: "swfobject.js" to your "Scripts" directory

3. In the head of the master page : <script type="text/javascript" src="Scripts/swfobject.js"></script> [>>>Typo in the code you posted it read: "srcScripts/swfobject..."]

4.In the body:

<div id="leftContent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
            var so = new SWFObject("images/flash.swf", "banner", "580", "145", "6", "#FFFFFF");
            so.write("leftContent");
            so.addParam("WMode", "Transparent");
</script>


Good tutorial here for more options: http://blog.deconcept.com/swfobject/
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now