Arg... I feel like I am soo close - but something is not
quite right...
I am stuck on the communcation from Javascript back to Actionscript in an Adobe Air 1.5 app... (not flex).
here is my Main():
Now, I simply want to either access _as3Var or as3Function() from my AppSandbox javascript... My HTMLLoader looks like this:
And this is my javascript snippit:
What I am doing wrong?
I am stuck on the communcation from Javascript back to Actionscript in an Adobe Air 1.5 app... (not flex).
here is my Main():
quote:
public class Main extends Sprite {
public var _as3Var:String = "testing";
public function as3Function():void
{
trace("as3Function called from Javascript");
}
public function Main() {
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
}
protected function onInvoke(e:InvokeEvent):void {
NativeApplication.nativeApplication.removeEventListener(InvokeEvent.INVOKE, onInvoke );
var app = new App();
addChild(app);
app.init(new ExternalContainer(), e.currentDirectory, e.arguments);
}
}
}
Now, I simply want to either access _as3Var or as3Function() from my AppSandbox javascript... My HTMLLoader looks like this:
quote:
{
_html = new HTMLLoader();
_html.useCache = false;
_html.runtimeApplicationDomain = ApplicationDomain.currentDomain;
_html.load(new URLRequest("sandbox/AirRoot.html"));
}
And this is my javascript snippit:
quote:
Exposed.testAs3 = function()
{
air.trace("Exposed.testAs3 called"); /* this works great */
air.trace("runtimeVersion:"); /* this works great */
air.trace(air.NativeApplication.nativeApplication.runtimeVersion); /* this works great */
air.trace("seeing if I can get to AS3 params..."); /* this works great */
air.NativeApplication.nativeApplication.as3Function(); /* this produces an exception: TypeError: Value undefined does not allow function calls. */
}
What I am doing wrong?