PDA

View Full Version : A simple question....



JeffBrazil
November 29th, 2004, 08:37 AM
What AS should I use to get a movieclip bigger when I click a Buttom? I want the object to grow at a size "x" and then stop....

Thanxs
Jefferson :be:

maximum_flash
November 29th, 2004, 12:19 PM
_xscale property.

say this code is placed on a movie clip named grow


onClipEvent(enterFrame){
tarScale= this._xscale;
speed=4;
this._xscale+=(this._xscale-tarScale)/speed;
}


and on the button


on(release){
_root.grow.tarScale=200;
}


that code should make the box (clip) grow to 200% of it's current scale ... giving the effect of growth. post again if any problems occur.

imenstes
November 29th, 2004, 01:30 PM
i think you can use something like

movie_mc.x_scale = x_scale + 1;

something alone those lines. Also make sure to scale the Y also.

imenstes
November 29th, 2004, 01:31 PM
but in either case Maximun's post is a lot nicer :)

JeffBrazil
November 29th, 2004, 01:42 PM
Hi....

I did just what you have told me to and nothing happened.... Should I give the action to the movieclip on It or in the frame where it is?

It didnīt work with the action on the movieclip "grow"....
Have I done anything wrong???

Thanxs
jefferson

maximum_flash
November 30th, 2004, 04:03 AM
sorry about that. i had a momentary moment of stupidity. that code i gave you probably doesn't work ... like you said.

this, however, does:



onClipEvent (load) {
target_scale = 100;
target_scale += _xscale;
speed = 5;
}
onClipEvent (enterFrame) {
this._xscale += (target_scale-this._xscale)/speed;
}


place that on the mc you want to expand. this should do it for you.

JeffBrazil
November 30th, 2004, 07:53 AM
Guy..... Thanxs You helped me a lot.....

Jeff

maximum_flash
November 30th, 2004, 04:43 PM
not a problem.