# Change angle on rollover

**URL:** <https://forum.kirupa.com/t/change-angle-on-rollover/313256>\
**Category:** flash\
**Created:** [August 25, 2010, 4:18am UTC](https://forum.kirupa.com/t/change-angle-on-rollover/313256 "2010-08-25T04:18:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janhavi](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@janhavi](https://forum.kirupa.com/u/janhavi)\
**Post date:** [August 25, 2010, 4:18am UTC](https://forum.kirupa.com/t/change-angle-on-rollover/313256/1 "2010-08-25T04:18:44Z")

</div>

Hello,

I am working on a Drag n Drop interaction, and need some help. I am going to use this in Captivate so, can’t use script with \_root. Here is what I am using. I got this script online and works perfectly fine. I have multiple boxes and snapAreas.

But now I want to add one more feature. That is; when the box rolls over snapArea, I want the box to change the angle to 90. IS this possible and how, I tried my best and couldn’t get it. Any help will be greatly appreciated.

Thanks in advance.

var fixedX:Number = box.\_x;  
var fixedY:Number = box.\_y;

box.onPress = function() {  
startDrag(this);  
};

box.onRelease = function() {  
if(box.hitTest(mc\_snapArea)){  
box.\_x = mc\_snapArea.\_x;  
box.\_y = mc\_snapArea.\_y+30;  
hitTestText.text = “That’s correct!”;  
} else {  
box.\_x = fixedX;  
box.\_y = fixedY;  
hitTestText.text = “Opps! Try again.”;  
}  
stopDrag();  
};
