Re: [flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-17 Thread Jean-Luc ESSER





I didn't tried it, but from help, this should work 
:
 
package {    import 
flash.display.Sprite;    import 
flash.text.StyleSheet;    import 
flash.text.TextField;    import 
flash.text.TextFieldAutoSize;    public class 
StyleSheetExample extends Sprite 
{    public function 
StyleSheetExample() 
{    var 
style:StyleSheet = new 
StyleSheet();    
var heading:Object = new 
Object();    
heading.fontWeight = 
"bold";    
heading.color = 
"#FF";    
var body:Object = new 
Object();    
body.fontStyle = 
"italic";    
style.setStyle(".heading", 
heading);    
style.setStyle("body", 
body);    
var label:TextField = new 
TextField();    
label.styleSheet = 
style;    
label.htmlText = "Hello 
World...";    
addChild(label);    
}    }}
 
**
 
Of course this is not what you want, as it does not 
use an external CSS.
Now, i guess that using the parseCSS Method could 
get you where you want to go. Not sure though... :s
 
This is not dynamically loading CSS at runtime 
which is not possible as we speak, as Tom said.
 
Share your findings on this.
 
Best,
JL
 
--
Lancement de la communauté francophone sur Flex 
:
http://www.flexeurs.org > rejoignez-nous 
!
 
 

  - Original Message - 
  From: 
  olivierdejonge 
  To: flexcoders@yahoogroups.com 
  Sent: Monday, July 17, 2006 2:02 PM
  Subject: [flexcoders] Loading external 
  css and setting a:hover style for htmlText
  
  
  How do I connect an external stylesheet to a textfield so the 
  htmlTextgets the right styles?In Flex 1.5 that was 
  easy:var styles:TextField.StyleSheet = new 
  TextField.StyleSheet();styles.load('myStyles.css');...function 
  onLoad(ok){if(ok){myText.htmlText = "hello world</a>myText.styleSheet = 
  styles}}But how to do this in Flex 2.0, when function 'load()' 
  doesn't existanymore and parseCSS not realy seems tow work with a:hover 
  style etc?In the 2.0 example I have an 
  Application...8"?>http://www.adobe.com/2006/mxml"xmlns:myText="*" 
  layout="absolute">ample 
  />...that loads an external stylesheet 
  main.css,...body {fontFamily : "ThesisBolPla";leading : 
  "-3";}.heading {fontWeight :"bold";color: "#FF3300";}a 
  {color:#f0037f;}a:link{color:#f0037f;text-decoration:underline;}a:hover{color:#f0037f;}a:active{color:#cc;}...and 
  creates the an instance of TextFieldExample:package {import 
  mx.core.UIComponent;import flash.text.TextField;public 
  class TextFieldExample extends UIComponent {private var 
  label:TextField;private var labelText:String = 
  "class='heading'>Hello 
  worldandwelcome to the show. 
  ";public function TextFieldExample() 
  {configureLabel();setLabel(labelText);}public 
  function setLabel(str:String):void {label.htmlText = 
  str;}private function configureLabel():void {label = 
  new TextField();label.width = 200;label.embedFonts = 
  true;label.background = "">label.multiline = 
  true;label.styleSheet = HOW TO CONNECT TO THE 
  CSS?;addChild(label);}}}How do I connect the 
  external stylesheet to the textfield so thehtmlText gets the right 
  style?
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   



  




  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



Re: [flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-17 Thread JesterXL
He meants the Flash Player 6' ability to load StyleSheets into TextFields, 
not Flex' CSS.  I know it's confusing sounding, but they are two different 
things.

- Original Message - 
From: "Tom Chiverton" <[EMAIL PROTECTED]>
To: 
Sent: Monday, July 17, 2006 8:47 AM
Subject: Re: [flexcoders] Loading external css and setting a:hover style for 
htmlText


On Monday 17 July 2006 13:02, olivierdejonge wrote:
> How do I connect an external stylesheet to a textfield so the htmlText
> gets the right styles?
.
> But how to do this in Flex 2.0, when function 'load()' doesn't exist

You can't apply styles at runtime in Flex 2 using a stylesheet (yet - there
are people working on it), IIRC.

-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
St James's Court Brown Street Manchester M2 2JF.  A list of members is 
available for inspection at the registered office. Any reference to a 
partner in relation to Halliwells LLP means a member of Halliwells LLP. 
Regulated by the Law Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may 
be confidential or legally privileged.  If you are not the addressee you 
must not read it and must not use any information contained in nor copy it 
nor inform any person other than Halliwells LLP or the addressee of its 
existence or contents.  If you have received this email in error please 
delete it and notify Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-17 Thread Tom Chiverton
On Monday 17 July 2006 13:02, olivierdejonge wrote:
> How do I connect an external stylesheet to a textfield so the htmlText
> gets the right styles?
.
> But how to do this in Flex 2.0, when function 'load()' doesn't exist

You can't apply styles at runtime in Flex 2 using a stylesheet (yet - there 
are people working on it), IIRC.

-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-17 Thread olivierdejonge
How do I connect an external stylesheet to a textfield so the htmlText
gets the right styles?

In Flex 1.5 that was easy:

var styles:TextField.StyleSheet = new TextField.StyleSheet();
styles.load('myStyles.css');
...
function onLoad(ok){
if(ok){
myText.htmlText = "hello world
myText.styleSheet = styles
}
}


But how to do this in Flex 2.0, when function 'load()' doesn't exist
anymore and parseCSS not realy seems tow work with a:hover style etc?

In the 2.0 example I have an Application...


http://www.adobe.com/2006/mxml";
xmlns:myText="*" layout="absolute">




...that loads an external stylesheet main.css,...

body {
fontFamily : "ThesisBolPla";
leading : "-3";
}
.heading {
fontWeight :"bold";
color: "#FF3300";
}
a {
color:#f0037f;
}
a:link{
color:#f0037f;
text-decoration:underline;
}
a:hover{
color:#f0037f;
}
a:active{
color:#cc;
}


...and creates the an instance of TextFieldExample:


package {
import mx.core.UIComponent;
import flash.text.TextField;


public class TextFieldExample extends UIComponent {


private var label:TextField;
private var labelText:String = "Hello worldand
welcome to the show. ";

public function TextFieldExample() {
configureLabel();
setLabel(labelText);
}

public function setLabel(str:String):void {

label.htmlText = str;
}

private function configureLabel():void {

label = new TextField();
label.width = 200;
label.embedFonts = true;
label.background = true;
label.multiline = true;
label.styleSheet = HOW TO CONNECT TO THE CSS?;

addChild(label);
}
}
}

How do I connect the external stylesheet to the textfield so the
htmlText gets the right style?





 Yahoo! Groups Sponsor ~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-17 Thread olivierdejonge


How do I connect an external stylesheet to a textfield so the htmlText
gets the right styles?

In Flex 1.5 that was easy:

var styles:TextField.StyleSheet = new TextField.StyleSheet();
styles.load('myStyles.css');
...
function onLoad(ok){
if(ok){
myText.htmlText = "hello world
myText.styleSheet = styles
}
}


But how to do this in Flex 2.0, when function 'load()' doesn't exist
anymore and parseCSS not realy seems tow work with a:hover style etc?

In the 2.0 example I have an Application...


http://www.adobe.com/2006/mxml";
xmlns:myText="*" layout="absolute">




...that loads an external stylesheet main.css,...

body {
fontFamily : "ThesisBolPla";
leading : "-3";
}
.heading {
fontWeight :"bold";
color: "#FF3300";
}
a {
color:#f0037f;
}
a:link{
color:#f0037f;
text-decoration:underline;
}
a:hover{
color:#f0037f;
}
a:active{
color:#cc;
}


...and creates the an instance of TextFieldExample:


package {
import mx.core.UIComponent;
import flash.text.TextField;


public class TextFieldExample extends UIComponent {


private var label:TextField;
private var labelText:String = "Hello worldand
welcome to the show. ";

public function TextFieldExample() {
configureLabel();
setLabel(labelText);
}

public function setLabel(str:String):void {

label.htmlText = str;
}

private function configureLabel():void {

label = new TextField();
label.width = 200;
label.embedFonts = true;
label.background = true;
label.multiline = true;
label.styleSheet = HOW TO CONNECT TO THE CSS?;

addChild(label);
}
}
}

How do I connect the external stylesheet to the textfield so the
htmlText gets the right style?






 Yahoo! Groups Sponsor ~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-16 Thread olivierdejonge
How do I connect an external stylesheet to a textfield so the htmlText
gets the right styles?

In Flex 1.5 that was easy:

var styles:TextField.StyleSheet = new TextField.StyleSheet();
styles.load('myStyles.css');
...
function onLoad(ok){
  if(ok){
myText.htmlText = "hello world
myText.styleSheet = styles
  }
}


But how to do this in Flex 2.0, when function 'load()' doesn't exist
anymore and parseCSS not realy seems tow work with a:hover style etc? 

In the 2.0 example I have an Application...


http://www.adobe.com/2006/mxml";
xmlns:myText="*" layout="absolute">




...that loads an external stylesheet main.css,...

body {
fontFamily : "ThesisBolPla";
leading : "-3";
}
.heading {
fontWeight :"bold";
color: "#FF3300";
}
a {
color:#f0037f;
}
a:link{
color:#f0037f;
text-decoration:underline;
}
a:hover{
color:#f0037f;
}
a:active{
color:#cc;
}


...and creates the an instance of TextFieldExample:


package {
import mx.core.UIComponent;
import flash.text.TextField;


public class TextFieldExample extends UIComponent {


private var label:TextField;
private var labelText:String = "Hello worldand
welcome to the show. ";

public function TextFieldExample() {
configureLabel();
setLabel(labelText);
}

public function setLabel(str:String):void {

  label.htmlText = str;
}

private function configureLabel():void {

label = new TextField();
label.width = 200;
label.embedFonts = true;
label.background = true;
label.multiline = true;
label.styleSheet = HOW TO CONNECT TO THE CSS?;

addChild(label);
}
}
}

How do I connect the external stylesheet to the textfield so the
htmlText gets the right style?





 Yahoo! Groups Sponsor ~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-16 Thread Olivier de Jonge



How do I connect an external stylesheet to a textfield so the htmlText gets the right styles?
I have an Application:

http://www.adobe.com/2006/mxml" xmlns:myText="*" layout="absolute">
That 'loads' an external stylesheet main.css:body {fontFamily : "ThesisBolPla";leading : "-3";}.heading {fontWeight :"bold";
color: "#FF3300";}a {color:#f0037f;}a:link{color:#f0037f;text-decoration:underline;}a:hover{color:#f0037f;}a:active{

color:#cc;}and creates the an instance of TextFieldExample:package {import mx.core.UIComponent;import flash.text.TextField;public class TextFieldExample extends UIComponent {
private var label:TextField;private var labelText:String = "Hello worldand welcome to the show. ";
public function TextFieldExample() {configureLabel();setLabel(labelText);}public function setLabel(str:String):void {
label.htmlText = str;}private function configureLabel():void {label = new TextField();label.width = 200;label.embedFonts
 = true;
label.background = true;label.multiline = true;label.styleSheet = HOW TO CONNECT TO THE CSS?;addChild(label);}}}
How do I connect the external stylesheet to the textfield so the htmlText gets the right style?



