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.
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:
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.