<HTML>
	<HEAD>
    	<TITLE>Adobe ExtendScript Toolkit</TITLE>
		<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
		<LINK HREF="adobe.css" REL="stylesheet" TYPE="text/css">
        <LINK HREF="tabs.css" REL="stylesheet" TYPE="text/css">
 	</HEAD>
	<BODY> 
    <div class="header"><a href="http://www.adobe.com"><img src="adobelogo.jpg" alt="http://www.adobe.com"></a>&nbsp;<b>ExtendScript ToolKit</b></div>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="classes.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>ActionScriptDemo Class Reference</h1><!-- doxytag: class="ActionScriptDemo" -->
<h4>Usage</h4>
  
  <ol>
  <li> Read the section on <a href="#flashSec">Flash Player Security</a> below.
  <li> Run the sample in the ExtendScript Toolkit (see Readme.txt).
  <li> The dialog window appears with a start flash button than when activated loads the Flash Movie.
   <li> The Flash movie contains three buttons and two text areas.
  <li> Clicking the buttons calls the JavaScript functions from the ActionScript environment
         and passes data as arguments to the functions.
  </ol>
   
  <h4>Description</h4>

<p>This sample shows how to use the ScriptUI FlashPlayer element to invoke JavaScript 
  functions in ActionScript, and ActionsScript functions in JavaScript. It passes simple
  data between the two scripting environments, and displays passed values.
 
<p>The Flash application to be used with this sample must be located in the resources 
  folder and have the same name as this sample. The application is a Flash presentation.  The ActionScript script shows how to import the ExternalInterface class, 
  and how to register and call external functions, which are defined in this script.
  The ActionScript source code is provided as a comment block in the
  FlashDemo.JSX file.
  
<a name="flashSec"><h4>Flash Player Security</h4></a>

   Adobe ExtendScript supports the Flash Player client-runtime security model. This affects which SWF files 
   can be loaded into ESTK and run successfully. You must set the correct security permission
   to allow the operation that the SWF file performs.
   
   There are 3 basic levels of security for local SWF files:  
   <ul>
	<li> Access the local file system only (default):  
	A local SWF file can read from the local file system and 
  	universal naming convention (UNC) network paths, but cannot communicate with the Internet.   
  
	<li> Access the network only:  
	A local SWF file can access the network, but not the local file system where it is installed.
  
	<li> Access to the local file system and the network: 
	A local SWF file can read from the local file system  where it is installed,
 	read and write to and from servers, and can cross-script other SWF files on
  	either the network or the local file system. These files are trusted.
  </ul>
   
   To create a SWF file that can 'access the local file system only' or 'access the network only',
   edit the FLA file and do the following:

  <li> In Adobe Flash, select File > Publish Settings
  <li> In the dialog, select the Flash tab
  <li> Set the option for 'Local playback security' to either  'access network only' or 'access local files only'
<p>  
  For more information on local file security  see:
<p>
<a href="http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001136.html">
	http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001136.html</a> <br />
<a href="http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001604.html">
	 http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001604.html</a>

<p>To allow a local file to be trusted,(that is, allow a SWF file to access both network and local files 
  as well as allow cross scripting), you can either create a trust file, or use the Settings Manager. 
  This sample and the accompanying SWF file have been created with the default permissions; therefore 
  to run the sample correctly, you must use one of these techniques, as described in the following sections.
  
  <h4>Create a Trust File </h4>
  
  You can create a trust file in either the Global Flash Player Trust directory or in the User Flash Player Trust directory.  
  A Trust file is a simple text file with a .cfg file extension, that contains the location to a local SWF file. 
  For example, to run this sample as a trusted file on Windows, create a text file that contains the path and file name
  (replacing SDKINSTALL with your local SDK installation location):
  
<pre>	SDKINSTALL\Resources\ActionScriptDemo.swf</pre>
  
<p>Save this text file with the extension .cfg in a folder named 'FlashPlayerTrust' (which you may need to
create), in one of the following locations, depending on the platform and users for which the SWF should be trusted. 
  
<p>Global Flash Player Trust Directory
<ul>
	<li>In Windows: system\Macromed\Flash\FlashPlayerTrust
	<ul>
		<li>for example:<pre style="font-size:xx-small; color:#000000;">C:\windows\system32\Macromed\Flash\FlashPlayerTrust</pre>
	</ul>
	<li>In Mac OS: app support/Macromedia/FlashPlayerTrust
	<ul>
		<li>for example:<pre style="font-size:xx-small; color:#000000;">/Library/Application Support/Macromedia/FlashPlayerTrust</pre>
	</ul>
</ul>

<p>User Flash Player Trust Directory
<ul>
	<li>In Windows: app data\Macromedia\Flash Player\#Security\FlashPlayerTrust
	<ul>
		<li>for example:<pre style="font-size:xx-small; color:#000000;">C:\Documents and Settings\your-user-name\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust</pre> 
	</ul>
	<li style="font-size:xx-small; color:#000000;">In Mac OS: app data/Macromedia/Flash Player/#Security/FlashPlayerTrust
	<ul>
		<li style="font-size:xx-small; color:#000000;">for example:<pre>/Users/your-user-name/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust</pre>
	</ul>
	</li>
