Continuing the previous tutorial this time we will try to continue the previous tutorial on the Application Textflow by TagName paragraph (insert span), in this tutorial we will try to learn how to insert Textflow TagName imeage in paragraphs, but here we only study the image insert in paragraph textflow , .. anything related to image tags like width, .. height and bla bla ... we will learn in the next post about image tag .
Melanjutkan tutorial sebelumnya kali ini kita akan coba melanjutkan tutorial seblumnya tentang Penerapan Textflow berdasarkan TagName paragraf(insert span), dalam tutorial kali ini kita akan coba untuk mempelajari bagaimana cara insert imeage dalam Textflow TagName paragraf,namun disini kita hanya mempelajari insert image dalam paragraf textflow,..apapun yang berhubungan dengan tag image seperti width ,.. height and bla bla ,... akan kita pelajari pada postingan berikutnya tentag tag image..
2.<img>...</img>
Tag img dalam textflow merupakan tag yang dapat kita pergunakan untuk meload image langsung kedalam textflow itu sendiri sebagai contoh saya mempergunakan script seperti ini
package
{
import flash.display.*;
import flash.events.Event;
import fl.text.TLFTextField;
import flash.text.TextFieldAutoSize;
/**
* ...
* @author Ricko
*/
public class Main extends MovieClip
{
public var tes:MovieClip = new tesgambar ;
public var tFlow:String = '<TextFlow whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p><img float="start" source="phie.jpg" height="61" width="61"vspace="50"hspace="50" />Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum<img source="phie.jpg" height="30" width="30"/> <img source="phie.jpg" height="30" width="30"/><img source="phie.jpg" height="30" width="30"/><img source="phie.jpg" height="30" width="30"/><img source="phie.jpg" height="30" width="30"/>claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum<span color="#33ff00" fontSize="18">quick </span><img source="phie.jpg" height="80" width="80"vspace="50"hspace="50" /><span fontWeight="bold">brown fox jumps over the </span><span color="#ff0000">lazy</span><span> dog.</span></p></TextFlow>';
public var tlfTxt:TLFTextField = new TLFTextField();
public function Main():void
{
if (stage)
{
init();
}
else
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
tlfTxt.border = true;
tlfTxt.tlfMarkup = tFlow;
tlfTxt.wordWrap = true;
tlfTxt.width = 300;
tlfTxt.autoSize = TextFieldAutoSize.LEFT;
tlfTxt.x = tlfTxt.y = 0;
addChild(tlfTxt);
}
}
}
atau jika anda terbiasa dengan primitive script (timeline script)
//Primitive script or timelineScript
import fl.text.TLFTextField;
import flash.text.TextFieldAutoSize;
import flash.events.Event;
var tFlow:String = '<TextFlow whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p><img float="start" source="phie.jpg" height="61" width="61"vspace="50"hspace="50" />Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum<img source="phie.jpg" height="30" width="30"/> <img source="phie.jpg" height="30" width="30"/><img source="phie.jpg" height="30" width="30"/><img source="phie.jpg" height="30" width="30"/><img source="phie.jpg" height="30" width="30"/>claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum<span color="#33ff00" fontSize="18">quick </span><img source="phie.jpg" height="80" width="80"vspace="50"hspace="50" /><span fontWeight="bold">brown fox jumps over the </span><span color="#ff0000">lazy</span><span> dog.</span></p></TextFlow>';
var tlfTxt:TLFTextField = new TLFTextField();
tlfTxt.border = true;
tlfTxt.tlfMarkup = tFlow;
tlfTxt.wordWrap = true;
tlfTxt.width = 300;
tlfTxt.autoSize = TextFieldAutoSize.LEFT;
tlfTxt.x = tlfTxt.y = 0;
addChild(tlfTxt);
nanti hasil yang akan anda dpatkan seperti gambar diatas....
By Ricko nada di Pustaka Flash terima kasih telah membaca :) Penerapan Textflow TagName paragraf (insert image)
facebook
twitter
google+
fb share