__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   



  




  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



[flexcoders] Loading external css and setting a:hover style for htmlText

2006-07-15 Thread Olivier de Jonge



How do I connect an external stylesheet to a textfield so the htmlText gets the right styles?
I have an Application:

http://www.adobe.com/2006/mxml" xmlns:myText="*" layout="absolute">
That 'loads' an external stylesheet main.css:body {fontFamily : "ThesisBolPla";leading : "-3";}.heading {fontWeight :"bold";
color: "#FF3300";}a {color:#f0037f;}a:link{color:#f0037f;text-decoration:underline;}a:hover{color:#f0037f;}a:active{color:#cc;
}and creates the an instance of TextFieldExample:package {import mx.core.UIComponent;import flash.text.TextField;public class TextFieldExample extends UIComponent {
private var label:TextField;private var labelText:String = "Hello worldand welcome to the show. ";
public function TextFieldExample() {configureLabel();setLabel(labelText);}public function setLabel(str:String):void {
label.htmlText = str;}private function configureLabel():void {label = new TextField();label.width = 200;label.embedFonts = true;
label.background = true;label.multiline = true;label.styleSheet = HOW TO CONNECT TO THE CSS?;addChild(label);}}}How do I connect the external stylesheet to the textfield so the htmlText gets the right style?



__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___