Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


image button link to .swf file in new web page/embed .swf file in XHTML file

Posted on 2006-03-24
Medium Priority
Last Modified: 2013-12-16
I am trying to use an image button in my master page file that links to an XHTML page.  I have only been able to find the method of "embedding" ( <embed> ) which will not work with XHTML.  I have tried to incorporate FlashObject into the .htm page, but no luck.  Below is the portion of the master page with the image button:

<asp:ImageButton ID="imgFeatureTour" runat="server" ImageAlign="Bottom" ImageUrl="~/images/featuretour[1].gif" onclick="MM_openBrWindow('feature_tour.htm','','toolbar=0,location=0,directries=0,status=0,menubar=0,scrollbars=0,resizable=0,width=760,height=400,left=80,top=180')" />

Here is the MM_openBrWindow javascript (as provided to me) which is in the <head> of the .htm file:

<script language="JavaScript" type="text/JavaScript">
function MM_openBrWindow(theURL,winName,features) { //v2.0

Here is the .htm file: (I'm not sure how to implement the javascript of if both should be in the <head>)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>TeleVantage Feature Tour</title>
<script language="JavaScript" type="text/JavaScript">
function MM_openBrWindow(theURL,winName,features) { //v2.0
<script type="text/javascript" src="/javascript/flashobject.js"></script>
        <div id="flashcontent">
                    The feature tour will begin shortly.  
            <script type="text/javascript">
             var fo = new FlashObject("/flash/feature_tour_partner.swf", "feature_tour", "760", "400", "6", "#336699");

When I try to compile the site, I get the following error:

'MM_openBrWindow' is not a member of 'ASP.site_muster'.

I appreciate any help that can be offered.
Question by:vbplayr2000
  • 2
LVL 14

Accepted Solution

existenz2 earned 500 total points
ID: 16282626
You need to place the javascript function on your .aspx page and not on the htm page which you want to open. That should solve your problem.

Author Comment

ID: 16286423
I tried it on the masterpage and it did not work.  Should I just embed the flash in a content page within the masterpage?  The content page then would inherit the java from the master page.  I am still unclear how to accomplish this through .aspx and masterpages.  Is there anyone out there who has accomplished this already????


Author Comment

ID: 16346990
I found a work around and a new tool for VS2005 called FlashControl.  It can be found at: http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=2948&tabindex=2

It allows a developer to drag the FlashControl from the Toolbox onto an .aspx page.  It does function well and is very easy to implement.  However, it still does not handle this specific problem of "embedding" a flash object.  

This tool still uses an <embed> within the XHTML and that still will create a conflict with some browsers.

I researched the Satay method to embed, but that requires the ability to edit the .swf root.  The .swf movie I am manipulating is not my own, so I cannot implement that method (unless someone out there knows something I don't :-)  )

So, my site now does have flash capability on an .aspx content page that inherits my master page (I like this because it keeps the uniform look and lets the user know they are still with my company learning about another company's product).

I am sure that in the near future, a more standard method will be developed.

Thanks for your input.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

578 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