Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-22-2011, 10:38 PM   #1
fatfrank
Registered User
 
Join Date: Jun 2011
Posts: 2
Default external interface and swfobject

Hi
I'm having some trouble with external interface and swfobject. Just can't seem to get external interface to communicate with my swf. Incidently it works when I publish it the traditional way, just not when I'm using swfobject! Any help would be appreciated!

JS:
<script type="text/javascript" src="js/swfobject.js"></script>

<script type="text/javascript">
var flashvars = {};
var params = {wmode:"opaque", allowscriptaccess:"always" };
var attributes = {id:"movie2", name:"movie2"};
//
swfobject.embedSWF("images/movie2.swf", "movie2", "550", "400", "9.0.0", false, flashvars, params, attributes);
//
function getFlashMovie(id) {
return document.getElementById(id);
}
function stopFlash(){
getFlashMovie("movie2").commandFlash();
}
</script>

HTML:
<a href="#" name="stop" onClick="stopFlash()"><div id="next"></div></a>


AS3:
ExternalInterface.addCallback("commandFlash", stopPlaying);
fatfrank is offline   Reply With Quote
Old 06-22-2011, 10:48 PM   #2
fatfrank
Registered User
 
Join Date: Jun 2011
Posts: 2
Default

OK - sorted it....

function stopFlash(){
document.getElementById('movie2').commandFlash();
return true;
}

instead of:

function getFlashMovie(id) {
return document.getElementById(id);
}
function stopFlash(){
getFlashMovie("movie2").commandFlash();
}
fatfrank is offline   Reply With Quote
Old 07-04-2011, 09:40 AM   #3
janita123
Registered User
 
Join Date: Jul 2011
Posts: 2
Default

I also do have the same problem. Please reply as soon as possible. Thanks in advance.
janita123 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:06 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.