In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

test on 2010-4-22

画像のアルファ変えるのと
Get Adobe Flash player
by psyark 22 Apr 2010
    Embed
/**
 * 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;
        		}); 
            
        }
    }
}