This is a discussion on Flash CS3 and HTML texts within the Tutorials forums, part of the Flash English category; HTML Code: Flash CS3 supports some HTML tags so that it can import or create HTML text files. The Flash ...
HTML Code:Flash CS3 supports some HTML tags so that it can import or create HTML text files. The Flash Player recognises the tags using the htmlText property of the TextField class. For example: nomeIstanzaCampoDiTesto.htmlText=?<b>Filippo</b>?; Let?s see which tags are supported by Flash Player 9 ? Anchor tag. The tag <a> with these attributes: href, event, target Bold tag <b> Break tag Font tag <font> with these attributes: color, face, size Image tag <img> with these attributes: scr, width, height, align, hspace, vspace, id, checkPolicyFile Italic tag <i> List item tag <li> Paragraph tag <p> with these attributes: align, class Span tag <span> with these attributes: class TextFormat tag <textformat> with these attributes: blockindent, indent, leading, leftmargin, rightmargin, tabstops Underline tag <u> Besides, Flash CS3 supports the following HMTL entities: <, >, &, ", &apos I?ve created a small example of how to use the hmtlText property of the TextField class:And here is the result:Code:package { import flash.display.MovieClip; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.TextEvent; import flash.net.URLRequest; import flash.net.navigateToURL; public class TestiHtml extends MovieClip { public function TestiHtml() { createField(); } private function createField():void { var tf:TextField=new TextField(); tf.x=20; tf.y=50; tf.autoSize=TextFieldAutoSize.LEFT; tf.htmlText="Luna Rossa è nella finale della Luis Vuitton Cup, clicca Quì per vederla."; addChild(tf); tf.addEventListener(TextEvent.LINK,cliccato); } private function cliccato(t:TextEvent):void { var request:URLRequest=new URLRequest(t.text); navigateToURL(request); } } }
Enjoy !
Bookmarks