# Trying to set up a conditional for alternate layout on thumbs

**URL:** https://forum.kirupa.com/t/trying-to-set-up-a-conditional-for-alternate-layout-on-thumbs/288956
**Category:** Uncategorized
**Created:** [May 24, 2009, 12:07am UTC](https://forum.kirupa.com/t/trying-to-set-up-a-conditional-for-alternate-layout-on-thumbs/288956 "2009-05-24T00:07:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![icebot07](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@icebot07](https://forum.kirupa.com/u/icebot07)
#### Post date: [May 24, 2009, 12:07am UTC](https://forum.kirupa.com/t/trying-to-set-up-a-conditional-for-alternate-layout-on-thumbs/288956/1 "2009-05-24T00:07:12Z")

</div>

so i need to have an alternate layout on my stage, depending on where the user mouses over these thumbs. i tried placing the following code in the class constructor, but it kept blowing up. i ended up putting it in the onComplete handler…and while it’s not working there either, it is loading at least the first layout.

i just went through and tested the mouse\_overs independently, and now it seems that onHoverLeft isn’t working at all, and i don’t know why.

```auto
 if (this.width >= parent.stage.stageWidth -5) {
                
            this.addEventListener(MouseEvent.MOUSE_OVER, onHoverLeft);
            
            } 
            
            else if (this.width <= parent.stage.stageWidth) {
            
            this.addEventListener(MouseEvent.MOUSE_OVER, onHoverRight);
                
            }

```

here’s the code for onHoverLeft:

```auto
     private function onHoverLeft(e:MouseEvent):void {

            dateTXT.visible=true;
            titleTXT.visible=true;
            titleTXT.x = -165;
            dateTXT.x = -165;
            box.visible = true;
            box.x = -170;
            this.scaleX = 1;
            parent.setChildIndex(this, parent.numChildren-1);

```

and here’s onHoverRight:

```
    private function onHoverRight(e:MouseEvent):void {
        
        dateTXT.visible=true;
        titleTXT.visible=true;
        titleTXT.x = 85;
        dateTXT.x = 85;
        box.visible = true;
        this.scaleX = 1;
        parent.setChildIndex(this, parent.numChildren-1);

    }

```

:cantlook: yeesh. sooo bad at this.
