0

ActionScript code:

import flash.external.ExternalInterface;
var process = ExternalInterface.addCallback("process", this, Process);
function Process(){
  avatar.process_loop.gotoAndPlay("loop");
}

JavaScript code:

<div id="avatar"></div>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
     swfobject.embedSWF("imgs/avatar.swf", "avatar", "170", "170", "9.0.0", "expressInstall.swf");
     swfobject.process();
</script>

The swf loads, I see it on the page, just the connection or the calling of the method is not working.

By the way everything is working fine on the swf, that function does in fact perform that "loop." Is there anything wrong with my code?

Thanks!

1 Answer 1

1

is swfobject a reference to the DOMElement? It needs to reference the element and not any other constructor/function/etc.

You can alert( typeof swf.process ) if I recall correctly and see if its a function or not. Before that, you can do swfobject.nodeType to see if its an actual DOM node.

EDIT:

Try doing:

document.getElementById('avatar').process()

Instead of

swfobject.process

Sign up to request clarification or add additional context in comments.

2 Comments

I'm so very sorry but I don't know what a DOMElement is... are you asking if this is the only "swfobject" var / object on my code/page.. if so, yes.
Can you make a demo on jsbin or similar?

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.