Often see the Flash book in the file box can dynamically modify its style, today wrote a small example for everyone to learn! Reprint Please keep: Blu-ray Blueshine effect is as follows:
/upload/20071124121452211.swf
Copy Code code as follows:
var Style = new TextFormat ();
Define a text Format
Style_txt.bordercolor = 0xdddddd;
Size_txt.bordercolor = 0xdddddd;
Style_txt.htmltext = "<a href= ' http://www.blue-sun.cn ' > Blu-ray blog blueshine</a>" +
"<br>http://www.blue-sun.cn<br> When you modify the following style, the text box style is not changed!"
Modify the font size when text box content changes
size_txt.onchanged = function () {
Style.size = This.text;
_root.style_txt.settextformat (style);
};
Modify text color
var listenobj_com = new Object ();
Listenobj_com.change = function () {
Style.color = Color_com.text;
_root.style_txt.settextformat (style);
};
Color_com.addeventlistener ("Change", listenobj_com);
Modify text Weight
var listenobj_che1 = new Object ();
Listenobj_che1.click = function () {
Style.bold = cuti_che.selected;
_root.style_txt.settextformat (style);
};
Cuti_che.addeventlistener ("click", Listenobj_che1);
Modify Text Italic Properties
var listenobj_che2 = new Object ();
Listenobj_che2.click = function () {
Style.italic = xieti_che.selected;
_root.style_txt.settextformat (style);
};
Xieti_che.addeventlistener ("click", Listenobj_che2);