Configuring HTML for Basic ExternalInterface Calls


If you want to use ExternalInterface to enable Flash-to-JavaScript and JavaScript-to-Flash communication, you'll have to configure the HTML so that the allowScriptAccess parameter (<object> tag) and attribute (<embed> tag) is set to always. The default HTML published by Flash assigns a value of sameDomain to allowScriptAccess, so if you've published the HTML from Flash, you'll need to edit it. The following illustrates where you can locate the allowScriptAccess parameter and attribute:

   <object class ¬      codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/ ¬      flash/swflash.cab#version=8,0,0,0" width="550" height="400" ¬       align="middle">      <param name="allowScriptAccess" value="always" />      <param name="movie" value="Example.swf" />      <param name="quality" value="high" />      <param name="bgcolor" value="#ffffff" />      <embed src="/books/2/759/1/html/2/Example.swf" quality="high" bgcolor="#ffffff" ¬        width="550" height="400" name="Example" align="middle" ¬        allowScriptAccess="always" type="application/x-shockwave-flash" ¬        pluginspage="http://www.macromedia.com/go/getflashplayer" />    </object>





Macromedia Flash 8 ActionScript Training from the Source
Macromedia Flash 8 ActionScript: Training from the Source
ISBN: 0321336194
EAN: 2147483647
Year: 2007
Pages: 221

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net