OrganicBox AS2.0 class
Wednesday, May 11th, 2005I need such organic box for my current project, so i wrote AS 2.0 class for such objects. Class is simple, and can be improved for more effect. It use Laco’s AS2.0 Tweening Prototype
, but if you want, just change it to your tweening system.
And creating organic box is simple:
[as]
var gr = _root.createEmptyMovieClip(”gr”,100)
var gr = _root.createEmptyMovieClip(”gr”,100)
var obj = new com.franto.gfx.boxOrganic()
obj.parentMovieClip = gr; //parent movieclip for organicBox
obj.objectWidth = 50;
obj.objectHeight = 50;
obj.outlineSize = 3;
obj.colorOutline = 0xff0000;
obj.colorBackground = 0xffffff;
obj.x = 100;
obj.y = 80;
obj.batchDraw = true;
obj.makeBox();
obj.draw();
[/as]
And here is function for resizing:
[as]
function changeSize() {
obj.batchDraw = false;
var easing = “easeInOutSine”;
var new_width = random(200)+50;
var new_height= random(200)+50;
obj.tween(”objectWidth”,new_width,0.5 ,easing );
obj.tween(”objectHeight”,new_height,0.5, easing );
}
[/as]
function changeSize() {
obj.batchDraw = false;
var easing = “easeInOutSine”;
var new_width = random(200)+50;
var new_height= random(200)+50;
obj.tween(”objectWidth”,new_width,0.5 ,easing );
obj.tween(”objectHeight”,new_height,0.5, easing );
}
[/as]
Hope, it will be helpfull for you.






1 Trackbacks/Pingbacks
2 Comments
chris
• Visit Site
September 2nd, 2005
hey,
this looks really sweet. is that AS2 class made available for download at all? if so where i can dl it?
thanx,
chris
Administrator
• Visit Site
September 5th, 2005
yes, is it AS2 class (few of them), i can add them here, but i wanted to clear code before adding them.
Live Preview
Leave a comment