I’m trying to call a jQuery function from my flash file, when clicking on a button.
I’ve tryed to search around stackoverflow and google with similar problems however i cannot resolve this.
FYI, i tested this both locally and online with no results.
Actionscript 3.0 call:
import flash.external.ExternalInterface;
open_mc.buttonMode = true;
open_mc.useHandCursor = true;
open_mc.addEventListener(MouseEvent.CLICK, ClickFunc);
function ClickFunc(evt:MouseEvent):void
{
ExternalInterface.call("openContainer", "open_god_dammit");
}
jQuery:
$(document).ready(function() {
$("#eas_sidekick_container").hide();
$("#eas_sidekick_container").css('width', '0px');
function openContainer(open_god_dammit)
{
$("#eas_sidekick_container").show();
$("#eas_sidekick_container").animate({
width: '850px'
});
$('html, body').animate({
scrollLeft: '850'
});
}
});
Your openContainer function should be outside the inner jQuery function: