OrganicBox AS2.0 class

Streda, Máj 11th, 2005

I 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 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]

Hope, it will be helpfull for you.

tagged under:

ABOUT THIS AUTHOR

1 Trackbacks/Pingbacks

  1. Spätné upozorenie: horneygamer com on Júl 14, 2008

2 Comments


  1. 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


  2. 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.

Sorry, comments for this entry are closed at this time.

Images is enhanced with WordPress Lightbox JS by Zeo