Adobe CS5 serisini çıkarır da biz dururmuyuz. Hemen araştırmalara girişip Flash CS5 ile yazılmış bir uygulamayı paylaşayım dedim. Text Acordion, Flash Player 10 ile rahatlıkla çalışmakta ancak FLA dosyasını sadece CS5 veriyon ve çıkarsa ileriki versiyonlarda açabilirsiniz.import com.flashandmath.dg.text.TextAccordion;
import flash.display.Shape;
var accordion1:TextAccordion;
var accordion2:TextAccordion;
var textMarkup1:String = "<html>" +
"<p>" +
"The text here is created inside of ActionScript. " +
"It is an example of the new TLF text in Flash. " +
"The text is automatically being broken up into pieces, " +
"displayed over separate sprite containers, but still considered as one " +
"whole body of text. The effect of unfolding after a mouse click is " +
"handled by a tween. We use a trick so that one tween controls the " +
"motion of all of these container sprites. The tween changes a single parameter " +
"value, and all sprites are positioned using this parameter." +
"</p>" +
"</html>";
var textMarkup2:String = "<html>" +
"<p>" +
"The text used in this example is typed in " +
"standard html format, but the Flash TLF Text converter can also import plain text " +
"or text written in the Adobe Text Layout format. " +
"Since this is html text, we can " +
"easily insert <a href='http://www.flashandmath.com'>links</a>." +
"</p>" +
"</html>";
///////////
init();
///////////
function init():void {
accordion1 = new TextAccordion();
accordion2 = new TextAccordion();
//It is very important that the accordion be added to the display list BEFORE importing text.
this.addChild(accordion1);
this.addChild(accordion2);
accordion1.x = 125;
accordion1.y = 45;
accordion1.yRotationStart = -30;
accordion1.yRotationEnd = -30;
accordion1.fontSize = 15;
accordion1.lineHeight = 30;
accordion2.x = 380;
accordion2.y = 45;
accordion2.paperColor = 0x97BC71;
accordion2.textPixelWidth = 240;
accordion2.yRotationStart = 27;
accordion2.yRotationEnd = 27;
accordion2.z = accordion2.textPixelWidth*Math.sin(Math.PI/180*accordion2.yRotationStart);
accordion2.fontSize = 14;
accordion2.lineHeight = 34;
accordion2.tweenDurationDown = 20;
accordion2.tweenDurationUp = 15;
accordion2.cosineEnd = 1;
accordion1.markupType = "html";
accordion1.importText(textMarkup1);
accordion2.markupType = "html";
accordion2.importText(textMarkup2);
}
Çalışmayı görüntülemek için tıklayınız.
Proje dosyalarını ve Class ı indirmek için tıklayınız.
Bu Makaleyi Tweet'le




0 yorum:
Yorum Gönder