我需要有关我的 Array 函数的帮助。我正在尝试为网站创建标题,但它只是显示的第一个字母:
这是我的代码:
import fl.transitions.*;
import fl.transitions.easing.*;
var textArray:Array=["W","e","l","c","o","m","e"];
var tformat:TextFormat = new TextFormat();
tformat.color=0x0000CC;
tformat.font="Arial";
tformat.size=40;
var XPosition:Number=100;
var YPosition:Number=12;
var setPosition:Number=36;
function beginPlacement() {
var textfield:TextField = new TextField();
textfield.text=textArray.shift();
textfield.setTextFormat(tformat);
var clip:MovieClip=new MovieClip ;
clip.addChild(textfield);
clip.x=XPosition;
clip.y=YPosition;
addChild(clip);
var transManager:TransitionManager=new TransitionManager(clip);
transManager.startTransition({type:Photo, direction:Transition.IN, duration:.3, easing:None.easeNone});
transManager.startTransition({type:Zoom, direction:Transition.IN, duration:.3, easing:Elastic.easeOut});
transManager.addEventListener("allTransitionsInDon e", tComplete);
XPosition=+ XPosition+setPosition;
}
function tComplete(e:Event):void {
if (textArray.length>0) {
beginPlacement();
}
}
beginPlacement();