Hi Corban,
Here's an excerpt from one of my classes:
code
var newStyle = new TextField.StyleSheet();
newStyle.setStyle(a, {color: '#66', fontWeight:'bold'})
newStyle.setStyle(a:hover, {textDecoration: 'underline'})
title_txt.styleSheet = newStyle;
/code
Worked for me, hope this helps.
Karina
-Original Message-
From: Corban Baxter [mailto:[EMAIL PROTECTED]
Sent: 17 February 2006 20:53
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] styleSheets and Links
Does anyone have some good examples of Flash using CSS to
stylize links with hover properties etc. I can't seem to get
my color to work properly.
[code]
//first try at this one
var style_sheet = new TextField.StyleSheet();
style_sheet.setStyle(a,
{ color: #CC,
fontFamily: Verdana,
sans-serif,
fontSize: 11px,
display: inline}
);
//attach movie BG
this.attachMovie(button_mc, link_1, 2); //add text field
to button_mc clip link_1.createTextField(my_title, 3, 1, 2,
0, 30); link_1.my_title.autoSize = center; //apply style
link_1.my_title.styleSheet = style_sheet;
//add link
link_1.my_title.html = true;
link_1.my_title.htmlText=a href='http://www.google.com'hey
world!/a;
//find width of text
trace(link_1.my_title._width);
//resize bg for text - 49 is used for the extra pixel width
added to the field.
link_1.button_bg._width = link_1.my_title._width + 49;
trace(link_1.button_bg._width);
//center link in BG area...
link_1.my_title._x = 25;
[/code]
Also how do I implement hovers when I do, do it?
Corban Baxter | rich media designer |
www.funimation.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@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