# getBounds() really confusing

**URL:** <https://forum.kirupa.com/t/getbounds-really-confusing/183799>\
**Category:** flash\
**Created:** [March 30, 2006, 4:18am UTC](https://forum.kirupa.com/t/getbounds-really-confusing/183799 "2006-03-30T04:18:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuG56](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@BuG56](https://forum.kirupa.com/u/BuG56)\
**Post date:** [March 30, 2006, 4:18am UTC](https://forum.kirupa.com/t/getbounds-really-confusing/183799/1 "2006-03-30T04:18:31Z")

</div>

Hey, I’ve tried looking through the flash help, through several books, tutorials, and posts but I still don’t understand how I use getBounds. It’s really frustrating. I need to use it to detect collision on all four sides of a wall and based upon where my movie clip (\_root.char) hits it, and have it stop moving in that direction.

Please help explain this simply…thanks in advance.

---

<div class="post-metadata">

**Author:** ![kernel\_flash](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kernel\_flash](https://forum.kirupa.com/u/kernel_flash)\
**Post date:** [March 30, 2006, 6:13am UTC](https://forum.kirupa.com/t/getbounds-really-confusing/183799/2 "2006-03-30T06:13:29Z")

</div>

> **[\[FMX\] getBounds();](https://www.kirupa.com/forum/showthread.php?t=33726)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

Search the forum first before posting.

---

<div class="post-metadata">

**Author:** ![BuG56](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@BuG56](https://forum.kirupa.com/u/BuG56)\
**Post date:** [April 2, 2006, 4:01am UTC](https://forum.kirupa.com/t/getbounds-really-confusing/183799/3 "2006-04-02T04:01:54Z")

</div>

I did search through the forum, and lots of other places too. It still doesn’t work. I’ve never had this much trouble with a function the entire time I have used flash.

This is what I have tried to do, and apparently is correct (although it still doesnt work.)

CLIP A:

```auto

    _root.mainBounds = this.getBounds(_root);
    _root.mainBoundsXMAX = _root.mainBounds.xMax;
    _root.mainBoundsXMIN = _root.mainBounds.xMin;
    _root.mainBoundsYMAX = _root.mainBounds.yMax;
    _root.mainBoundsYMIN = _root.mainBounds.yMin;

```

CLIP B :

```auto

onClipEvent (enterFrame) {
    wallBounds = this.getBounds(_root);
    this.wallBoundsXMAX = this.wallBounds.xMax;
    this.wallBoundsXMIN = this.wallBounds.xMin;
    this.wallBoundsYMAX = this.wallBounds.yMax;
    this.wallBoundsYMIN = this.wallBounds.yMin;
    if (this.wallBoundsXMAX.hitTest(_root.mainBounds.XMIN)) {
        trace("Clip A's right side has made contact with Clip B's left.");
    }
}

```

Please help!!!

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [April 2, 2006, 9:07pm UTC](https://forum.kirupa.com/t/getbounds-really-confusing/183799/4 "2006-04-02T21:07:16Z")

</div>

that usage is wrong, check this one:  
[http://www.n99creations.com/?pID=archives&col=Blue&arch=getBounds\_as\_walls](http://www.n99creations.com/?pID=archives&col=Blue&arch=getBounds_as_walls)
