Section 1
//BaseImage (BaseImage)
package {
import flash.display.*;
public dynamic class BaseImage extends MovieClip {
}
}//package
Section 2
//BG (BG)
package {
import flash.display.*;
public dynamic class BG extends BitmapData {
public function BG(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 3
//BG_front (BG_front)
package {
import flash.display.*;
public dynamic class BG_front extends BitmapData {
public function BG_front(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 4
//Brush (Brush)
package {
import flash.display.*;
public class Brush extends Sprite {
var fillType:String;// = "radial"
var colors:Array;
var ratios:Array;
var alphas:Array;
public function Brush(){
fillType = GradientType.RADIAL;
colors = [0, 0];
alphas = [1, 0];
ratios = [10, 50];
super();
this.graphics.beginFill(0);
this.graphics.drawCircle(0, 0, 20);
this.graphics.endFill();
}
}
}//package
Section 5
//CoverImage (CoverImage)
package {
import flash.display.*;
import flash.geom.*;
public class CoverImage extends Sprite {
var brushLayer:Sprite;
var brush:Brush;
var blend:BitmapData;
var point:Point;
var bmp:Bitmap;
var cover:BitmapData;
var maskLayer:BitmapData;
var rect:Rectangle;
public function CoverImage(_arg1:BitmapData){
brush = new Brush();
rect = new Rectangle(0, 0, 480, 640);
point = new Point(0, 0);
blend = new BitmapData(480, 640, true, 0);
brushLayer = new Sprite();
maskLayer = new BitmapData(480, 640, true, 4294967295);
bmp = new Bitmap(blend);
super();
cover = _arg1;
blend.copyPixels(cover, rect, point, maskLayer, point, true);
addChild(bmp);
brushLayer.addChild(brush);
}
public function onMove(_arg1:int, _arg2:int):void{
brush.x = _arg1;
brush.y = _arg2;
maskLayer.draw(brushLayer);
maskLayer.copyChannel(maskLayer, rect, point, BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
blend.copyPixels(cover, rect, point, maskLayer, point, false);
}
function clear():void{
var _local1:*;
_local1 = Sprite(this.parent);
_local1.setCover();
}
public function onUp():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:uint;
_local1 = 0;
_local2 = 0;
while (_local2 <= 48) {
_local3 = 0;
while (_local3 <= 64) {
_local4 = blend.getPixel((_local2 * 10), (_local3 * 10));
if (_local4 == 0){
_local1++;
};
_local3++;
};
_local2++;
};
trace(_local1);
if (_local1 > 3180){
clear();
};
}
}
}//package
Section 6
//Strip (Strip)
package {
import flash.events.*;
import flash.display.*;
public class Strip extends Sprite {
var baseImage:BaseImage;
var bgImage:BitmapData;
var bg:Bitmap;
var st:Stage;
var flg:Boolean;// = false
var stripFlag:int;// = 0
var targetCover:CoverImage;
var bg_front:Bitmap;
var wear02:BitmapData;
var wear01:BitmapData;
var bgImage_front:BitmapData;
var coverImage01:CoverImage;
var coverImage02:CoverImage;
public function Strip(){
wear01 = new Wear01(480, 640);
wear02 = new Wear02(480, 640);
bgImage = new BG(480, 640);
bgImage_front = new BG_front(480, 640);
bg = new Bitmap(bgImage);
baseImage = new BaseImage();
coverImage01 = new CoverImage(wear01);
coverImage02 = new CoverImage(wear02);
bg_front = new Bitmap(bgImage_front);
stripFlag = 0;
flg = false;
super();
this.addEventListener(Event.ADDED_TO_STAGE, onInit);
}
function onDown(_arg1:MouseEvent):void{
flg = true;
}
function onMove(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
_local2 = st.mouseX;
_local3 = st.mouseY;
if (flg){
targetCover.onMove(_local2, _local3);
};
}
public function setCover():void{
switch (stripFlag){
case 0:
stripFlag++;
removeChild(coverImage02);
baseImage.gotoAndStop(2);
targetCover = coverImage01;
break;
case 1:
stripFlag++;
baseImage.gotoAndStop(3);
break;
};
trace("setCover");
}
function onInit(_arg1:Event):void{
st = stage;
addChild(bg);
addChild(baseImage);
addChild(coverImage01);
addChild(coverImage02);
addChild(bg_front);
targetCover = coverImage02;
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
baseImage.gotoAndStop(1);
}
function onUp(_arg1:MouseEvent):void{
flg = false;
targetCover.onUp();
}
}
}//package
Section 7
//Wear01 (Wear01)
package {
import flash.display.*;
public dynamic class Wear01 extends BitmapData {
public function Wear01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 8
//Wear02 (Wear02)
package {
import flash.display.*;
public dynamic class Wear02 extends BitmapData {
public function Wear02(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package