Re: [Flashcoders] embeded CSS issue

2006-02-10 Thread grant
Thanks Gregory,

The code in the email was a quick example, I really do allocate objects before 
I use them :)

It appears you are right that the only reliable way is with parse css function 
as the built in stuff in 8 really doesn't seem to work at all.

Thanks
Grant

- Original Message -
From: GregoryN [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: 2/10/06 7:50 AM
Subject: Re: [Flashcoders] embeded CSS issue

> Grant,
> 
> While I can't open you sample (I'm still with FMX2004), there's some
> obvious mistakes in the code:
> 1) You need to sreate new TextField.StyleSheet object before using it.
> 2) Too many zeros in color ( boldlite.color = "#ff00";)
> 3) If "testText" is textfield, it doesn't have ".font" property - you
> have to define font face in CSS or use TextFormat instead.
> 4) Strange, but your P with class doesn't work (while it should). I'd
> use  tag instead.
> 
> BTW, I prefer to write CSS as string and then use .parseCSS . This
> approach have some advantages. For example, you can define several
> alternative fonts (font-familiy: Futura Medium, _sans) .
> 
> Corrected code:
> ===
> // ADDED
> var testSheet:TextField.StyleSheet = new TextField.StyleSheet();
> 
> var boldlite:Object = new Object();
> boldlite.color = "#ff";
> boldlite.fontWeight = "bold";
> boldlite.fontFamily = "Futura Medium";
> 
> testSheet.setStyle("boldlite", boldlite);
> 
> testText.styleSheet = testSheet;
> testText.embedFonts=true;
> // make sure you embedded font somewhere
> testText.wordWrap=true;
> testText.htmlText="using class*this should be bold and red*";
> ===
> 
> Corrected files:
> http://gousable.com/flash/temp/embedcss_fixed.zip
>   
> 
> -- 
> Best regards,
>  GregoryN
> 
> http://GOusable.com
> Flash components development.
> Usability services.
> 
> > - Grant wrote:
> > I'm using an embedded CSS file where I define the styles through code 
> > 
> > var boldlite:Object = new Object();
> > boldlite.color = "#ff00";
> > boldlite.fontWeight = "bold";
> > 
> > testSheet.setStyle("boldlite", boldlite);
> > 
> > and then I assign it to an html text field.
> > 
> > testText.styleSheet = testSheet;
> > testText.embedFonts=true;
> > testText.wordWrap=true;
> > testText.font = "Futura Medium";
> > testText.htmlText="using class*this should be bold and red* ";
> > 
> > 
> > No matter what I do I can't get it to render any color or weight changes.
> > 
> > I have uploaded the fla if anyone has a chance to look, its just a TEST 
> > right now.
> > 
> > http://www.bluetube.com/temp/embedcss.zip
> > 
> > Grant.  
> > 
> > 
> > --
> 
> 
> ___
> 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


[Flashcoders] embeded CSS issue

2006-02-09 Thread grant
I'm using an embedded CSS file where I define the styles through code 

var boldlite:Object = new Object();
boldlite.color = "#ff00";
boldlite.fontWeight = "bold";


testSheet.setStyle("boldlite", boldlite);


and then I assign it to an html text field.

testText.styleSheet = testSheet;
testText.embedFonts=true;
testText.wordWrap=true;
testText.font = "Futura Medium";
testText.htmlText="using class*this should be bold and red*

";


No matter what I do I can't get it to render any color or weight changes.

I have uploaded the fla if anyone has a chance to look, its just a TEST right 
now.

http://www.bluetube.com/temp/embedcss.zip

Grant.  
___
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