hi everyone
i'm trying to convert an AS 2.0 component to an AS 3.0 component but i'm having some problems with getter and setter methods.
here is something similar to what i'm trying to do:
this component has only one variable, _path. in the component inspector i give my variable the value "myFile"
the AS 2.0 component is working fine
if i test the component in the output panel i get :Code:class as2Class extends MovieClip{ private var _path:String; [Inspectable(defaultValue="", type=String, name="file path")] public function set path(value:String):Void{ _path = value; trace("set") } public function get path():String{ return _path; } public function as2Class(){ trace(_path); trace("constructor") } }
set
myFile
constructor
but the AS 3.0 component isn't working
if i test this component, in the output panel i get:Code:package{ import flash.display.MovieClip; public class as3Class extends MovieClip{ private var _path:String; [Inspectable(defaultValue="", type=String, name="file path")] public function set path(value:String):void{ _path = value; trace("set") } public function get path():String{ return _path; } public function as3Class(){ trace(_path); trace("constructor") } } }
null
constructor
set
why isn't the as3 component working like the as2 component? and how could i
fix this problem?
Thank you.


Reply With Quote