Solved

Wrap swfobject in a Link for Popup Window.

Posted on 2009-05-07
3
1,002 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
This article discusses how to create an extensible mechanism for linked drop downs.
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 select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

785 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