Tech Journal
Latest Entries
- iPad is more than just an e-Reader
- My Favorite New Things From 2009
- After Effects Bezier Motion Paths - Toggle Hold Keyframe
Tech and Design
- My Favorite New Things From 2009
- Five Things I’ve learned About Freelancing
- Interesting Data Visualization
- Hydrogen Car Design to be Released “Open Source”
- Chicago Design Archive
- Keynote ‘09 - “View Package Contents”
iPhone
- iPad is more than just an e-Reader
- iPhone App Showcases Hi-Def Holographic Recordings
- iPhone as Digital Swiss Army Knife
Web
- Skipping the Multi-entry Page in ExpressionEngine
- Opera Unite
- Assigning movie clips levels in Actionscript 3.0
- Opening Shadowbox windows from a link in Flash
- Passing FLV file paths to an AS 3.0 SWF with SWFobject
Motion
Opening Shadowbox windows from a link in Flash
March 09, 2009
A while back I was presented with the task of opening a link to an image from a flash banner within Shadowbox. For this you’ll need to have Shadowbox installed according to the instructions on the Shadowbox site. The basic concept is that you’ll need to pass some information from the flash file to the Shadowbox scripts to tell it how big the pop-up window should be, the content URL, and what type of content will be displayed. The site I was working on must be accessible to wide range of browsers, so I published the flash banner for flash 7 using Actionscript 2.0.
To make the banner active, I overlayed a transparent movie clip over the entire banner area. The movie clip serves as the active “hot” area to make whole banner clickable.
The Actionscript
on(release) {
getURL("javascript:Shadowbox.open({title:'title',type:'img',
width:'sbox_width',height:'sbox_height',content:'sbox_contentURL'});");
;}
I put the button code directly on the transparent movie clip, but if you want to keep all your code in an actions frame, you could name your button movie clip something like “button_mc”, and assign the action to the movie clip instance in your Actionscript layer. In my case, it made more sense and was faster to just use it as button code. Conceptual example;
button_mc.onRelease.getURL...etc, etc
And that’s pretty much it. It worked great for me. I hope this at least points you in the right direction.

Leave a Comment