3 Replies Latest reply on Mar 18, 2009 5:23 AM by Newsgroup_User

    Setting Custom Component Properties

    quotto
      I have created a custom mxml component based on a Canvas. It contains various controls, including several buttons. I'd like to be able to set the buttons' labels in the IDE and have them display at both design time and run time. I created the following property on the parent component:

      public function set buttonText(value:String):void {myButton.label = value}

      In the IDE, I set buttonText in the property table, but it doesn't show up on the button. At runtime, I get an error saying that myButton is a null object, so apparently it has not yet been created by the Flash player when the value is set. Is there any way to accomplish this?