</ul> 

  <h4>Use the Settings Manager </h4>

   The Settings Manager allows you to make changes to various global settings, including whether to allow a SWF file
   to be trusted.  When ESTK loads a non-trusted file that attempts a trusted action, the Flash 
   Player presents a dialog giving the user the choice to navigate to the Settings Manager. 
<ul>
  <li>  When you run this sample (if you have not created a trust file for it) ESTK displays a security dialog
   warning about the SWF file. Click 'Settings...' in this dialog. <br> 
   The Adobe Flash Player Settings Manager opens in a web browser. 
   (You may need to install the Adobe Flash Plugin before you see this page correctly.)
  
  <li> On the Global Security Settings tab (the default tab), click 'Edit Locations' and choose 'Add Location' from
  	the drop down list. <br> A dialog appears showing the path of the SWF that Bridge is trying to load.

  <li> Click 'Browse for files', navigate to the location of the SWF file (SDKINSTALL/Resources/ActionScriptDemo.swf)
  	and click OK (There is no confirm dialog).

  <li> Close the web browser and restart ESTK.
 </ul>

   ESTK can now play the Flash movie and data can be passed between the two scripting environments.

  <p>For more  information on the Settings Manager and Trust files see:
  
  <p>
    <a href="http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001952.html">
  	http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001952.html</a><br />
<p>
<a href="classActionScriptDemo-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classActionScriptDemo.html#ad85e3b3d4415a8aeaeefb689100fac8">ActionScriptDemo</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">Boolean&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classActionScriptDemo.html#f2591541f47a9c8242328bbee0b3684f">run</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Functional part of this Snippet.  <a href="#f2591541f47a9c8242328bbee0b3684f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">Boolean&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classActionScriptDemo.html#1a01007cfee1853ede7346a0019f11e6">canRun</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines whether snippet can be run given current context.  <a href="#1a01007cfee1853ede7346a0019f11e6"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">File&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classActionScriptDemo.html#17b888d2d081555a9a79012412dee9ab">flashFile</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The Flash movie to load into ESTK.  <a href="#17b888d2d081555a9a79012412dee9ab"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">String&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classActionScriptDemo.html#a7e9760459211160a53fabb8d8a20831">requiredContext</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The context in which this snippet can run.  <a href="#a7e9760459211160a53fabb8d8a20831"></a><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="ad85e3b3d4415a8aeaeefb689100fac8"></a><!-- doxytag: member="ActionScriptDemo::ActionScriptDemo" ref="ad85e3b3d4415a8aeaeefb689100fac8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ActionScriptDemo::ActionScriptDemo           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f2591541f47a9c8242328bbee0b3684f"></a><!-- doxytag: member="ActionScriptDemo::run" ref="f2591541f47a9c8242328bbee0b3684f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Boolean ActionScriptDemo::run           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Functional part of this Snippet. 
<p>
Creates a Dialog window and adds a FlashPlayer control. A button on the dialog enables the activation of loading the flash player which extends the functionality with buttons that interact with the JavaScript functions; getJavaScriptString. getJavaScriptNumber and launchJavaScript. a flash movie.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if the snippet ran as expected, false otherwise </dd></dl>

</div>
</div><p>
<a class="anchor" name="1a01007cfee1853ede7346a0019f11e6"></a><!-- doxytag: member="ActionScriptDemo::canRun" ref="1a01007cfee1853ede7346a0019f11e6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Boolean ActionScriptDemo::canRun           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Determines whether snippet can be run given current context. 
<p>
The snippet fails if these preconditions are not met: <ul>
<li>
The Flash file must be available </li>
</ul>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if this snippet can run, false otherwise </dd></dl>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="17b888d2d081555a9a79012412dee9ab"></a><!-- doxytag: member="ActionScriptDemo::flashFile" ref="17b888d2d081555a9a79012412dee9ab" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">File <a class="el" href="classActionScriptDemo.html#17b888d2d081555a9a79012412dee9ab">ActionScriptDemo::flashFile</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The Flash movie to load into ESTK. 
<p>

</div>
</div><p>
<a class="anchor" name="a7e9760459211160a53fabb8d8a20831"></a><!-- doxytag: member="ActionScriptDemo::requiredContext" ref="a7e9760459211160a53fabb8d8a20831" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">String <a class="el" href="classActionScriptDemo.html#a7e9760459211160a53fabb8d8a20831">ActionScriptDemo::requiredContext</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The context in which this snippet can run. 
<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="ActionScriptDemo_8jsx.html">ActionScriptDemo.jsx</a></ul>
</div>
<p><img src="1ptrans.gif" /><p>
<p><img src="1ptrans.gif"  /></p>
<p><img src="asn.gif" width="114" height="45" border="0" alt="Adobe Solutions Network">Copyright&#169; 2008 Adobe Systems Incorporated. All rights reserved.</p>
<p>
    	<a href="http://www.adobe.com/misc/copyright.html">Terms of Use</a>&nbsp;
        <a href="http://www.adobe.com/misc/privacy.html">Online Privacy Policy</a>&nbsp;
        <a href="http://access.adobe.com">Adobe and accessibility</a>&nbsp;
        <a href="http://www.adobe.com/aboutadobe/antipiracy/main.html">Avoid software piracy</a>&nbsp;
        <a href="http://www.adobe.com/misc/agreement.html">Permissions and Trademarks</a>
</p>
</body>
</html>
