# \[mx04\] Can I do this w/actionscript only?

**URL:** <https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939>\
**Category:** flash\
**Created:** [October 24, 2006, 7:42pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939 "2006-10-24T19:42:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![skellykitten](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@skellykitten](https://forum.kirupa.com/u/skellykitten)\
**Post date:** [October 24, 2006, 7:42pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/1 "2006-10-24T19:42:16Z")

</div>

I have a menu I’m trying to make, and it’s in the shape of a windmill. I’ve got the rotation set up like I want and that’s working fine, but because it’s suppost to look as if it’s at an agle, it doesn’t look right while it is rotating. here is the swf  
[http://img41.imageshack.us/my.php?image=windmill1md0.swf&tc=img41/9800/p42000921zg.jpg](http://img41.imageshack.us/my.php?image=windmill1md0.swf&tc=img41/9800/p42000921zg.jpg)  
I have it set up like this:  
I have it as a moveclip called wind1, on the stage with the instance name full\_wind.  
Inside the wind1 movieclip are the 4 fanblade movie clips called blade\_1, blade\_2, blade\_3 and blade\_4.  
There is also text in the blade\_1 movie clip, and ther will be on each of the blades eventually.  
frame 1 of the main movie has the rotation actionscript on it.

So what I’d like to do is this,  
as the blades rotate, I’d like them to shrink or stretch as the reach a certain position in there rotation cycle so as to add a bit of perspective to it. when the blades reach the top right and bottom left position they need to shrink a bit, and when they reach the top left and bottom right they need to stretch back, but smoothly.  
I’m not sure if I should be using hittest or \_scale here.  
I’d like to do this with actionscript if possible, I don’t like the result of frame by frame animation for this.  
I’m learning actionscript, so alot this doesnt make sense to me.

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [October 24, 2006, 9:34pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/2 "2006-10-24T21:34:44Z")

</div>

[QUOTE=skellykitten;1984575]I have a menu I’m trying to make, and it’s in the shape of a windmill. I’ve got the rotation set up like I want and that’s working fine, but because it’s suppost to look as if it’s at an agle, it doesn’t look right while it is rotating. here is the swf  
[http://img41.imageshack.us/my.php?image=windmill1md0.swf&tc=img41/9800/p42000921zg.jpg](http://img41.imageshack.us/my.php?image=windmill1md0.swf&tc=img41/9800/p42000921zg.jpg)  
I have it set up like this:  
I have it as a moveclip called wind1, on the stage with the instance name full\_wind.  
Inside the wind1 movieclip are the 4 fanblade movie clips called blade\_1, blade\_2, blade\_3 and blade\_4.  
There is also text in the blade\_1 movie clip, and ther will be on each of the blades eventually.  
frame 1 of the main movie has the rotation actionscript on it.

So what I’d like to do is this,  
as the blades rotate, I’d like them to shrink or stretch as the reach a certain position in there rotation cycle so as to add a bit of perspective to it. when the blades reach the top right and bottom left position they need to shrink a bit, and when they reach the top left and bottom right they need to stretch back, but smoothly.  
I’m not sure if I should be using hittest or \_scale here.  
I’d like to do this with actionscript if possible, I don’t like the result of frame by frame animation for this.  
I’m learning actionscript, so alot this doesnt make sense to me.[/QUOTE]

maybe something like this would work

```auto
wind1.onEnterFrame = function() {
	this._rotation += 2;
	this.blade_1._xscale = this.blade_1._yscale=100+40*Math.sin(Math.PI*this._rotation/180);
	this.blade_2._xscale = this.blade_2._yscale=100+40*Math.sin(Math.PI*(this._rotation+90)/180);
	this.blade_3._xscale = this.blade_3._yscale=100+40*Math.sin(Math.PI*(this._rotation+180)/180);
	this.blade_4._xscale = this.blade_4._yscale=100+40*Math.sin(Math.PI*(this._rotation+270)/180);
};

```

if you really want them to scale up twice in one \_rotatation multiply each angle by 2  
eg

```auto
100+40*Math.sin(2*Math.PI*this._rotation/180)

```

Alter the value of 40 to the amount you want it to scale above/below 100

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [October 24, 2006, 9:43pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/3 "2006-10-24T21:43:49Z")

</div>

[ot] holy crap its stringy - where ya been man? :hugegrin: [/ot]

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [October 24, 2006, 9:55pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/4 "2006-10-24T21:55:54Z")

</div>

> [@lunatic;1984700](#):
>
> [ot] holy crap its stringy - where ya been man? :hugegrin: [/ot]

[ot]Nice to see you are still around Lun 🙂 , I only came on because i wanted to reach 4000 before rha -failing miserably[/ot]

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [October 24, 2006, 10:10pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/5 "2006-10-24T22:10:07Z")

</div>

[ot]:lol: yeah, you got a little catching up to do! [/ot]

---

<div class="post-metadata">

**Author:** ![skellykitten](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@skellykitten](https://forum.kirupa.com/u/skellykitten)\
**Post date:** [October 24, 2006, 10:42pm UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/6 "2006-10-24T22:42:34Z")

</div>

Thanks, I’ll try this:)

---

<div class="post-metadata">

**Author:** ![skellykitten](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@skellykitten](https://forum.kirupa.com/u/skellykitten)\
**Post date:** [October 25, 2006, 1:33am UTC](https://forum.kirupa.com/t/mx04-can-i-do-this-w-actionscript-only/204939/7 "2006-10-25T01:33:04Z")

</div>

it didn’t work. Thanks though:)
