> I wonder if there is additional overhead associated with declaring untyped special type variables (*) compared to typed variables?

Yes, I believe there is; if the compiler doesn't know anything about the type it can't optimize the generated code as well. But there is no reason to use * here; you could declare var itm:Object instead. The only reason to use * is when you need to store 'undefined' in addition to 'null'.

 

However, there is definitely an overhead associated with using dynamic classes like Ojbect. If you want the best performance, don't use dtynamic Objects like { label: xxx, color: yyy }; instead declare a nondynamic ColorPickerDataProviderItem class with 'label' and 'color' properties.

 

However, in this case I doubt you'll actually be able to see any better performance because these objects don't get accessed a huge number of times.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tim Hoff
Sent: Sunday, June 18, 2006 1:41 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: F2B3: Possible bugs with ComboBox ItemRenderer and ColorPicker

 

Thanks for the great tips.  The changes worked great.  I wonder if there is additional overhead associated with declaring untyped special type variables (*) compared to typed variables?

I couldn't get the color picker focus border to dissapear completely.  Nothing that I tried with the FocusManager worked.  I'm probably just doing it wrong.  But, for now the sample is good enough to demonstrate the ComboBox ItemRenderer concepts.

Thanks again,
Tim Hoff

http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectID=447 

--- In flexcoders@yahoogroups.com, "Jeremy Lu" <[EMAIL PROTECTED]> wrote:
>
> hi Tim,
>
> try this (solves yellow can't be selected problem):
>
> private function addColor(event:Event):void {
> cp.visible = false;
> //
> var itm:* = cp.dataProvider[ cp.selectedIndex ];
> Util.traceValue(itm);
> //
> colorArray.push({label:itm.label, color:itm.color});
> messageText.setStyle('color',itm.color);
> messageText.text = itm.label + " has been added to the comboBox.";
> cbxColor.open();
> btnAddColor.setFocus();
> }
>
> things I changed:
>
> 1. listen to! ColorPicker's "close" event, instead of "change" event
>
> 2. get the value from cp using "selectedIndex" instead of "selectedItem",
> this will ensure you get the right value out of the picker.
>
> regarding the focus around cp after it's set invisible, can't figure out it,
> but in the past when I ran into this, I usually set focus to a textfield off
> the stage or completely turn off the focus.
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to