# Changing broder color of rectangle

**URL:** https://forum.kirupa.com/t/changing-broder-color-of-rectangle/315369
**Category:** Uncategorized
**Created:** [October 24, 2010, 4:11pm UTC](https://forum.kirupa.com/t/changing-broder-color-of-rectangle/315369 "2010-10-24T16:11:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vfistri1](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@vfistri1](https://forum.kirupa.com/u/vfistri1)
#### Post date: [October 24, 2010, 4:11pm UTC](https://forum.kirupa.com/t/changing-broder-color-of-rectangle/315369/1 "2010-10-24T16:11:52Z")

</div>

i have a rectangle and i want to change its border colour on mouse over, i have found a way to make it work but that redraws the whole rectangle, i am wandering is it possible to only manipulate border colour without redrawing rectangle?

here is the code that works

```php
import flash.display.Sprite;

var rect:Shape = new Shape();
rect.graphics.lineStyle(3, uint("0x666633"));
rect.graphics.beginFill(uint("231f1c"), 1);
rect.graphics.drawRect(0 , 0 , 60 ,10 );
rect.graphics.endFill();

var sprite:Sprite = new Sprite();
sprite.addChild(rect);
addChild(sprite);

sprite.addEventListener(MouseEvent.MOUSE_OVER , colorChange);
function colorChange(e:MouseEvent):void{
 rect.graphics.beginFill(uint("231f1c"), 1);
 rect.graphics.lineStyle(3,uint("0x6600"));
 rect.graphics.drawRect(0 , 0 , 60 ,10 );
 rect.graphics.endFill();
}

```
