Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Flash CS3 and HTML texts

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


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 Flash CS4 > Flash English > Tutorials

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-10-07, 19:45
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Flash CS3 and HTML texts

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:
&lt, &gt, &amp, &quot, &apos

I?ve created a small example of how to use the hmtlText property of the TextField class:
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 Qú per vederla.";
			
			addChild(tf);
			tf.addEventListener(TextEvent.LINK,cliccato);
		}
		
		private function cliccato(t:TextEvent):void
		{
			var request:URLRequest=new URLRequest(t.text);
			navigateToURL(request);
		}
	}
}
And here is the result:







Enjoy !
__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Actionscript 2 url html in flash ROBY94 Flash Italiano 7 11-11-08 18:53
Flash CS3 flash cs3 html totonino Flash CS3 Design 2 23-10-08 15:35
Flash CS3 e frames HTML Flep Articoli e tutorials 0 25-08-08 08:38
Flash CS3 e testi in html Flep Articoli e tutorials 3 21-04-08 22:55
Html in Flash storrisi Flash Italiano 3 21-11-07 15:22


All times are GMT. The time now is 17:08.

Powered by vBulletin version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap