Another Flash Search
- Started
- Last post
- 16 Responses
- madino
I am looking for a tutorial on how to dynamicly scale a movie click. I want to learn how www.evb.com did it...
I have searched everywhere... I am hoping someone knows where I can find something like this.
thanks in advance
- madino0
?
- weestu0
try robert penner's easing equations...
- madino0
sorry, I didn't mean click ... I meant movie clip.
I want to learn how to scale and move a movie clip based on numbers I set on click.
- stuff0
here's some code
on your _mc
onClipEvent(load){
Speed = 5;
target_xscale = target_yscale = 100;
}
onClipEvent(enterFrame){
_xscale += (target_xscale - _xscale)/Speed;
_yscale += (target_yscale - _yscale)/Speed;
}on your button:
on(release){
scaler_mc.target_xscale = 200;
scaler_mc.target_yscale = 200;
}
- stuff0
I've sent u an fla as well
- madino0
stuff is the best....
- madino0
stuff posted a scaling movie clip that works.
but it is non terminating loop.
so, I am trying to right a function that scales a movie clip based on varibles set on release of button.
the button looks like this
button_01.onRelease(){
scaleboxx = 100;
scaleboxy = 100;
scalebox();
}but I can't code a loop that runs without crashing (or does anything for that matter).
here is what I want it to do:
http://madino.com/scale/can someone help?
- unfittoprint0
//on the stretchMC
changeScale=function(targetX, targetY, speed){
_xscale+=(targetX-_xscale)/speed
_yscale+=(targetY-_yscale)/speed
if(Math.Round(_xscale) == targetX && Math.Round(_yscale) == targetY){
clearInterval(scaleLoop)
}
}
//calling method
scale= function(targetX, targetY, speed){
clearInterval(scaleLoop)
scaleLoop= setInterval(this, "changeScale", 30, targetX, targetY, speed);
}//method for calling [eg: button]
MyButton.onPress = function(){
stretchMC.scale(200, 400, 8)
- madino0
i take it targetx and or targety = whatever the movieclip is called?
- unfittoprint0
copy/paste the 2 first actions into the stretched MC.
________________________use the last 1 from a button or a movieclip to control the stretched MC's scale.
- madino0
well that worked well...
now, I have to learn exactly what it does.
Thank you, I well study this and learn the basics...
again, thanks
- madino0
actually, when I trace the scale.. it also is a never ending loop.
isn't that a bad thing? Or is that just a constant check?
- madino0
sorry for being a pain... but what I am trying to do is once the movie scaled to a certain height and width, I want to call a load movie funtion.
I guess, I can just check it...
I have a lot of learning to do here....
- madino0
unfit?
I feel that I reviewed and learned how your code works, but there is one thing that I don't understand.
How can I determine if the loop has been completed?
I thought that i could figure it out here
- if(Math.Round(_xscale) == targetX && Math.Round(_yscale) == targetY){
"TELL ME I AM DONE" here
clearInterval(scaleLoop);
}
- ********0
madino: could you send me that fla too. I've been wanting for ages to learn how to do that. Pretty please :)
- unfittoprint0
you've understood the code..
Note: one way to know when a loop is finished is to trace it. In the first line of the loop use something like:
trace(_x+" : "+_y);
When it stops 'messaging' the _y,_x coordinates of the movie it means it has cleared the loop.