0

So i have this expandable banner. And everything is ok with it, but when i'm testing it on our system it's not expanding. And here is the problem. Because our system is using this JavaScript for the floating : getURL("javascript:expandEaFloating('"+_level0.id+"')"); But this is AS2 and i need it for AS3. Here is the code:

import flash.external.ExternalInterface;
import flash.events.Event;
stop();


b1_btn.buttonMode = true;

b1_btn.addEventListener(MouseEvent.MOUSE_OVER, aBanner2);
b1_btn.addEventListener(MouseEvent.MOUSE_OVER, openBaner);


function openBaner(e:Event){  
    ExternalInterface.call("expandEaFloating('"+root.id+"')");
}

function aBanner2(e:Event){
this.gotoAndStop(2);
}

2 Answers 2

1

try this:

ExternalInterface.call("expandEaFloating",root.id);
Sign up to request clarification or add additional context in comments.

1 Comment

It's not working here is the error log - Access of possibly undefined property id through a reference with static type flash.display:DisplayObject.
0

Instead of root.id use ExternalInterface.objectID

ExternalInterface.call("expandEaFloating",ExternalInterface.objectID);

From the adobe docs:

Returns the id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape.

So be shure to set id and name of the object tag to the same value!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.