2 Replies Latest reply on Aug 10, 2006 5:34 AM by sam luke

    control properties

    sam luke Level 1
      I am currently trying to set a number of different control properties, a button in this case, from within actionscript.

      I am using eclipse and from the action script when I type in the id of the control and '.' a number of properties are displayed. Unfortunately I cant see any fillcolour or click!!!! And I dont know why. Although I can choose the .visable option. Can somebody please help?

      When I include the fillcolour or click. The code doesnt compile and mentions something about the button being static!
        • 1. Re: control properties
          peterent Level 2
          Neither backgroundColor (there is no fill) nor click are properties. backgroundColor is a style; click is an event. label is a property.

          <mx:Button id="test" label="Test Me" />

          To set an event handler, you need to do:

          test.addEventListener( "click", someFunction );

          where: private function someFunction( event:flash.events.MouseEvent ) : void is the signature of the click event handler.

          To set a style:

          test.setStyle( "backgroundColor", 0xFF0000 );
          • 2. Re: control properties
            sam luke Level 1
            Thank you very much for the answer I have tried it and it works. Thanks again.