# Bounce after rotation issue

**URL:** <https://forum.kirupa.com/t/bounce-after-rotation-issue/317358>\
**Category:** flash\
**Created:** [December 17, 2010, 4:52pm UTC](https://forum.kirupa.com/t/bounce-after-rotation-issue/317358 "2010-12-17T16:52:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![civictjai](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@civictjai](https://forum.kirupa.com/u/civictjai)\
**Post date:** [December 17, 2010, 4:52pm UTC](https://forum.kirupa.com/t/bounce-after-rotation-issue/317358/1 "2010-12-17T16:52:46Z")

</div>

Hi all,

Hope someone can help me out with this:

I have an Item() class which creates an ItemInfo() object. The ItemInfo is (for now) just a rect and extends from GestureCore() which contains only the Flick, Rotate & Scale gestures and also holds the bounding areas.

When i flick the ItemInfo without rotating it, it bounces between x=0 and max width of the stage. it all works fine.

Now when i rotate the ItemInfo() 45degree clockwise, it bounces between 3/4 of the stage and -1/4 (out of screen).

Rotating it further to 90degree it bounces between 1/2 of the stage and -1/2(out of screen)

Any of you have bumped on this before?

some code of the boundings

```php
public function onEnterFrameHandler(evt:Event):void
  {
   //-------------------------------------------------------------------------------
   //Watch bounds for collision
   trace("breedte in COre"+this.width, Xpos);
  
   if(this.x <= 0-Xpos)
   {
    this.x = 0-Xpos;
    dx =- dx;
   }
   if( this.x >= _stage.stageWidth-this.width-Xpos ) 
   {
    this.x = _stage.stageWidth-this.width-Xpos ;
    dx =- dx;
   }
   if(this.y <= 0-Ypos)
   {
    this.y = 0-Ypos;
    dy =- dy;
   }
   if( this.y >= _stage.stageHeight-this.height -Ypos )
   {
    this.y = _stage.stageHeight-this.height -Ypos;
    dy =- dy;
   }
   
   if((Math.abs(dy) <= 1) && (Math.abs(dx) <= 1))
   {
    dx = 0;
    dy = 0;
    removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
   }
   else
   {
   this.x += dx;
   this.y += dy;
   dx*=friction;
   dy*=friction;
   }
  }

```
