forked from: dosukoi01
...
@author asou_jp at InVogue
/**
* Copyright soundkitchen ( http://wonderfl.net/user/soundkitchen )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dnIx
*/
// forked from asou_jp's dosukoi01
package
{
import flash.display.BlendMode;
import flash.display.Graphics;
import flash.display.GraphicsSolidFill;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
/**
* ...
* @author asou_jp at InVogue
*/
public class HakatanoShio extends Sprite
{
private const _SIZE:uint = 460;
private var _halfSize:uint;
private var _loader:Loader;
private var _wrapper:Sprite;
public function HakatanoShio()
{
_halfSize = _SIZE >> 1;
var g:Graphics = graphics;
g.beginFill(0);
g.drawRect(0, 0, _halfSize, _halfSize);
g.endFill();
g.beginFill(0xFF0000);
g.drawRect(_halfSize, 0, _halfSize, _halfSize);
g.endFill();
g.beginFill(0x00FF00);
g.drawRect(0, _halfSize, _halfSize, _halfSize);
g.endFill();
g.beginFill(0x0000FF);
g.drawRect(_halfSize, _halfSize, _halfSize, _halfSize);
g.endFill();
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.INIT, _eventHandler);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, _errorEventHandler);
_loader.load(new URLRequest('http://asou.jp/metronom/inochigoi/images/inochigoi.jpg'));
}
private function _errorEventHandler(event:ErrorEvent):void
{
trace('エラーとかまぢウケるんですけどー笑');
}
private function _eventHandler(event:Event):void
{
_loader.contentLoaderInfo.removeEventListener(Event.INIT, _eventHandler);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, _errorEventHandler);
_loader.scaleX = _loader.scaleY = 1.5;
_loader.x = -(_loader.width >> 1);
_loader.y = -(_loader.height >> 1);
_wrapper = addChild(new Sprite()) as Sprite;
_wrapper.x = _wrapper.y = _halfSize;
_wrapper.blendMode = BlendMode.DIFFERENCE;
_wrapper.addChild(_loader);
_wrapper.addEventListener(Event.ENTER_FRAME, _frameHandler);
}
private function _frameHandler(event:Event):void
{
_wrapper.rotationY += 3;
}
}
}