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

BitmapCanvas / 01_bitmapCanvas
import hype.extended.behavior.FixedVibration;
import hype.extended.color.ColorPool;
import hype.extended.layout.ShapeLayout;
import hype.framework.core.ObjectPool;
import hype.framework.core.TimeType;
import hype.framework.display.BitmapCanvas;
import hype.framework.rhythm.SimpleRhythm;

MyShape.visible = false;

var myWidth = stage.stageWidth;
var myHeight = stage.stageHeight;

var bmc:BitmapCanvas = new BitmapCanvas(myWidth, myHeight);
addChild(bmc);

var clipContainer:Sprite = new Sprite();

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

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

function addNextClip(r:SimpleRhythm) {
	if (pool.isFull) {
		rhythm.stop();
	 } else {
		pool.request();
	}
}

pool.onRequestObject = function(clip) {
	clip.scaleX = clip.scaleY = 0;
	
	layout.applyLayout(clip);
	colorPool.colorChildren(clip);
	
	clipContainer.addChild(clip);
	
	// object, property, spring, ease, min, max, isRelative

	var yVib:FixedVibration = new FixedVibration(clip, “y”, 0.99, 0.004, -80, 80, true);
	var sVib:FixedVibration = new FixedVibration(clip, “scale”, 0.99, 0.03, 0.0, 0.2, false);

	yVib.start();
	sVib.start();
}

var rhythm = new SimpleRhythm(addNextClip);
rhythm.start(TimeType.TIME, 250);

bmc.startCapture(clipContainer, true);
Leave a Comment
Davy said, on February 2nd, 2010 at 12:01 pm

Hi guys,

I’ve been using the examples in a simple OOP setup (Document class), and it worked fine. For some reason though, since I’ve upgraded Flash Player to version 10.0.42.34, any script using a ShapeLayout and invoking its applyLayout() method crashes the Flash IDE at compile time. Yet when I compile scripts on the timeline, it works fine as before.

I’ll keep verifying is I have done anything wrong, but haven’t changed my OOP scripts before/after the player upgrade. I’m letting you know this just in case, by any chance, this is not an isolated incident.

Thanks again for the framework, it’s awesome.

Davy said, on February 2nd, 2010 at 12:21 pm

File was corrupt I guess, saving a copy of the .fla did the trick. Sorry for the nuisance!