RE: [Flashcoders] [flash textfield] lose formatting
Hi Romu, I have noticed your site before. VERY NICE!!! Thank you. Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Romuald Quantin Sent: vrijdag 16 januari 2009 17:37 To: Flash Coders List Subject: Re: [Flashcoders] [flash textfield] lose formatting I have already posted that here but, I think this (a single class that is extending TextField) can help you as it is a kind of things Ive already done (and I was bored to struggle with textfield, textformat, style, etc). I've extracted a text tool from my framework: SomaText. It allows you to easily create TextField and apply styles from a stylesheet, you can set a lot TextField and TextFormat properties straight from the stylesheet if you wish. It is a single class that is extending the TextField built-in one, very easy to use. Quick intro: http://www.soundstep.com/blog/2009/01/07/somatext-standalone/ Source: http://www.soundstep.com/blog/downloads/somatext/ List of properties you can use in the stylesheet: http://www.soundstep.com/somaprotest/www/#/stylesheet/css-properties/ And for the curious, SomaText is part of Soma (MVC Framework): http://www.soundstep.com/somaprotest/ Hope it helps. Romu www.soundstep.com Cor wrote: OK, here are some options: HTH Cor /* Create in library: New Font My embedded fonts have Linkage classes of FFFInterface, LasVegasD and Wdings. Both of these seemed to work for me. Fonts should be on the develop PC */ //TextFormat example var fmt1:TextFormat = new TextFormat(); fmt1.font = new FFFInterface().fontName; fmt1.size = 18; var fmt2:TextFormat = new TextFormat(); fmt2.font = new LasVegasD().fontName; fmt2.size = 18; var txt:TextField = new TextField(); txt.width = 400; txt.embedFonts = true; txt.text=ActionScript; //set textformat from beginIndex to EndIndex txt.setTextFormat(fmt1,0,6); txt.setTextFormat(fmt2,6,12); txt.y = 10; addChild(txt); //CSS Example var style:StyleSheet = new StyleSheet(); var heading:Object = new Object(); heading.fontFamily = new Wdings().fontName; heading.fontSize=24; heading.fontWeight=bold; heading.fontStyle=italic; heading.color=#FF; var body:Object = new Object(); body.fontFamily = new LasVegasD().fontName; body.fontSize=24; body.fontWeight=bold; body.fontStyle=italic; body.color=#FF; style.setStyle(.heading, heading); style.setStyle(body, body); var label:TextField = new TextField(); label.width = 400; label.embedFonts = true; label.styleSheet=style; label.htmlText=bodyspan class='heading'Hello/span World.../body; label.y = 80; addChild(label); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1898 - Release Date: 16-1-2009 15:09 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] [flash textfield] lose formatting
Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] [flash textfield] lose formatting
With dynamic fields you NEED to embed the fonts or set it through a class, a CSS or TextFormat. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 13:06 To: Flash Coders List Subject: [Flashcoders] [flash textfield] lose formatting Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] [flash textfield] lose formatting
the fonts are embedded. The problem actually isn't the font appears, because it's. The problem is, seems after I changed the text of an existing textfield, it formatting is gone. Tks F On Fri, Jan 16, 2009 at 12:51 PM, Cor c...@chello.nl wrote: With dynamic fields you NEED to embed the fonts or set it through a class, a CSS or TextFormat. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 13:06 To: Flash Coders List Subject: [Flashcoders] [flash textfield] lose formatting Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] [flash textfield] lose formatting
Hi, You can do this each time you add text with AS: //Get the text format before you change the text. var tf:TextFormat = myTextField.getTextFormat(); myTextField.html = newText; myTextField.setTextFormat(tf); Glen Fabio Pinatti wrote: the fonts are embedded. The problem actually isn't the font appears, because it's. The problem is, seems after I changed the text of an existing textfield, it formatting is gone. Tks F On Fri, Jan 16, 2009 at 12:51 PM, Cor c...@chello.nl wrote: With dynamic fields you NEED to embed the fonts or set it through a class, a CSS or TextFormat. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 13:06 To: Flash Coders List Subject: [Flashcoders] [flash textfield] lose formatting Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] [flash textfield] lose formatting
Hello Glen, hey, that's it! I didn't know that it was required to do, with simple textfields created in authortime. Flash could not lost the formatting unless we specify, don't you think? =) Thanks so much for you, my question is clear now! Fabio On Fri, Jan 16, 2009 at 1:47 PM, Glen Pike g...@engineeredarts.co.ukwrote: Hi, You can do this each time you add text with AS: //Get the text format before you change the text. var tf:TextFormat = myTextField.getTextFormat(); myTextField.html = newText; myTextField.setTextFormat(tf); Glen Fabio Pinatti wrote: the fonts are embedded. The problem actually isn't the font appears, because it's. The problem is, seems after I changed the text of an existing textfield, it formatting is gone. Tks F On Fri, Jan 16, 2009 at 12:51 PM, Cor c...@chello.nl wrote: With dynamic fields you NEED to embed the fonts or set it through a class, a CSS or TextFormat. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 13:06 To: Flash Coders List Subject: [Flashcoders] [flash textfield] lose formatting Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] [flash textfield] lose formatting
OK, here are some options: HTH Cor /* Create in library: New Font My embedded fonts have Linkage classes of FFFInterface, LasVegasD and Wdings. Both of these seemed to work for me. Fonts should be on the develop PC */ //TextFormat example var fmt1:TextFormat = new TextFormat(); fmt1.font = new FFFInterface().fontName; fmt1.size = 18; var fmt2:TextFormat = new TextFormat(); fmt2.font = new LasVegasD().fontName; fmt2.size = 18; var txt:TextField = new TextField(); txt.width = 400; txt.embedFonts = true; txt.text=ActionScript; //set textformat from beginIndex to EndIndex txt.setTextFormat(fmt1,0,6); txt.setTextFormat(fmt2,6,12); txt.y = 10; addChild(txt); //CSS Example var style:StyleSheet = new StyleSheet(); var heading:Object = new Object(); heading.fontFamily = new Wdings().fontName; heading.fontSize=24; heading.fontWeight=bold; heading.fontStyle=italic; heading.color=#FF; var body:Object = new Object(); body.fontFamily = new LasVegasD().fontName; body.fontSize=24; body.fontWeight=bold; body.fontStyle=italic; body.color=#FF; style.setStyle(.heading, heading); style.setStyle(body, body); var label:TextField = new TextField(); label.width = 400; label.embedFonts = true; label.styleSheet=style; label.htmlText=bodyspan class='heading'Hello/span World.../body; label.y = 80; addChild(label); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] [flash textfield] lose formatting
or you can set the defaultTextFormat property and be done with it. On Fri, Jan 16, 2009 at 10:58 AM, Fabio Pinatti fpina...@gmail.com wrote: Hello Glen, hey, that's it! I didn't know that it was required to do, with simple textfields created in authortime. Flash could not lost the formatting unless we specify, don't you think? =) Thanks so much for you, my question is clear now! Fabio On Fri, Jan 16, 2009 at 1:47 PM, Glen Pike g...@engineeredarts.co.uk wrote: Hi, You can do this each time you add text with AS: //Get the text format before you change the text. var tf:TextFormat = myTextField.getTextFormat(); myTextField.html = newText; myTextField.setTextFormat(tf); Glen Fabio Pinatti wrote: the fonts are embedded. The problem actually isn't the font appears, because it's. The problem is, seems after I changed the text of an existing textfield, it formatting is gone. Tks F On Fri, Jan 16, 2009 at 12:51 PM, Cor c...@chello.nl wrote: With dynamic fields you NEED to embed the fonts or set it through a class, a CSS or TextFormat. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 13:06 To: Flash Coders List Subject: [Flashcoders] [flash textfield] lose formatting Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel Stransky stranskydesign.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] [flash textfield] lose formatting
If you have to do it each time, it is time to create a class to do it for you. HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 16:58 To: Flash Coders List Subject: Re: [Flashcoders] [flash textfield] lose formatting Hello Glen, hey, that's it! I didn't know that it was required to do, with simple textfields created in authortime. Flash could not lost the formatting unless we specify, don't you think? =) Thanks so much for you, my question is clear now! Fabio On Fri, Jan 16, 2009 at 1:47 PM, Glen Pike g...@engineeredarts.co.ukwrote: Hi, You can do this each time you add text with AS: //Get the text format before you change the text. var tf:TextFormat = myTextField.getTextFormat(); myTextField.html = newText; myTextField.setTextFormat(tf); Glen Fabio Pinatti wrote: the fonts are embedded. The problem actually isn't the font appears, because it's. The problem is, seems after I changed the text of an existing textfield, it formatting is gone. Tks F On Fri, Jan 16, 2009 at 12:51 PM, Cor c...@chello.nl wrote: With dynamic fields you NEED to embed the fonts or set it through a class, a CSS or TextFormat. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Fabio Pinatti Sent: vrijdag 16 januari 2009 13:06 To: Flash Coders List Subject: [Flashcoders] [flash textfield] lose formatting Hello guru list, A basic question. A designer setup a fla file, with a lot of textfields. He'd adjusted font size, spacing, leading, etc. When I'll use his fla, I have to convert all static fields into dynamic fields, and all looks good. The question and problem is, when I compile and set a text for those dynamic textfields, the textfield loses all formatting it had, so, I need to rewrite via TextFormat. Am I doing something wrong, or isn't possible use timeline text formatting in runtime? Thanks so much, -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1897 - Release Date: 16-1-2009 6:52 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] [flash textfield] lose formatting
I have already posted that here but, I think this (a single class that is extending TextField) can help you as it is a kind of things Ive already done (and I was bored to struggle with textfield, textformat, style, etc). I've extracted a text tool from my framework: SomaText. It allows you to easily create TextField and apply styles from a stylesheet, you can set a lot TextField and TextFormat properties straight from the stylesheet if you wish. It is a single class that is extending the TextField built-in one, very easy to use. Quick intro: http://www.soundstep.com/blog/2009/01/07/somatext-standalone/ Source: http://www.soundstep.com/blog/downloads/somatext/ List of properties you can use in the stylesheet: http://www.soundstep.com/somaprotest/www/#/stylesheet/css-properties/ And for the curious, SomaText is part of Soma (MVC Framework): http://www.soundstep.com/somaprotest/ Hope it helps. Romu www.soundstep.com Cor wrote: OK, here are some options: HTH Cor /* Create in library: New Font My embedded fonts have Linkage classes of FFFInterface, LasVegasD and Wdings. Both of these seemed to work for me. Fonts should be on the develop PC */ //TextFormat example var fmt1:TextFormat = new TextFormat(); fmt1.font = new FFFInterface().fontName; fmt1.size = 18; var fmt2:TextFormat = new TextFormat(); fmt2.font = new LasVegasD().fontName; fmt2.size = 18; var txt:TextField = new TextField(); txt.width = 400; txt.embedFonts = true; txt.text=ActionScript; //set textformat from beginIndex to EndIndex txt.setTextFormat(fmt1,0,6); txt.setTextFormat(fmt2,6,12); txt.y = 10; addChild(txt); //CSS Example var style:StyleSheet = new StyleSheet(); var heading:Object = new Object(); heading.fontFamily = new Wdings().fontName; heading.fontSize=24; heading.fontWeight=bold; heading.fontStyle=italic; heading.color=#FF; var body:Object = new Object(); body.fontFamily = new LasVegasD().fontName; body.fontSize=24; body.fontWeight=bold; body.fontStyle=italic; body.color=#FF; style.setStyle(.heading, heading); style.setStyle(body, body); var label:TextField = new TextField(); label.width = 400; label.embedFonts = true; label.styleSheet=style; label.htmlText=bodyspan class='heading'Hello/span World.../body; label.y = 80; addChild(label); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders