download / 3.3 mb zip
version : 1.1.9
updated : February 18, 2011
open all | close all
upcoming HYPE events
No events.
let's keep in touch.
Keep us informed what you're working on using HYPE by connecting with us, either via e-mail or through twitter.

hype@hypeframework.org
twitter.com/hypeframework
Branden Hall

automatastudios.com
twitter.com/waxpraxis
Joshua Davis

joshuadavis.com
twitter.com/joshuadavis
flickr.com/photos/joshuadavis

Alternative content

Get Adobe Flash player

HotKey / 01_hotKey

press the “L” key on your keyboard to randomize the layout.
press the “C” key on your keyboard to randomize the color.

import hype.extended.color.ColorPool;
import hype.extended.layout.ShapeLayout;
import hype.framework.core.ObjectPool;
import hype.framework.interactive.HotKey;

MyShape.visible = false;

var color:ColorPool = new ColorPool(
	0x587b7C, 0x719b9E, 0x9FC1BE, 0xE0D9BB, 0xDACB94, 0xCABA88, 0xDABD55, 0xC49F32, 0xA97409
);

var pool:ObjectPool = new ObjectPool(MyCircle, 500);
var layout:ShapeLayout = new ShapeLayout(MyShape);

function colorClip(clip) {
	color.colorChildren(clip);
}

function layoutClip(clip) {
	layout.applyLayout(clip);
}

function colorAll() {
	pool.activeSet.forEach(colorClip);
}

function layoutAll() {
	pool.activeSet.forEach(layoutClip);
}

pool.onRequestObject = function(clip) {
	clip.scaleX = clip.scaleY = (Math.random() * 0.75) + 0.25;
	
	colorClip(clip);
	layoutClip(clip);
	
	addChild(clip);
}

pool.requestAll();

var hk:HotKey = new HotKey(stage);

// Map to the ‘C’ Key
hk.addHotKey(colorAll, ‘c’);

// Map to the ‘L’ Key
hk.addHotKey(layoutAll, ‘l’);
Leave a Comment

[...] KeyboardEvent の取得も簡単に行えるようになっています。 http://hype.joshuadavis.com/02_examples/hotkey/01_hotkey/ [...]