Note that there are some explanatory texts on larger screens.

plurals
  1. POExternalInterface Woes
    text
    copied!<p>I know there are an abundance of articles and forum post (many of them from myself) regarding ExternalInterface, I guess I'll add one more...</p> <p>I have a small flash app (a button) which is set up to test the availability of ExternalInterface and it works great. I also have a larger, more complex, flash mp3 player, which I am trying to use ExternalInterface with; it does not work so great. The question is, where does the problem lie? My working externalInterface code looks like this: </p> <pre><code>import flash.external.ExternalInterface myBtn.onRelease = function(){ chkAvail(); } function chkAvail() { var myText:TextField = this.createTextField('myText', this.getNextHighestDepth(), 100, 100, 300, 21); ExternalInterface.call("alert",'EI works!!"); myText.text = String(ExternalInterface.available); } </code></pre> <p>And all of that works great. My mp3 player code looks like this (excerpt, full code posted <a href="http://pastebin.com/f727ea599" rel="nofollow noreferrer">here</a>): At the top-</p> <pre><code>import flash.external.ExternalInterface; </code></pre> <p>and where I want to call the javascript- </p> <pre><code>function loadPlaylist(){ //attempting to make external js call ExternalInterface.call("alert", "Hello World!1"); // track_display_mc.display_txt.text = LOADING_PLAYLIST_MSG; if(track_display_mc.display_txt._width&gt;track_display_mc.mask_mc._width){ track_display_mc.onEnterFrame = scrollTitle; }else{... </code></pre> <p>So why does the first one work and not the second one? I feel like I'm calling them correctly from the html. Could it be a problem with importing the flash.external.ExternalInterface? Should I include that in the .flv where the .as is imported/included, instead of in the actual actionscript? All help/ideas are greatly appreciated...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload