Some MXML attributes specify properties, some specify styles, some
specify event handler bodies, and some specify effects. (And some, like
'id', get special handling.)
 
The programmatic way to set a property is
 
    component.foo = bar;
 
The programmatic way to set a style or effect is
 
    component.setStyle("foo", "bar");
 
The programmatic way to set an event handler is
 
    component.addEventListener("foo", bar);
 
Gordon Smith
Adobe Flex SDK Team

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Seth Caldwell
Sent: Friday, December 21, 2007 11:25 AM
To: [email protected]
Subject: RE: [flexcoders] setting mxml attributes in actionscript when
those properties don't exist



Well, I solved the problem by using
adgc.setStyle("headerStyleName","someStyle");  - however I'm still
confused as to how there are attributes you can specify in mxml that
can't be set programmatically.

I've encountered this elsewhere also - is it just a styles thing?

Seth

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Seth Caldwell
Sent: Friday, December 21, 2007 11:20 AM
To: [email protected]
Subject: [flexcoders] setting mxml attributes in actionscript when those
properties don't exist

For example, I'm wanting to set the headerStyleName on an
AdvancedDataGridColumn... which you can do with mxml:
<mx:AdvancedDataGridColumn headerStyleName="someStyle"/>

However, when I try to do it with actionscript:

var adgc:AdvancedDataGridColumn = new AdvancedDataGridColumn();

adgc.headerStyleName = "someStyle";

I get the error that headerStyleName is not defined on
AdvancedDataGridColumn.

Huh?

Whats going on here, and how can I set it programmatically? 

Thanks,

Seth

 

Reply via email to