开发者

Swf in lightbox encounters problem with ExternalInterface when using IE

开发者 https://www.devze.com 2023-02-16 02:16 出处:网络
I am having a problem with Internet Explorer and various lightbox programs (PrettyPhoto, TopUp, and Bumpbox). Essentially开发者_Go百科 I want to make a call using Flash\'s ExternalInterface class from

I am having a problem with Internet Explorer and various lightbox programs (PrettyPhoto, TopUp, and Bumpbox). Essentially开发者_Go百科 I want to make a call using Flash's ExternalInterface class from a swf that has been loaded into a lightbox. It works in firefox but not in IE (8).

Here is my working example using PrettyPhoto and here is my working example using TopUp.

When the exact same swf is embedded in the top of the page the ExternalInterface call works fine (you can click it on that page). But when the swf is opened in the lightbox by clicking the image it will not work in IE.

Thanks for any help!

P.S. Sorry for the lack of hyperlinks to documentation, it will only allow me 2 as a new user.

Here is the embed code, the lightbox code is unique to the different lightboxes being used:

    var flashvars = {};

    var params = {};
    params.allowScriptAccess ="always";
    params.allowFullScreen = "true";
    params.wmode = "transparent";
    params.scale = "noscale";
    params.menu = "false";

    var attributes = {};
    attributes.id = "API";
    attributes.name = "API";

    swfobject.embedSWF("api.swf", "API", 100, 100, "9.0.0", false, flashvars, params, attributes);

And my Actionscript code is very simple:

package  {

import flash.display.MovieClip;
import flash.external.ExternalInterface;
import flash.events.*;

public class jsTest extends MovieClip {


    public function jsTest() {
        button.addEventListener(MouseEvent.CLICK, buttonClicked);
    }

    private function buttonClicked(evt:MouseEvent):void
    {
        trace("click");
        ExternalInterface.call( "doLMSInitialize" );
    }
}

}


It seems IE is refusing all flash-vars if the flash is loaded in a lightbox.

The only possible workaround i found was to put the video + flashvars in a seperate file and use the Lightbox in iframe mode loading this file.

Sorted it for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号