Re: [Flashcoders] CSS with input text
use textField.setNewTextFormat() 2006/3/20, Danny Kodicek [EMAIL PROTECTED]: I've got a textField I'm trying to use for input text and I'd like to be able to style it. Unfortunately, the htmlText is being automatically set to this: TEXTFORMAT LEADING=2P ALIGN=LEFTFONT FACE=Arial SIZE=12 COLOR=#00 LETTERSPACING=0 KERNING=0a/FONT/P/TEXTFORMAT This isn't much help, because the FONT tag is appearing inside the P tag, with the result that any styling Iattach to P is being overridden (at least, I assume this is the source of the problem). Any idea how I can avoid this? Really, my ideal would be for Flash not to keep 'helping' me by adding its own HTML or changing mine: I'd like to be able to tell it exactly what HTML I want displayed. This is particularly important because I need to be able to extract the HTML at the end and return it. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Is not possible at all. When flash parses a CSS styled html, it simply replaces all the tags with the corresponding formatting code (textformat, font, etc). Ugh, ugly. Thanks. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
I don't know if this will help you at all, but the TextField.Stylesheet class has a transform() method which will convert _one_ of your style objects from the Stylesheet (ie. The one you maybe assigned for the a or the p element or your_own_custom element) into a TextFormat object which you can then apply to your TextField with setNewTextFormat. Hmm - I'm not sure how this works (the transform() docs are possibly the most useless I've ever seen!). As far as I can make out, transform() is the internal function used by the StyleSheet object to translate it into textFormats. But I can't quite tell what happens next... Can you give me an example of what you mean in practice? Right now I'm fairly close to dropping styleSheets altogether. My current plan is to have a parser that translates the HTML into my own internal XML format, so that the textField is really a fairly dumb container, but really this is turning into such a nasty hack that I'm not terribly happy about it. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Danny Kodicek schrieb: I don't know if this will help you at all, but the TextField.Stylesheet class has a transform() method which will convert _one_ of your style objects from the Stylesheet (ie. The one you maybe assigned for the a or the p element or your_own_custom element) into a TextFormat object which you can then apply to your TextField with setNewTextFormat. If you look at the archives, you'll see that you're not alone. the textfield is one of the worst things i've ever seen. the thing that using css makes TFs uneditable is only the top :-) so let's start a petition against this class, as with coming 8.5 Player we have video alpha, up-and download reg-ex and what not (even a new VM!!!) but this little class is torpeding so much projects (speaking of backends, yeah!) i cant stand it anymore! so let's all stand up, and do sth. against this! we're loosing a market right now. micha ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] CSS with input text
You think you've got troubles: mostly I use Director... Seriously, though, I think text is one area where we should expect to see some serious improvements since the Adobe takeover. With all their pdf people on board, they must surely have a lot of expertise to throw at this (as long as they don't try to do something hideous like incorporating acrobat into Flash...). The absolute biggest thing I need right now is a version of what in Director is called 'charPosToLoc' (and the various permutations of it): the ability to translate back and forth between character positions and xy coordinates. And don't get me started about proper inline image support. Coming from the Director world you know there are basic issues with some of the more basic elements, such as HTML text, in Director. In the meantime bigger and badder items have been added to Director giving it more *WOW* while basic issues were not addressed. (And, no, Xtra is not a solution to what should be a basic implementation.) I'm saying this, because it makes me wonder if the same is happening (will happen) with Flash! ...Rob ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Coming from the Director world you know there are basic issues with some of the more basic elements, such as HTML text, in Director. In the meantime bigger and badder items have been added to Director giving it more *WOW* while basic issues were not addressed. (And, no, Xtra is not a solution to what should be a basic implementation.) Absolutely (although don't forget that many Xtras are actually part of the standard Director package: text support itself is wrapped in a standard Xtra). Having said that, Director hasn't had much in the way of significant improvements anywhere since D8.5 introduced 3D. We had Imaging Lingo (the equivalent of BitmapData) since D7, about 6 years ago, but it has hardly changed since then. Mostly, subsequent releases have been designed to bring us up to speed with current developments in Flash. I'm saying this, because it makes me wonder if the same is happening (will happen) with Flash! Already is. Many features of Flash have that sense of being half-done (XML object, Text support and Sound spring to mind fairly quickly) Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] CSS with input text
Absolutely (although don't forget that many Xtras are actually part of the standard Director package: text support itself is wrapped in a standard Xtra). That's true. I'll quality my original comment by added, Xtras not shipped with the IDE or part of an update to the IDE. In addition, my WOW comment was referring to the items more utilized as nifty little features that allow marketing to really spin on. DVD Video immediately pops to mind. That's not to say Director coders haven't put it to good use -- they have -- but it also caused a huge misconception that somehow Director could now be used as a DVD Video authoring tool (i.e., DVD Studio, Encore). Already is. Many features of Flash have that sense of being half-done (XML object, Text support and Sound spring to mind fairly quickly) And ain't that most baffling for a product that is ubiquitous to the web? ...Rob ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Wouldn't having full www support for html in Flash mean building in a browser. Not too likely I think. What about a component in Flash that allows the display of a web browser window in a flash document, using the browsers functionality. I wouldn't know where to start, but it would be cool. On 3/20/06, Danny Kodicek [EMAIL PROTECTED] wrote: Coming from the Director world you know there are basic issues with some of the more basic elements, such as HTML text, in Director. In the meantime bigger and badder items have been added to Director giving it more *WOW* while basic issues were not addressed. (And, no, Xtra is not a solution to what should be a basic implementation.) Absolutely (although don't forget that many Xtras are actually part of the standard Director package: text support itself is wrapped in a standard Xtra). Having said that, Director hasn't had much in the way of significant improvements anywhere since D8.5 introduced 3D. We had Imaging Lingo (the equivalent of BitmapData) since D7, about 6 years ago, but it has hardly changed since then. Mostly, subsequent releases have been designed to bring us up to speed with current developments in Flash. I'm saying this, because it makes me wonder if the same is happening (will happen) with Flash! Already is. Many features of Flash have that sense of being half-done (XML object, Text support and Sound spring to mind fairly quickly) Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Weldon Mac Donald ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Wouldn't having full www support for html in Flash mean building in a browser. Not too likely I think. Well, no, you wouldn't have to support javaScript and other languages or activeX controls / plugins. You could probably live without frames or similar devices. And hyperlinks would probably remain in their current form. We're just talking about display of text, including full support for CSS and IMG tags. It's not really *that* far from existing functionality. The hardest thing would probably be tables (and no, I don't think it would be appropriate to have some hack that converts them to dataGrids) What about a component in Flash that allows the display of a web browser window in a flash document, using the browsers functionality. I think people have tried that kind of thing, with limited success (eg, using JavaScript to open a browser window on top of the Flash window). No, it really does need to be a native solution. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Wouldn't having full www support for html in Flash mean building in a browser. Not too likely I think. What about a component in Flash that allows the display of a web browser window in a flash document, using the browsers functionality. I wouldn't know where to start, but it would be cool. There still is DENG: http://osflash.org/deng/ Definately not comparable to Firefox and the likes, but a start cheers, c. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] CSS with input text
Wouldn't having full www support for html in Flash mean building in a browser. Not too likely I think. I think many folks -- at leat myself -- just want consistent handling of HTML and CSS, not necessarily a full blown browser. This is especially true for building offline Mac/Win CD projects where Director is not used (for whatever reason), and HTML text is required. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
It seems like this thread has morphed into something else. But if you're looking to style an input text field with CSS, here's a working example... Note that this is only en example... some things that are hardcoded should not be... but it gets the point across. The getStyleSheet and getDefaultStyleSheet methods are only there so you don't have to load a stylesheet for the example to work. class SomeUsefulTextMethods { public static function getStyleSheet(css:Object):TextField.StyleSheet { var style:String = ; var styleSheet:TextField.StyleSheet = new TextField.StyleSheet(); style += .bold {font-family: + css.font + ;font-size: + css.size + ;font-weight: bold;color: + css.color + ;}; style += .plain {font-family: + css.font + ;font-size: + css.size + ;font-weight: normal;color: + css.color + ;}; style += .italic {font-family: + css.font + ;font-size: + css.size + ;font-style: italic;font-weight: normal;}; style += a:link {color: + css.hoverColor + ;text-decoration: none;}; style += a:hover {color: + css.hoverColor + ;text-decoration: underline;}; styleSheet.parseCSS(style); return styleSheet; } public static function getDefaultStyleSheet():TextField.StyleSheet { return getStyleSheet({font:Verdana, size:11, color:#00, hoverColor:#FF}); } public static function getInputField(scope:MovieClip, name:String, x:Number, y:Number, w:Number, h:Number):TextField { var field:TextField = scope.createTextField(name, scope.getNextHighestDepth(), x, y, w, h); field.type = input; field.border = true; var myStyleSheet:TextField.StyleSheet = getDefaultStyleSheet(); var styleObj:Object = myStyleSheet.getStyle(.bold); var styleFormat:TextFormat = myStyleSheet.transform(styleObj); field.setTextFormat(styleFormat); field.setNewTextFormat(styleFormat); return field; } } /** * in fla... * var field:TextField = SomeUsefulTextMethods.getInputField(this, myField, 100, 100, 100, 100); */ Jim Kremens ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Take a look at FlashTextArea at osflash. I already did all that work. On Mon, 20 Mar 2006 09:10:46 -0300, Danny Kodicek [EMAIL PROTECTED] wrote: I don't know if this will help you at all, but the TextField.Stylesheet class has a transform() method which will convert _one_ of your style objects from the Stylesheet (ie. The one you maybe assigned for the a or the p element or your_own_custom element) into a TextFormat object which you can then apply to your TextField with setNewTextFormat. Hmm - I'm not sure how this works (the transform() docs are possibly the most useless I've ever seen!). As far as I can make out, transform() is the internal function used by the StyleSheet object to translate it into textFormats. But I can't quite tell what happens next... Can you give me an example of what you mean in practice? Right now I'm fairly close to dropping styleSheets altogether. My current plan is to have a parser that translates the HTML into my own internal XML format, so that the textField is really a fairly dumb container, but really this is turning into such a nasty hack that I'm not terribly happy about it. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- _ Marcelo Volmaro ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
Take a look at FlashTextArea at osflash. I already did all that work. Ooh, I was looking for a while at text editors, but I missed that one. Got a demo up somewhere? (incidentally, I got mine working pretty well, so I'll probably not need it, but if it's more reliable, I might switch) Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CSS with input text
On the SVN, under deploy... i donĀ“t have it currently online... On Mon, 20 Mar 2006 17:34:56 -0300, Danny Kodicek [EMAIL PROTECTED] wrote: Take a look at FlashTextArea at osflash. I already did all that work. Ooh, I was looking for a while at text editors, but I missed that one. Got a demo up somewhere? (incidentally, I got mine working pretty well, so I'll probably not need it, but if it's more reliable, I might switch) Danny -- _ Marcelo Volmaro ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com