Thanks for your response! I am not getting any compiler errors...should I be? Is it illegal to assign constant values to an attribute?
I am trying to create an attribute that is an integer "mask" and then use OR-ed together constants to pass in and set the attribute? Isn't this possible? I'd hate to hard code all of my attribute values to magic numbers if it is possible to use constants instead for readability and maintainability. In my example, myComponent.xml is the class, not MyComponent. --- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > Aren't you getting compiler warnings about binding to statics? > > > > What is "myComponent"? "MyComponent" is the class, but "myComponent" > must be something else? > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of gary_mangum > Sent: Friday, June 01, 2007 10:53 AM > To: [email protected] > Subject: [flexcoders] Re: Custom Attributes > > > > Still haven't figured this one out...is this a bug in flex? > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> > , "gary_mangum" <garym@> wrote: > > > > I am unsuccessfully trying to pass an integer constant to a custom > > integer attribute of a custom component. Confused yet? Here's an > > example of what I am trying to do: > > > > Application: > > <?xml version="1.0"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml > <http://www.adobe.com/2006/mxml> " width="700" > > height="250" borderStyle="solid" xmlns:ns1="*"> > > <ns1:myComponent supportsMultiselect="true" > > supportTypeMask="{myComponent.TYPE_MASK_TEXT}"/> > > </mx:Application> > > > > MyComponent: > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml > <http://www.adobe.com/2006/mxml> "> > > <mx:Script> > > <![CDATA[ > > public static const TYPE_MASK_ALL:int = -1; > > public static const TYPE_MASK_NONE:int = 0; > > public static const TYPE_MASK_IMAGE:int = 1; > > public static const TYPE_MASK_TEXT:int = 2; > > public static const TYPE_MASK_SPRITE:int = 4; > > > > public var supportsMultiselect:Boolean; > > public var supportTypeMask:int; > > ]]> > > </mx:Script> > > </mx:Button> > > > > > > The public var supportTypeMask is never getting set for some reason if > > I try to pass it one of the constants. If I pass "2" instead of > > "{myComponent.TYPE_MASK_TEXT}" it works great. > > > > Any ideas about what I am doing wrong here? > > > > Thanks for your help! > > >

