dosukoi01
♥0 |
Line 49 |
Modified 2013-07-19 15:02:08 |
MIT License
archived:2017-03-10 02:47:59
ActionScript3 source code
/**
* Copyright asou_jp ( http://wonderfl.net/user/asou_jp )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/pzIj
*/
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.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;
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.blendMode = BlendMode.ADD;
_loader.x = _halfSize - (_loader.width >> 1);
_loader.y = _halfSize - (_loader.height >> 1);
addChild(_loader);
}
}
}