梦幻之旅

DEBUG - 天道酬勤

   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  671 随笔 :: 6 文章 :: 256 评论 :: 0 Trackbacks
package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.text.TextField;

    public class MovingText extends Sprite
    
{
        private 
var txt:TextField;
        private 
var info:String;
        private 
var ti:uint;
        
        public 
function MovingText()
        
{
            txt 
= new TextField();
            txt.width 
=100;
            txt.textColor
=0xffff00;
            txt.selectable
=false;
            
            txt.x
=10;
            txt.y
=100;
            
this.addChild(txt);
            
            info
="There is not way that a bee cound bee able to fly";
            info 
+= "Their wings are too small to get it's fat little body off the ground.";
            
            ti
=0;
            
this.stage.frameRate=10;
            
this.addEventListener(Event.ENTER_FRAME,enterFrame);
        }

        
        public 
function enterFrame(e:Event):void
        
{
            txt.text 
= info.substr(++ti,20);
            
if(ti>=info.length)
            
{
                 ti
=0;
            }

        }

    }

}


posted on 2009-09-12 18:55 HUIKK 阅读(221) 评论(0)  编辑  收藏 所属分类: FLASH

只有注册用户登录后才能发表评论。


网站导航: