>
Right, it does have a text box, with the color in Hex notation, so > you'd assume that there'd be a real easy way, in ActionScript, to pass > a hex value to it, but there isn't. > I find this perplexing. The way Flex displays the data or let you interact with it doesn't necessarily match the way it is stored internally. I think it's true of any framework including .NET and Java. -- Laurent Cozic Flash, Flex and Web Application development http://pogopixels.com --- On Tue, 8/12/08, Dale Cook <[EMAIL PROTECTED]> wrote: From: Dale Cook <[EMAIL PROTECTED]> Subject: [flexcoders] Re: Is It Just Me? To: flexcoders@yahoogroups.com Date: Tuesday, August 12, 2008, 1:09 AM Right, it does have a text box, with the color in Hex notation, so you'd assume that there'd be a real easy way, in ActionScript, to pass a hex value to it, but there isn't. I find this perplexing. --- In [EMAIL PROTECTED] ups.com, "Josh McDonald" <[EMAIL PROTECTED]> wrote: > > Well the first case wouldn't help mapping from a text-field, and the post > was more about "I can't figure our how to parse a number" than "how should I > work with colours?" > > StyleManager. getColorName is an awful, *awful* name for that API if it > converts from hex colours to uints :) > > But I'd still just use parseInt. > > Wait, doesn't the colour picker *have* a textbox you can copy/paste a hex > code to and from? > > -Josh > > On Tue, Aug 12, 2008 at 10:33 AM, Maciek Sakrejda <[EMAIL PROTECTED] ..>wrote: > > > Well, in this particular case, you could do > > > > // just use uint directly > > fontColor.selectedC olor = 0xd3d3d3; > > > > // or use StyleManager > > fontColor.selectedC olor = StyleManager. getColorName( "#D3D3D3" ); > > > > Admittedly, getColorName( ) is rather poorly named, and StyleManager is > > not the most obvious place to look (and the > > looks-like-it- should-be- the-right- thing ColorUtil class is not very > > helpful). > > > > Every framework has some unfortunate design decisions; Flex is really > > quite good once you get the hang of it. > > > > -- > > Maciek Sakrejda > > Truviso, Inc. > > http://www.truviso. com > > > > -----Original Message----- > > From: Dale Cook <[EMAIL PROTECTED] ..> > > Reply-To: [EMAIL PROTECTED] ups.com > > To: [EMAIL PROTECTED] ups.com > > Subject: [flexcoders] Is It Just Me? > > Date: Mon, 11 Aug 2008 23:59:55 -0000 > > > > OK, so I'm new to Flex but I have a lot of experience with other > > development platforms and languages(.NET, RoR, Javascript, etc.). > > > > I've read a few books and I've just been doing some fairly simple > > stuff to get my feet wet but already I'm starting to get a little > > fustrated with things that should be really easy. Perhaps I'm just > > missing something. > > > > For example, I have a colorpicker object and I want to set the > > selected color programmatically depending on which textinput field a > > user is in. So I suspected that I could do something like > > > > //the name of the color picker is fontColor > > fontColor.selectedC olor = "#D3D3D3" > > > > and everything would be good - but that doesn't appear to be the case. > > It looks like I have to convert the hex into a uint. OK, that seems > > like a lot more work than it should be but OK, I'll just use the > > DecimalToHex function of the int class... oh, wait there isn't one. > > There isn't a conversion anywhere that I can find to do this without > > writting even more code. > > > > Is it just be or does this seem like a lot of work to do something > > that most other modern languages handle without any additional coding, > > or an I completely missing something? > > > > Dale > > > > > > > > > > > > > > > > > > ------------ --------- --------- ------ > > > > -- > > Flexcoders Mailing List > > FAQ: http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txt > > Search Archives: > > http://www.mail- archive.com/ flexcoders% 40yahoogroups. comYahoo! Groups > > Links > > > > > > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > :: Josh 'G-Funk' McDonald > :: 0437 221 380 :: [EMAIL PROTECTED] >