ok, so i got a logo, each letter it a clip, cos the logo is bit more than just text, but thats beside the point. I want each letter to start of larger than it should be and zoom out (scale down) to the normal size, pref with a bit of a bounce at the end, so it goes from very big to, slightly smaller then proper size, to proper size, get it?:hangover:
so with help from Master64 (via IRC) i worked out that i could use _xscale and _yscale (i am relativly new here, lol :)) but the problem i got is that it scales, but in huge jumps, not smooth.
The class is ment to be reusable (duh!) so my concept is
start_width = 90
speed = 50
logo = new bounce_in
logo.add_clip(clip_instance_name)
logo.settings(max_width,speed)
logo.animate();
and my class file (bounce_in.as) is as follows
if you can help, point me (or shuv me) in the right direction, i would be happy thank you
[SIZE=1]
[AS]
/**
-
zoom a clip into the page,
-
and bounce at the end
*/
class bounce_in {/* store the names of the clips */
private var clips = Array();/* running stores the width as the clip is scaled */
private var running_width:Number;/* how wide the clip should start */
private var zoom_width:Number;/* speed of animation (in ms eg. 1000 = 1 sec) */
private var speed:Number;/* this function sets the options for the animation */
public function settings(w,s) {zoom_width = w; speed = s;
}
/* add a clip to the array */
public function add_clip(clip) {var next_id:Number; if (clips.length == 0) { next_id = 0; } else { next_id = clips.length+1; } clips[next_id] = clip;
}
/* hide all the clips in the array */
private function hide_all() {for (var a = 0; a<this.clips.length; a++) { this.clips[a]._visible = false; }
}
/* loop through clips array and do animate_clip() on each */
public function animate() {hide_all(); for(var a=0;a<clips.length;a++) { animate_clip(a); }
}
/* animates the clip from the clips array specified by clip_id! */
private function animate_clip(clip_id) {var current_clip = clips[clip_id]; var end_width:Number = current_clip._width; var end_height:Number = current_clip._height; var start_width:Number = zoom_width; //work out the percent increas in width... var percent_inc = end_width/start_width*100; //...and do the same increas with the height var start_height:Number = end_height/percent_inc*100; //set start properties current_clip._visible = true; current_clip._width = start_width; current_clip._height = start_height; setInterval(this,"scale",speed,current_clip);
}
/* scale the clip */
function scale(clip) {trace("width = "+clip._width); trace("height = "+clip._height); trace(""); var size = clip._width-1; clip._xscale = clip._yscale = size;
}
}
[/AS]
[/SIZE]