Solved

Wrap swfobject in a Link for Popup Window.

Posted on 2009-05-07
3
999 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now