# Trace an objects width?

**URL:** https://forum.kirupa.com/t/trace-an-objects-width/316076
**Category:** Uncategorized
**Created:** [November 11, 2010, 6:29pm UTC](https://forum.kirupa.com/t/trace-an-objects-width/316076 "2010-11-11T18:29:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bonassus](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bonassus](https://forum.kirupa.com/u/bonassus)
#### Post date: [November 11, 2010, 6:29pm UTC](https://forum.kirupa.com/t/trace-an-objects-width/316076/1 "2010-11-11T18:29:26Z")

</div>

This is an easy question but don’t understand why this isn’t working. I’m trying to trace the width property of a shape object. do i have to convert it to a number? could someone please explain how to do this?

var whiteBG:Shape;

whiteBG = new Shape();  
whiteBG.graphics.lineStyle(0,0xffffff);  
whiteBG.graphics.beginFill(0x00ffff);  
whiteBG.graphics.drawRect(-1000, -1000, 3000, 3000);  
whiteBG.graphics.endFill();  
addChild(whiteBG);

trace(whiteBG.width);

Error: 1120 Access of undefined property whiteBG.

What am I doing wrong?

Thanks
