In order to allow JavaScript to call functions within your Flash content, you need to create an instance of the JavaScriptProxy class and specify the object that functions will be proxied to.
import com.macromedia.javascript.JavaScriptProxy; var proxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);
The constructor takes two arguments. The first is the unique id passed into the Flash content from the HTML page (see above). The second is the object or class instance that function calls from JavaScript will be proxied to. Note: the arguments are only required if your Flash content will receive function calls from JavaScript.
This is all of the code required. Any JavaScript calls will be passed to the object specified in the constructor parameter.