AS3 改变MC颜色

package {
    import flash.display.*;
    import flash.display.GradientType;
    import flash.geom.ColorTransform;
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.events.*;
    import flash.net.*;

    public class ColorTransformExample extends Sprite {
        private var img:Bitmap;
        public function ColorTransformExample() {
            var loader:Loader = new Loader();
              loader.contentLoaderInfo.addEventListener(Event.INIT,initListener);
              loader.load(new URLRequest("11.png"));
            a.useHandCursor = true;
            a.buttonMode = true;
            a.addEventListener(MouseEvent.CLICK, clickHandler)
        }
        private function initListener(evt:Event):void{
            img = evt.target.content;
            a.addChild(img);
        }
        public function clickHandler(event:MouseEvent):void {
            var s:ColorTransform = new ColorTransform();
            var m:uint = Math.round(Math.random()*0xff6600);
            s.color = m;
            this.transform.colorTransform = s;
        }
    }
}  

本文来自-拍搜学院:http://www.pasou.cn/edu/Html/List7709.html

 

你可能感兴趣的:(html,.net,Flash)