Re: [flexcoders] Re: Styling in Flex is officially ridiculous
I can be wrong, but prototype is still functional, am I wrong? More information on this can be found in prog_actionscript30.pdf, in the chapter Object-Proented Programming in Actionscript under Advanced topics. Greetz Erik
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
I guess what really made this easier for us in the past was the ability to use the 'prototype' chain to override properties and functions at a global level for all TextField instances. I know overriding the prototype chain is a thing of the past and for good reasons but it sure would be nice if ALL textFields in every component could get a StyleSheet instance from the StyleManager. I can be wrong, but prototype is still functional, am I wrong? Rogerio
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
You can't extend things like TextField or Object like you could in AS1/AS2, which was Lance's point. I think that's a different discussion. I can see Ben's point about Buttons and borders. When I start a MXML project and drop a button on the stage I can change the border colour of a button, along with other properties. Why is it so odd that I would assume that I should be able to disable the border? If the border isn't actually a border, then why provide a styling options as if there was a border? That's the flaw. If you are creating a component that has the look of a border, allows the user to change the colour of the border, why wouldn't you allow the user to disable the border? Change the width of the border? Why would the component support some (relevant) styles and not others? I can be wrong, but prototype is still functional, am I wrong? Rogerio -- Derek Vadneau
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
Maybe I am wrong but I thought that you can no longer to something like this: flash.text.TextField.prototype.styleSheet = myStyleSheet; In my tests this doesn't create a compiler error but it doesn't work either. If I am wrong someone please shed some light on this because I haven't been able to make it work as it did in AS1/AS2. Thanks! Lance From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rogerio Gonzalez Sent: Monday, December 04, 2006 6:55 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Styling in Flex is officially ridiculous I guess what really made this easier for us in the past was the ability to use the 'prototype' chain to override properties and functions at a global level for all TextField instances. I know overriding the prototype chain is a thing of the past and for good reasons but it sure would be nice if ALL textFields in every component could get a StyleSheet instance from the StyleManager. I can be wrong, but prototype is still functional, am I wrong? Rogerio
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
It's possible, but not trivial, to style hyperlinks in HTML text in Flex. Here is an example: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.core.mx_internal; private function label1_initializeHandler(event:Event):void { label1.htmlText = Click a href='http://www.adobe.com'here/a; var styleSheet:StyleSheet = new StyleSheet(); styleSheet.setStyle(a:link, { textDecoration: underline, color: #FF }); styleSheet.setStyle(a:hover, { textDecoration: underline, color: #00 }); styleSheet.setStyle(a:active, { textDecoration: underline, color: #FF }); label1.mx_internal::styleSheet = styleSheet; } ]] /mx:Script mx:Label id=label1 selectable=true initialize=label1_initializeHandler(event)/ /mx:Application You must do it through the Flash Player's StyleSheet class; you can't use mx:Styles. Flex's CSS styles apply to the Flex DOM, while StyleSheet applies to the HTML DOM. We haven't devoted a lot of attention to HTML text in Flex because the Flash Player's support for HTML is so limited and many Flex developers find it doesn't meet their needs, Apollo will change that, but it isn't clear when the Player's HTML support for Flex apps in the browser will get better. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ethan Miller Sent: Thursday, November 30, 2006 1:33 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Styling in Flex is officially ridiculous While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
I know everyone doesn't have the same needs but we have used HTML text in flash ever since it was supported. The framework in Flex as well as the new VM really made this difficult and in the end we had to override several of the Flex framework classes as well as extend some of the components to handling this in a global way. I guess what really made this easier for us in the past was the ability to use the 'prototype' chain to override properties and functions at a global level for all TextField instances. I know overriding the prototype chain is a thing of the past and for good reasons but it sure would be nice if ALL textFields in every component could get a StyleSheet instance from the StyleManager. My current solution is to over ride the StyleManager with a modified version that creates a StyleSheet instance from the styles that it contains. Then I have to go in and extend Text, Label, TextArea etc so they automatically use the StyleSheet instance from my custom StyleManager. In this way we don't have to 1. Maintain multiple style sheets and 2. go around assigning the StyleSheet to every component I want to use it on which is a huge pain! J It would be nice to see some kind of support for this in the future even if it was just Text, Label and TextArea that supported it. Thanks! Lance From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Friday, December 01, 2006 1:35 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Styling in Flex is officially ridiculous We haven't devoted a lot of attention to HTML text in Flex because the Flash Player's support for HTML is so limited and many Flex developers find it doesn't meet their needs, Apollo will change that, but it isn't clear when the Player's HTML support for Flex apps in the browser will get better. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ethan Miller Sent: Thursday, November 30, 2006 1:33 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Styling in Flex is officially ridiculous While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
Ok, I give into the guy with the bigger mouth... Your offensive now. Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: Michael, I have no desire to split semantic hairs with you. While Button may not utilize the border API, it most certainly does have a border. My frustration is in how that border is implemented. I assumed (wrongly, apparently) that that was clear from my two previous posts. Consider this. Developer new to Flex: How do I get rid of the border on my buttons? You: Oh its easy; just go find the several hundred lines long ButtonSkin class, copy it into a new class, go to the part that draws the border and add an if statement that checks for the custom borderEnabled style you'll be adding. See? Isn't Flex awesome? New dev: Ummm, yeah While your solution is plausible, its far from practical. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: Ben, This issue could only peeve you if it was actually an issue. The Button does not have a border. Thus, the border API does not apply to a Button. This is the reason they say upSkin, it's a skin. You could easily copy and paste the ButtonSkin class and put another style in the says borderEnabled. In the skin rendering method, call that style and put the drawing api section that contains the 'border' in an if statement. This way you just set ONE style and vola, no border! Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: Yes, I meant the button's border. The default button is a gradient background with a border around it. I just wanted a gradient. No border. What I ended up doing was to create a PNG that had a gradient using the colors I wanted, created a Button subclass (in MXML) called GreenButton, set styleName to greenButton, and then defined greenButton inside a Style tag. In the greenButton style I set the upSkin property to use my PNG and provided 9-slice values and also set the text color. This approach allows me to reuse GreenButton and set the label and width (among other things) inline. The drawbacks, however, are that I will need to create separate images for downSkin, disabledSkin, etc. for each and every custom button I need, like RedButton, etc. So all in all it is a fairly simple and tolerable workaround, it just peeves me that I can't say borderStyle: none. In my opinion, if a component has a border you should be able to turn it off. Its just an if statement. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com, Andrew Trice andrew.trice@ wrote: That's how I interpreted it: that he is actually talking about the button's border. Ben, is that what you were talking about? If so, the skin method is the way to go. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: andrew.trice@ Office: 866-CYNERGY From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:50 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Oh yeah... If he is talking about the actual button border, that is the skin and he needs to create a new skin. The button does not have borders, it has skins. It dosn't even share the same characteristics of a Container that has a border. These are not the same things. So, Ben, what do you mean when you say the Button's border? Or, what do you want... Peace, Mike On 11/29/06, Michael Schmalle teoti.graphix@ mailto:teoti.graphix@ wrote: Andy, It answers his question and it does work. If the label is present, you click on the label and the Button functions correctly. I don't know what he is aiming for here but, if you 'don't' have a border, there is no other hit area specified for the component. So, how are you going to get mouse events from a component that dosn't have a hit area? Bottom line is, this approach does work if you plan to use a label, other than this, why would you want a button without a label and border if you want to click on it? Peace, Mike On 11/29/06, Andrew Trice andrew.trice@ mailto:andrew.trice@ wrote: I'm not sure that approach really works... The buttons don't show up at all. -Andy _ Andrew Trice Cynergy Systems, Inc. http
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
Hi Ben, I agree with Michael that you are beeing offensive, but I also agree with you that new devs may have some questions about it. So, look for skinning and themes in google. The button, is actually an 9 slice image. It doesn´t have any borders and such, because it is not a flex object. It is a image :) So, to witdraw the border, you have to rebuild the image. One way I like to do it is from flash. Just edit the object in flash, the way you like it :) http://weblogs.macromedia.com/mc/archives/2005/06/windows_xp_them.cfm This is an example of a skinning that I really like :P This is one good article about it: http://www.adobe.com/devnet/flex/articles/flex_skins.html Regards Rogério Gonzalez On 11/30/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: Michael, I have no desire to split semantic hairs with you. While Button may not utilize the border API, it most certainly does have a border. My frustration is in how that border is implemented. I assumed (wrongly, apparently) that that was clear from my two previous posts. Consider this. Developer new to Flex: How do I get rid of the border on my buttons? You: Oh its easy; just go find the several hundred lines long ButtonSkin class, copy it into a new class, go to the part that draws the border and add an if statement that checks for the custom borderEnabled style you'll be adding. See? Isn't Flex awesome? New dev: Ummm, yeah While your solution is plausible, its far from practical. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: Ben, This issue could only peeve you if it was actually an issue. The Button does not have a border. Thus, the border API does not apply to a Button. This is the reason they say upSkin, it's a skin. You could easily copy and paste the ButtonSkin class and put another style in the says borderEnabled. In the skin rendering method, call that style and put the drawing api section that contains the 'border' in an if statement. This way you just set ONE style and vola, no border! Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: Yes, I meant the button's border. The default button is a gradient background with a border around it. I just wanted a gradient. No border. What I ended up doing was to create a PNG that had a gradient using the colors I wanted, created a Button subclass (in MXML) called GreenButton, set styleName to greenButton, and then defined greenButton inside a Style tag. In the greenButton style I set the upSkin property to use my PNG and provided 9-slice values and also set the text color. This approach allows me to reuse GreenButton and set the label and width (among other things) inline. The drawbacks, however, are that I will need to create separate images for downSkin, disabledSkin, etc. for each and every custom button I need, like RedButton, etc. So all in all it is a fairly simple and tolerable workaround, it just peeves me that I can't say borderStyle: none. In my opinion, if a component has a border you should be able to turn it off. Its just an if statement. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com, Andrew Trice andrew.trice@ wrote: That's how I interpreted it: that he is actually talking about the button's border. Ben, is that what you were talking about? If so, the skin method is the way to go. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: andrew.trice@ Office: 866-CYNERGY From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:50 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Oh yeah... If he is talking about the actual button border, that is the skin and he needs to create a new skin. The button does not have borders, it has skins. It dosn't even share the same characteristics of a Container that has a border. These are not the same things. So, Ben, what do you mean when you say the Button's border? Or, what do you want... Peace, Mike On 11/29/06, Michael Schmalle teoti.graphix@ mailto:teoti.graphix@ wrote: Andy, It answers his question and it does work. If the label is present, you click on the label and the Button functions correctly. I don't know what he is aiming for here but, if you 'don't' have a border, there is no other hit
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
[flexcoders] Re: Styling in Flex is officially ridiculous
I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
something that I feel needs to be addressed in order to improve the Flex framework. I think that is all you had to say in your original post. As far as me, along with the line above... what do we do? We know this isn't going to be changed in the near future. So, we as 'advanced and complicated developers' create a solution from a problem and blog about it. Peace, Mike On 11/30/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
hm,,,about easy ways to skinning... any ideas about the panel's header horizontal line ? how to get rid of it... if you set values for , ie headerColors: #ff, #ee; you get the horizontal divider together i want colors but no line On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- . m a r c o sa u g u s t o ; .eu vim para confundir e não para explicar!. . . - Chacrinha
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
Just a brief comment from myself - Since no solutions were really being offered up until Mike's posted comment, any solution (even if it's a bit complex) is better than NO solution whatsoever. At least the original poster, has something to get him going in the interim, until a more simple solution presents itself potentially later on. One last note: after diving into Mike's sizing component, it's become apparent to me that Mike has a much deeper understanding on how Styles work than most other developers - as well as how they are tightly integrated/implemented into the entire Flex Framework. With that said, there is no better person that could have replied to that original post, than Mike. Just wanted to throw that in - Thanks :) Mike From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Schmalle Sent: Thursday, November 30, 2006 8:49 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Styling in Flex is officially ridiculous something that I feel needs to be addressed in order to improve the Flex framework. I think that is all you had to say in your original post. As far as me, along with the line above... what do we do? We know this isn't going to be changed in the near future. So, we as 'advanced and complicated developers' create a solution from a problem and blog about it. Peace, Mike On 11/30/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Michael Schmalle [EMAIL PROTECTED] wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
The only thing that annoyed me about Ben's complaint was the hyperbole of his subject line, Styling in Flex is officially ridiculous. (My own not-so-humble opinion is that Flex's use of CSS styles is pretty cool.) I agree with him that it would be nice if ButtonSkin were more styleable. More importantly, we need to hear about the cases where developers think Flex makes something too difficult, because he's right that it's the only way to get mass adoption. That doesn't mean our team will address every one of them, due to competing priorities and judgments about how many other developers are likely to have the same complaint. (I'm not aware of many requests for borderless buttons before Ben's.) But if we don't know about your pain points, we aren't likely to make them go away. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Thursday, November 30, 2006 6:29 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Styling in Flex is officially ridiculous I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Michael Schmalle [EMAIL PROTECTED] wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
[flexcoders] Re: Styling in Flex is officially ridiculous
Annoying I can see, and so I apologize for that. My title was definitely borne out of significant frustration and should have been more factual. I also agree that most of Flex's CSS implementation is pretty cool. Gordon, in the spirit of making pain points known, here is one that looks like it was simply an oversight: http://tech.groups.yahoo.com/group/flexcoders/message/56469 Ben --- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote: The only thing that annoyed me about Ben's complaint was the hyperbole of his subject line, Styling in Flex is officially ridiculous. (My own not-so-humble opinion is that Flex's use of CSS styles is pretty cool.) I agree with him that it would be nice if ButtonSkin were more styleable. More importantly, we need to hear about the cases where developers think Flex makes something too difficult, because he's right that it's the only way to get mass adoption. That doesn't mean our team will address every one of them, due to competing priorities and judgments about how many other developers are likely to have the same complaint. (I'm not aware of many requests for borderless buttons before Ben's.) But if we don't know about your pain points, we aren't likely to make them go away. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Thursday, November 30, 2006 6:29 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Styling in Flex is officially ridiculous I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Michael Schmalle teoti.graphix@ wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle teoti.graphix@ wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR eecolor@ wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com http://www.flex2components.com You can find more by solving
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
One other thing, the little elves hiding behind the Adobe wish form are amazing responsive. When I make a bug / feature request, I usually get a verification or clarification email within a few days. Pretty good stuff. Gordon Smith wrote: The only thing that annoyed me about Ben's complaint was the hyperbole of his subject line, Styling in Flex is officially ridiculous. (My own not-so-humble opinion is that Flex's use of CSS styles is pretty cool.) I agree with him that it would be nice if ButtonSkin were more styleable. More importantly, we need to hear about the cases where developers think Flex makes something too difficult, because he's right that it's the only way to get mass adoption. That doesn't mean our team will address every one of them, due to competing priorities and judgments about how many other developers are likely to have the same complaint. (I'm not aware of many requests for borderless buttons before Ben's.) But if we don't know about your pain points, we aren't likely to make them go away. - Gordon *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *ben.clinkinbeard *Sent:* Thursday, November 30, 2006 6:29 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: Styling in Flex is officially ridiculous I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle [EMAIL PROTECTED] wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR [EMAIL PROTECTED] wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array = getStyle(highlightAlphas); var themeColor:uint = getStyle(themeColor); It would have been nice indeed to have the border style thingy in it. Instead of bitching about the fact that Adobe did not put it in (we all forget something eventually) i'd recommend you to write a class that has that border style thingy in it and then share it with us so we can all use that skin. Greetz Erik -- Teoti Graphix http://www.teotigraphix.com http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com http://www.flex2components.com You can find more by solving the problem then by 'asking the question'. -- Teoti Graphix http://www.teotigraphix.com http://www.teotigraphix.com Blog - Flex2Components
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
Yes, that's an oversight... our components shouldn't be hard-coding RGB colors. I've asked for it to be logged in our bugbase. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Thursday, November 30, 2006 12:49 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Styling in Flex is officially ridiculous Annoying I can see, and so I apologize for that. My title was definitely borne out of significant frustration and should have been more factual. I also agree that most of Flex's CSS implementation is pretty cool. Gordon, in the spirit of making pain points known, here is one that looks like it was simply an oversight: http://tech.groups.yahoo.com/group/flexcoders/message/56469 http://tech.groups.yahoo.com/group/flexcoders/message/56469 Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Gordon Smith [EMAIL PROTECTED] wrote: The only thing that annoyed me about Ben's complaint was the hyperbole of his subject line, Styling in Flex is officially ridiculous. (My own not-so-humble opinion is that Flex's use of CSS styles is pretty cool.) I agree with him that it would be nice if ButtonSkin were more styleable. More importantly, we need to hear about the cases where developers think Flex makes something too difficult, because he's right that it's the only way to get mass adoption. That doesn't mean our team will address every one of them, due to competing priorities and judgments about how many other developers are likely to have the same complaint. (I'm not aware of many requests for borderless buttons before Ben's.) But if we don't know about your pain points, we aren't likely to make them go away. - Gordon From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of ben.clinkinbeard Sent: Thursday, November 30, 2006 6:29 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Styling in Flex is officially ridiculous I must say, I really don't understand how I am being offensive. If you took issue with my hypothetical new developer conversation, well, you shouldn't. I was merely trying to point out that your solution is a complex one, and requiring these types of workarounds does not encourage the very important drive towards Flex adoption by new developers. I was also very clear to state that I have immense respect for Adobe, and did not call them 'teh suck' or anything similar. I am trying to draw attention to something that I feel needs to be addressed in order to improve the Flex framework. I think EECOLOR summed up my thoughts pretty well by pointing out that lots of other things are done with getStyle() and it sure would have been nice to make border one of those things. Roger, thanks for the XP theme link, I had not seen that before. Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Michael Schmalle teoti.graphix@ wrote: EDIT :: In a way, the Button does have a borderStyle, it's the button's name property. supposed to be In a way, the ButtonSkin class does have a borderStyle, it's the button skin's name property assigned in the Button class. Peace, Mike On 11/30/06, Michael Schmalle teoti.graphix@ wrote: the border style In a way, the Button does have a borderStyle, it's the button's name property. Back in Flash, they used borderStyle in the Button but, in Flex2 to they changed it to switch on the buttons name. Anyway, I will write a skin class and put it on my blog. That will be my contribution to the 'new' devs that I 'wasn't' talking to. :) PS, I have heard plenty of people bitch about the HaloBorders class to but, hey unfortunately beginners in ALL of life do not have access to those things experience gives. Peace, Mike On 11/30/06, EECOLOR eecolor@ wrote: I have to agree with the dude, that its tough to say something like that to a new person at flex. However, i was thinking the other comments were correct, and that if you wanted the the button to look something else, you'd have to use another skin. However, is you want to change the border from color, you change the 'borderColor' style, if you want to change the fill colors, you change 'fillColors'. At the top of updateDisplayList within the ButtonSkin class you see this code: // User-defined styles. var borderColor:uint = getStyle(borderColor); var cornerRadius:Number = getStyle(cornerRadius); var fillAlphas:Array = getStyle(fillAlphas); var fillColors:Array = getStyle(fillColors); StyleManager.getColorNames(fillColors); var highlightAlphas:Array
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
[flexcoders] Re: Styling in Flex is officially ridiculous
mx:Label id=linkTxt htmlText=font color=#FFa href='http://mysite.com'goto mysite/a/font mouseOver=hover() / function hover():void{ linkTxt.htmlText = String(linkTxt.htmlText).replace('FF','00FF00'); } you get the idea --- In flexcoders@yahoogroups.com, Ethan Miller [EMAIL PROTECTED] wrote: While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
Effective for color, but how about text-decoration, border, etc.? It would be really nice to keep this in the CSS domain. cheers, ethan mx:Label id=linkTxt htmlText=font color=#FFa href='http://mysite.com'goto mysite/a/font mouseOver=hover () / function hover():void{ linkTxt.htmlText = String(linkTxt.htmlText).replace ('FF','00FF00'); } you get the idea --- In flexcoders@yahoogroups.com, Ethan Miller [EMAIL PROTECTED] wrote: While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
Hi, For specific issues like this, please do file a bug or enhancement request! -David From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ethan Miller Sent: Thursday, November 30, 2006 5:40 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Styling in Flex is officially ridiculous Effective for color, but how about text-decoration, border, etc.? It would be really nice to keep this in the CSS domain. cheers, ethan mx:Label id=linkTxt htmlText=font color=#FFa href='http://mysite.com http://mysite.com 'goto mysite/a/font mouseOver=hover () / function hover():void{ linkTxt.htmlText = String(linkTxt.htmlText).replace ('FF','00FF00'); } you get the idea --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Ethan Miller [EMAIL PROTECTED] wrote: While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
RE: [flexcoders] Re: Styling in Flex is officially ridiculous
Keeping on par with the current suggestions, extending a base class (probably either Text or Label) and add these styleable properties to it. This isn't that hard to do, but it does add complexity by moving things out of the framework, but as long as we keep submitting enhancement requests for the things we feel we shouldn't have to extend, then it will get better :-) Here is some code that I hope will help you get started( P.S. I chose to override Text because I didn't like the background the LinkButton put around the its label, but you could probably use this code to extend a Label or LinkButton. At least it will show you how to accomplish some custom stuff). package com { import mx.controls.Text; import flash.events.Event; import flash.events.MouseEvent; [Style(name=mouseOverColor, type=uint, format=Color, inherit=no)] public class ClassicLinkButton extends Text{ public var useMouseOverStyles : Boolean = true; override protected function initializationComplete():void { super.initializationComplete(); addEventListener( MouseEvent.MOUSE_OVER, underline ); addEventListener( MouseEvent.MOUSE_OUT, underline ); } override protected function commitProperties():void { super.commitProperties(); mouseChildren = false; buttonMode = true; } private function underline( event : Event ) : void { if (!useMouseOverStyles) return; if (getStyle( textDecoration ) == underline) { //event.currentTarget.setStyle( textDecoration, none ); //In my use case, I didn't need to default back to the original styles, but you can modify the code to do that... clearStyle(textDecoration); clearStyle(color); } else { setStyle( textDecoration, underline ); if (getStyle(mouseOverColor)) setStyle(color,getStyle(mouseOverColor)); } } } } Dustin Mercer From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ethan Miller Sent: Thursday, November 30, 2006 2:40 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Styling in Flex is officially ridiculous Effective for color, but how about text-decoration, border, etc.? It would be really nice to keep this in the CSS domain. cheers, ethan mx:Label id=linkTxt htmlText=font color=#FFa href='http://mysite.com http://mysite.com 'goto mysite/a/font mouseOver=hover () / function hover():void{ linkTxt.htmlText = String(linkTxt.htmlText).replace ('FF','00FF00'); } you get the idea --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Ethan Miller [EMAIL PROTECTED] wrote: While in general I've been fairly happy with my ability to style flex, one area in which really lacking (and unfortunately for me in a key place for my application) is in styling text, especially text contained in an htmlText element. Despite reading the docs 5 times now, I remain unable to style a simple anchor tag (A HREF=. A as a type selector doesn't work, but neither do a:link, a:hover, or a:active which the docs say should work. Why the A tag doesn't simply support styleName as an attribute (or class= or style=) is a complete mind bender to me. Why htmlText doesn't support span styleName= is equally puzzling. Also, is it just me or are many of the css property names different, eg font-family vs fontFamily, etc. And what about shorthand syntax, eg border: 1x dotted black. I realize and accept as necessary and good the need to support a limited set of HTML tags but don't understand why standard and rigorous text styling is so out of reach. This in fact would be one of my top wish list items for future releases. Meantime, if anyone has any tips on styling text now, I'm all ears =) cheers, ethan
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
Here's a good question, with styling in mind.in flex 1.5, you had access directly to the movieclips that made a component. Aka I could do something like this: mx:ComboBox mx:Script function draw():Void { super.draw(); border_mc.borderStyle = none; border_mc.setStyle(borderStyle,none); text_mc.border_mc.borderStyle = none; text_mc.border_mc.setStyle(borderStyle,none); downArrow_mc.draw(); border_mc.draw(); text_mc.border_mc.draw(); } /mx:Script /mx:ComboBox Why I had to set it twice is beyond me, it wouldn't work without it but anywaysthe only way I figured out about these movieclips that made the components and their names was via asking Adobe Support (this was Flex 1.5though, remember). Nowadays in Flex2, you have access to the sourcebut what I'm curious about, is it good practice to be going for these movieclips for styling, or is it even possible in flex2? (haven't tried honestly) For his button dilema, you could technically do what I did with border_mc.if it works still. -Jon
[flexcoders] Re: Styling in Flex is officially ridiculous
Yes, I meant the button's border. The default button is a gradient background with a border around it. I just wanted a gradient. No border. What I ended up doing was to create a PNG that had a gradient using the colors I wanted, created a Button subclass (in MXML) called GreenButton, set styleName to greenButton, and then defined greenButton inside a Style tag. In the greenButton style I set the upSkin property to use my PNG and provided 9-slice values and also set the text color. This approach allows me to reuse GreenButton and set the label and width (among other things) inline. The drawbacks, however, are that I will need to create separate images for downSkin, disabledSkin, etc. for each and every custom button I need, like RedButton, etc. So all in all it is a fairly simple and tolerable workaround, it just peeves me that I can't say borderStyle: none. In my opinion, if a component has a border you should be able to turn it off. Its just an if statement. Ben --- In flexcoders@yahoogroups.com, Andrew Trice [EMAIL PROTECTED] wrote: That's how I interpreted it: that he is actually talking about the button's border. Ben, is that what you were talking about? If so, the skin method is the way to go. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: [EMAIL PROTECTED] Office: 866-CYNERGY From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:50 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Oh yeah... If he is talking about the actual button border, that is the skin and he needs to create a new skin. The button does not have borders, it has skins. It dosn't even share the same characteristics of a Container that has a border. These are not the same things. So, Ben, what do you mean when you say the Button's border? Or, what do you want... Peace, Mike On 11/29/06, Michael Schmalle [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Andy, It answers his question and it does work. If the label is present, you click on the label and the Button functions correctly. I don't know what he is aiming for here but, if you 'don't' have a border, there is no other hit area specified for the component. So, how are you going to get mouse events from a component that dosn't have a hit area? Bottom line is, this approach does work if you plan to use a label, other than this, why would you want a button without a label and border if you want to click on it? Peace, Mike On 11/29/06, Andrew Trice [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm not sure that approach really works... The buttons don't show up at all. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice http://www.cynergysystems.com/blogs/page/andrewtrice Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Office: 866-CYNERGY From: [EMAIL PROTECTED] ups.com [mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ups.com http://ups.com ] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:05 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Well, Before your loose it... try myButton.setStyle(upSkin, null); OR Button { upSkin:ClassReference(null); } OR mx:Button upSkin={null}/ Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: OK. I am usually very hesitant to criticize Adobe because of the immense respect I have for their employees and the amazing technology they create. I have built my career around their products. That being said, the styling capabilities in Flex are downright silly. I have suffered silently through some small, yet extremely annoying nuances, but this one takes the cake: You can't style a Button to not have a border!!! Developer: Hey button, go ahead and skip your border drawing routine. Button: Eff that! I love my borders and I ain't getting rid of them for anyone! WTF. I can understand not supporting some styling features people would like, but not supporting one that is just turning something off? What gives? I realize I could probably subclass Button and override the drawing but that is uber-overkill for something that should be a simple attribute. If someone from Adobe can offer a valid reason for why this isn't supported I would love to hear it. I would also be very interested to know if styling is an area that is being
Re: [flexcoders] Re: Styling in Flex is officially ridiculous
Ben, This issue could only peeve you if it was actually an issue. The Button does not have a border. Thus, the border API does not apply to a Button. This is the reason they say upSkin, it's a skin. You could easily copy and paste the ButtonSkin class and put another style in the says borderEnabled. In the skin rendering method, call that style and put the drawing api section that contains the 'border' in an if statement. This way you just set ONE style and vola, no border! Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: Yes, I meant the button's border. The default button is a gradient background with a border around it. I just wanted a gradient. No border. What I ended up doing was to create a PNG that had a gradient using the colors I wanted, created a Button subclass (in MXML) called GreenButton, set styleName to greenButton, and then defined greenButton inside a Style tag. In the greenButton style I set the upSkin property to use my PNG and provided 9-slice values and also set the text color. This approach allows me to reuse GreenButton and set the label and width (among other things) inline. The drawbacks, however, are that I will need to create separate images for downSkin, disabledSkin, etc. for each and every custom button I need, like RedButton, etc. So all in all it is a fairly simple and tolerable workaround, it just peeves me that I can't say borderStyle: none. In my opinion, if a component has a border you should be able to turn it off. Its just an if statement. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Andrew Trice [EMAIL PROTECTED] wrote: That's how I interpreted it: that he is actually talking about the button's border. Ben, is that what you were talking about? If so, the skin method is the way to go. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: [EMAIL PROTECTED] Office: 866-CYNERGY From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:50 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Oh yeah... If he is talking about the actual button border, that is the skin and he needs to create a new skin. The button does not have borders, it has skins. It dosn't even share the same characteristics of a Container that has a border. These are not the same things. So, Ben, what do you mean when you say the Button's border? Or, what do you want... Peace, Mike On 11/29/06, Michael Schmalle [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Andy, It answers his question and it does work. If the label is present, you click on the label and the Button functions correctly. I don't know what he is aiming for here but, if you 'don't' have a border, there is no other hit area specified for the component. So, how are you going to get mouse events from a component that dosn't have a hit area? Bottom line is, this approach does work if you plan to use a label, other than this, why would you want a button without a label and border if you want to click on it? Peace, Mike On 11/29/06, Andrew Trice [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm not sure that approach really works... The buttons don't show up at all. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice http://www.cynergysystems.com/blogs/page/andrewtrice Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Office: 866-CYNERGY From: [EMAIL PROTECTED] ups.com [mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ups.com http://ups.com ] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:05 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Well, Before your loose it... try myButton.setStyle(upSkin, null); OR Button { upSkin:ClassReference(null); } OR mx:Button upSkin={null}/ Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: OK. I am usually very hesitant to criticize Adobe because of the immense respect I have for their employees and the amazing technology they create. I have built my career around their products. That being said, the styling capabilities in Flex are downright silly. I have suffered silently through some small, yet extremely annoying nuances, but this one takes the cake: You can't style a Button to not have a border!!! Developer: Hey
[flexcoders] Re: Styling in Flex is officially ridiculous
Michael, I have no desire to split semantic hairs with you. While Button may not utilize the border API, it most certainly does have a border. My frustration is in how that border is implemented. I assumed (wrongly, apparently) that that was clear from my two previous posts. Consider this. Developer new to Flex: How do I get rid of the border on my buttons? You: Oh its easy; just go find the several hundred lines long ButtonSkin class, copy it into a new class, go to the part that draws the border and add an if statement that checks for the custom borderEnabled style you'll be adding. See? Isn't Flex awesome? New dev: Ummm, yeah While your solution is plausible, its far from practical. Ben --- In flexcoders@yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: Ben, This issue could only peeve you if it was actually an issue. The Button does not have a border. Thus, the border API does not apply to a Button. This is the reason they say upSkin, it's a skin. You could easily copy and paste the ButtonSkin class and put another style in the says borderEnabled. In the skin rendering method, call that style and put the drawing api section that contains the 'border' in an if statement. This way you just set ONE style and vola, no border! Peace, Mike On 11/29/06, ben.clinkinbeard [EMAIL PROTECTED] wrote: Yes, I meant the button's border. The default button is a gradient background with a border around it. I just wanted a gradient. No border. What I ended up doing was to create a PNG that had a gradient using the colors I wanted, created a Button subclass (in MXML) called GreenButton, set styleName to greenButton, and then defined greenButton inside a Style tag. In the greenButton style I set the upSkin property to use my PNG and provided 9-slice values and also set the text color. This approach allows me to reuse GreenButton and set the label and width (among other things) inline. The drawbacks, however, are that I will need to create separate images for downSkin, disabledSkin, etc. for each and every custom button I need, like RedButton, etc. So all in all it is a fairly simple and tolerable workaround, it just peeves me that I can't say borderStyle: none. In my opinion, if a component has a border you should be able to turn it off. Its just an if statement. Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Andrew Trice andrew.trice@ wrote: That's how I interpreted it: that he is actually talking about the button's border. Ben, is that what you were talking about? If so, the skin method is the way to go. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: andrew.trice@ Office: 866-CYNERGY From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Michael Schmalle Sent: Wednesday, November 29, 2006 11:50 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: Re: [flexcoders] Styling in Flex is officially ridiculous Oh yeah... If he is talking about the actual button border, that is the skin and he needs to create a new skin. The button does not have borders, it has skins. It dosn't even share the same characteristics of a Container that has a border. These are not the same things. So, Ben, what do you mean when you say the Button's border? Or, what do you want... Peace, Mike On 11/29/06, Michael Schmalle teoti.graphix@ mailto:teoti.graphix@ wrote: Andy, It answers his question and it does work. If the label is present, you click on the label and the Button functions correctly. I don't know what he is aiming for here but, if you 'don't' have a border, there is no other hit area specified for the component. So, how are you going to get mouse events from a component that dosn't have a hit area? Bottom line is, this approach does work if you plan to use a label, other than this, why would you want a button without a label and border if you want to click on it? Peace, Mike On 11/29/06, Andrew Trice andrew.trice@ mailto:andrew.trice@ wrote: I'm not sure that approach really works... The buttons don't show up at all. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice http://www.cynergysystems.com/blogs/page/andrewtrice Email: andrew.trice@ mailto:andrew.trice@ Office: 866-CYNERGY