[Flash]*a typing effect

类别:编程语言 点击:0 评论:0 推荐:

yesterday very night,a guy call me on the QQ and ask how to make this effect,but it's such a long time since I use Flash last time,so I anwser that maybe frame by frames will fit u,But when I was on bed,i have a comand of myself to try it out,at least in mind,so today I'mhere programming now ,and blows are my codes:

import mx.controls.Label;
import mx.controls.Button;
import mx.controls.TextInput;
createClassObject(TextInput,"input",4{text:""});
createClassObject(Label,"lab",3{text:" "});
createClassObject(Button,"btn",2,{label:"Oops"});

btn.onPress = function() {
 var n = 0;
 var s:String = input.text;
 var ID = setInterval(showText, 1000);
 function showText() {
  n++;
  lab.text = s.substr(0, n-1);
  trace("ok"+s.substr(0, n-1));
  if (n>=s.length+1) {
   clearInterval(ID);
  }
  updateAfterEvent();
 }
};

~~~~~~~~~~~~~~~I HOPE IT WILL WORK JUST FINE ~~~~~~~~~~~        WILLIAM YUAN我是客傢人

本文地址:http://com.8s8s.com/it/it22859.htm