I created a small component in Flash CS4, and I linked my MyComp character to its corresponding MyComp class. The code in MyComp.as is as follows:
package { import flash.display.MovieClip; public class MyComp extends MovieClip { public function MyComp() { trace(this.test); } private var _test:String; [Inspectable(defaultValue="blah")] public function get test():String { return this._test; } public function set test(v:String):void { this._test = v; } } }
When I drag a component into a test FLA, all the properties of the component are displayed according to the Inspectable [] meta tag. But when I set the properties in the component inspector, the value is always zero, regardless of what the component inspector says.
When tracing, for example, test, does it always print null?
How do I get the Component Inspector values ββin a component at runtime?
source share