鼠标滑动、文本添加(倒计时)

                                                                          鼠标滑动

package  

{

    import flash.display.MovieClip;

    import flash.events.Event;

    dynamic public class Main extends MovieClip

{

        public var stageW:Number;

        public var stageH:Number;

        public var chaH:Number;

        public var picW:Number;

        public var img_mc:MovieClip;

        public var chaW:Number;

        public var picH:Number;

public function Main()        

{            

               addFrameScript(0,frame1);

}   

function frame1()        

{

            stageW = stage.stageWidth;

            stageH = stage.stageHeight;

            picW = img_mc.width;

            picH = img_mc.height;

            chaW = picW - stageW;

            chaH = picH - stageH;

           img_mc.addEventListener(Event.ENTER_FRAME,onen);

}

  public function onen(e:Event) : void        

{

            var a:* = mouseX / stageW;

            var b:* = mouseY / stageH;

            img_mc.x = img_mc.x + (800 - chaW * a - img_mc.x) / 10;

            img_mc.y = img_mc.y + (600 - chaH * b - img_mc.y) / 10;

 }

          

}

}                                                         

转载于:https://www.cnblogs.com/klh5211314/archive/2012/11/04/2754224.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值