AIR3 :: FREObject and using accessors on AS3 class
Hi,
UPDATE: Seeing as I have applied for the FlashBuilder 4.6 preview and not heard back yet, I am flying by the seat of my pants. I think I got this issue solved(not passing null for the
FREObject.newObject()call), it must have been an exception getting swallowed somewhere because I have pushed ahead farther and backtracked to this problem. Things work, I hate sounding like an idiot below but hey this is bleeding edge development.
The Problem Solved:Now that I think about it, the call to FREObject.newObject() created a String and then the actual Exception came from the code trying to set “test” on the String class which we know does not exists.
I think this method signature might bite a couple devs in the ass once or twice.
![]()
I have been scowering the scant documentation on the FREObject class and most of it is copy and paste everywhere. I’m at about 4 hours of serious determination when I am slowly realizing either I am doing something wrong or using an ActionScript class’s accessors just don’t work in the just released Java API for AIR native extensions.
I can successfully set a public var, call a method but when I try to set a setter property, I get an com.adobe.fre.FRENoSuchNameException.
AS3 class:
package com.teotigraphix.android.foo { public class Bar { public var baz:int; private var _test:String; public function get test():String{ return _test; } public function set test(value:String):void { _test = value; } public function Bar() { } } }
Works:
FREObject instance = FREObject.newObject("com.teotigraphix.android.foo.Bar"); instance.setProperty("baz", FREObject.newObject(42));
Doesn’t work:
Throws com.adobe.fre.FRENoSuchNameException.
FREObject instance = FREObject.newObject("com.teotigraphix.android.foo.Bar",); instance.setProperty("test", FREObject.newObject("42"));
Does anybody out there have an idea or have seen this before? Maybe a bug?
Mike




Recent Comments