Subclassing stuff like Number and String makes baby Jesus cry :-) If we know what your end goal is, rather than just your plan to get there, maybe we can be of more help?
Cheers, -Josh On Feb 11, 2008 1:27 AM, Michael Labriola <[EMAIL PROTECTED]> wrote: > > It's not that Number is a base class. It's that Number is final. > > I am afraid that pretty much any solution you attempt here is going to > be hacky. You are trying to couple a number, which is a primitive, > with a complex formatter object. > > Since you mentioned an itemRenderer, is this only being used in a > datagrid or list control? If so, a labelFunction would probably be a > much better choice than changing the default itemRenderer in most > cases and might be more maintainable. > > Sorry if that does not help, > Mike > > --- In [email protected] <flexcomponents%40yahoogroups.com>, > okegbenle mayowa > > <[EMAIL PROTECTED]> wrote: > > > > hello > > looking at the subject, the first thing that comes to > > ur mind is "doesn't this guy know the number class is > > a base class", but what the heck, i need some extra > > functionality. Anyway this is my scenerio: > > What i need is a number class with a toString() method > > that outputs a currency formatted number. > > > > eg var num:Number = new Number(3000) > > Alert.show(num.toString());//outputs $3,000. > > > > In the past i had used ItemRenderers with the > > CurrencyFormatter acting on the data property. later i > > got tired of itemrenderers and decided to find a more > > sleek approach.My first disappointment was remembering > > that the Number class is a base class, ok then next > > thought was to see if i could copy the Number Class > > source code from the framework, upon checking i > > decided it was better not attempted.So the my last > > option is the composition technique(since inheritance > > was impossible). This produced some very hacky class > > which am not proud of, so is there a very cool way to > > solve my problem. > > > > MayorBrain > > > > > > > > > __________________________________________________________ > > Never miss a thing. Make Yahoo your home page. > > http://www.yahoo.com/r/hs > > > > > -- "Good people will do good things, and bad people will do bad things. But for good people to do bad things—that takes religion." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
