Windmill spin

Hi everyone,
this is probably really easy for most of you so i’m hoping someone out there can help me.
I have created my movie which has a windmill on it with the blades rotating, but what I would like is an action that when you hit for example the space bar the blades spin faster and the more you hit the spacebar the faster they go but automatically slow down again when the space bar is left alone.

I will include the fla of the windmill to show you what I mean

Didn’t show up for me. But I don’t know about hitting keys and stuff, but just make it so when you hit the spacebar it plays another Frame, and have that Frame playing the windmill at a higher speed.

Hi sdrawkcaB,
thanks for replying, I meant to post the fla, I don’t think your idea of playing a different frame at a different speed would work as the way I have done the rotating is frame by frame animation rather than a tween because I found that by doing it as a motion tween the rotation wasn’t smooth enough.

I’ll include the fla for you to take a look.

This is what i came up with

Hi claudio
I just downloaded this but nothing happens, I tried it as html and swf but the blades are not turning, thanks for helping out what do you think i am doing wrong

You hold spacebar key and nothing happens?

nothing at all, I tried opening it in flash 5 and then MX

weird…it works for me
i rotate the windmill using AS

Yeah,
I can see the script that you wrote and with my little knowledge of script it seems to make sense, I just got a friend to try it on his computer and there is still no rotation so I can’t understand it

Yes, really weird… tell me if you get this working.
good luck
:slight_smile:

Ok, thanks for your help, just befoer you go though is this all the script that you wrote, (i’m just checking in case it got damaged during download)

windmill_mc.onEnterFrame = function() {
if (Key.isDown(key.SPACE)) {
speed++;
} else {
speed=1;
}
this._rotation += speed;
};

the script says windmill_mc.onEnterFrame but in the library panel the mc is actually called blade_mc, do you think this might be the problem

No thats not the problem… windmill_mc is the insatance name of blade_mc.

Yes I see that now,
thanks for all your help, I’ll keep working on it and i’ll give you a shout if I manage to figure it out, someone just told me to have a look through the tutorial section here and in flashkit so i’m sure i’ll find the solution before the day is done.
Cheers.

ok, good luck :wink: