Archive for the ·

Papervision

· Category...

New website: playability.nl

After 6 months of hard work, the new playability website is finally finished. Including technologies like PaperVision3D, GoogleAnalytics for Flash, Google Maps for flash, ton's of tweeners and some really cool home-brew classes, this is absolutely my most advanced AS3 project so far.

Beside the website, i also developed a custom-made CMS back-end using PHP and JSTweener (a Tweener port to JavaScript, which is cool, but some buggy).

The result can be found here

port_1port_2port_3port_4port_5

Tweener onComplete fires too early!

I've been working for some time now with papervision in combination with tweener. It's a real great combination to make some cool stuff. There is only one thing that doesn't seem to work really seamless. When working with compex models, i want to stop the papervision engine when it isn't needed. This creates some space to do other heavy stuff. But when I remove my enterframe function when tweener is onComplete, it seems to miss like half a second, and my animation is screwed-up. So it seems to be that Tweener fires the onComplete, just before it really completes. I wrote a function for it to handle the problem.

The name of the render function is onEnterFrame, and plane is the papervision model thats been tweening.

private function stopRender(e:TimerEvent = null):void {
	if(e) {
		e.target.removeEventListener(TimerEvent.TIMER, stopRender);
		e.target.stop();
	}
	if (!Tweener.isTweening(plane)){
		removeEventListener(Event.ENTER_FRAME, onEnterFrame);
		trace("engine stopt")
	}
	else {
		var timer:Timer = new Timer(100,1);
		timer.addEventListener(TimerEvent.TIMER, stopRender)
		timer.start();
	}
}