# How to get dimensions of the SimpleButton implemented in as2 component

**URL:** https://forum.kirupa.com/t/how-to-get-dimensions-of-the-simplebutton-implemented-in-as2-component/260110
**Category:** flash
**Created:** [May 12, 2008, 6:42pm UTC](https://forum.kirupa.com/t/how-to-get-dimensions-of-the-simplebutton-implemented-in-as2-component/260110 "2008-05-12T18:42:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sunny\_luthra](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@sunny\_luthra](https://forum.kirupa.com/u/sunny_luthra)
#### Post date: [May 12, 2008, 6:42pm UTC](https://forum.kirupa.com/t/how-to-get-dimensions-of-the-simplebutton-implemented-in-as2-component/260110/1 "2008-05-12T18:42:45Z")

</div>

Hi all,

Need urgent help.

Writing **as2 component** which uses \*\*SimpleButton \*\*class as an external class from component where I pass **skin elements** references, everything is fine.

Now problem is:-

1. When I call the instance of the class, I am \*_unable to get the dimensions of the button_ created as the skin may have different dimensions. It always **return 16x16** which is the size of default SimpleButton skin. I implemented setters and getters also but in vain.

2. Secondly when I **invalidate** the instance due to change in properties it gives an effect of \*\*flickering \*\*and clearly shows, as complete component has reloaded (\*\*reloading \*\*is in fact required but not to show to user). I did the same in as3 worked very fine.  
I checked and concluded that the component shows the \*buttons only on complete loading of all the \*buttons in component.

\*buttons ~ SimpleButton  
Solution/Suggestion welcomed/appreciated.  
Sorry but code cann’t be provided as is confidential.
