Solved

Wrap swfobject in a Link for Popup Window.

Posted on 2009-05-07
3
1,007 Views
Last Modified: 2012-05-06
I would like to wrap my flash swfobject so that I can open it with a popup window.   I can't seem to get the flash inside of the link.

I want to wrap the myContent div inside of the link that I have around the text (click here for more images).

Possibly I could change the javascript to allow this?.. maybe in teh swfobject.embedSWF...??

I don't know.. hopefully someone can lead me in the right direction.
<script type="text/javascript">
swfobject.embedSWF("http://www.versatables.com/media/flash/swf/CTL72-DEMO-09.swf", "myContent", "300", "300", "7.0.0", "expressInstall.swf");
</script>
 
 
<div id="myContent">
			<img src="<?=$images_path; ?>/school/aj30-main-new.jpg" border="0" alt="" />
			<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></p>
</div><a href="<?= $root_path; ?>/media/flash/CTL-Series-Product-Gallery-60-72.php" class="popupwindow" 
                rel="height:620,width:715,toolbar:0,scrollbars:0,status:0,resizable:1,center:1,createnew:1"><center><h2>Click Here For More Images</h2></a></center>
                
                </a></div>

Open in new window

0
Comment
Question by:cstormer
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Onthrax earned 500 total points
ID: 24330598
You can't. This is not possible according to w3c specs
http://www.w3.org/TR/html401/struct/objects.html#h-13.5

However, you can do the following:

You can use flashvars. In a nutshell, they become global variables in the flash runtime, so if your flashvar is named "link" your button can call:

somebutton.onRelease = function()
{
    getURL( link );
}

and in the HTML:
<object classid=
      "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=
      "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
      width="100%" height="119" id="ticker">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value="ticker.swf" />
        <param name="quality" value="high" />
        <param name="salign" value="TL" />
        <param name="flashvars" value="manifestFile=film.xml&" />
        <embed src="ticker.swf" quality="high" width="100%" height=
        "119" name="ticker" salign="TL" allowscriptaccess=
        "sameDomain" type="application/x-shockwave-flash"
        pluginspage="http://www.macromedia.com/go/getflashplayer"
        flashvars="manifestFile=film.xml&" />
      </object>


Hope this helps...
0
 

Author Comment

by:cstormer
ID: 24336150
That looks like it will solve the problem.. how does it work with swfobject?
0
 
LVL 13

Expert Comment

by:Onthrax
ID: 24336296
Above example is for a swfobject. Although you will need the original fla to add the onrelease code to it. Once you have done so you can add any url through the flashvars property in the embedded code.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

820 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