It is currently Sun Oct 26, 2014 8:57 am Advanced search

Can I open Highslide from within a Flash movie?

Frequently asked questions.

Can I open Highslide from within a Flash movie?

Postby torstein.honsi » Fri Oct 03, 2008 9:15 am

This is a quick and easy way to call hs from within flash using externalInterface (actionscript 2).

FLASH:
Create a movieclip on your stage and give it an instance name, in this case it's 'btn_details'

In your ActionScript (version 2) layer add:
Code: Select all
import flash.external.ExternalInterface;
btn_details.onRelease = function () {
   ExternalInterface.call("firehs");
};

When you publish, publish to "Flash Player version 8".

In ActionScript version 3 this is done a little differently:
Code: Select all
import flash.external.ExternalInterface;
btn_details.addEventListener(MouseEvent.CLICK, launchhighslide);
function launchhighslide(event: MouseEvent) {
    ExternalInterface.call("firehs");
}



HTML/JAVASCRIPT:
In the head section of your page add:

Code: Select all
<script type="text/javascript">
function firehs() {
   hs.expand (null, { src: 'image.jpg' } );
}
</script>


That's all, clicking on your flash button will now open highslide. An example can be seen here http://www.mx3design.co.uk/predesign.php (click on the 'VIEW DETAILS' button within the movie at top of page).

Thanks to m3xdesign for the tutorial.
User avatar
torstein.honsi
Site Admin
 
Posts: 9200
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Return to Highslide FAQ

Who is online

Users browsing this forum: No registered users and 1 guest