test on 2010-4-22
画像のアルファ変えるのと
/**
* Copyright psyark ( http://wonderfl.net/user/psyark )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/8r89
*/
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.events.Event;
[SWF(backgroundColor=0x000000)]
/**
* 画像のアルファ変えるのと
*/
public class FlashTest extends Sprite {
public function FlashTest() {
var image:BitmapData = new BitmapData(465 / 2, 465, false);
image.noise(0);
var bmp1:Bitmap = new Bitmap(image);
var bmp2:Bitmap = new Bitmap(image);
bmp2.x = 465 / 2;
addChild(bmp1);
addChild(bmp2);
var shape:Shape = new Shape();
shape.graphics.beginFill(0);
shape.graphics.drawRect(0, 0, 465 / 2, 465);
addChild(shape);
addEventListener(Event.ENTER_FRAME, function (event:Event):void {
bmp2.alpha = mouseX / 465;
shape.alpha = 1 - mouseX / 465;
});
}
}
}