property pLoc -- the location of the sprite begore the zoom property pZloc -- where in Z space the sprite came from property pRect -- the rectangle of the sprite before the zoom property pZoom -- the zoom state of the sprite image on beginSprite me pZoom = FALSE pLoc = sprite(me.spriteNum).loc pZloc = sprite(me.spriteNum).locZ pRect = sprite(me.spriteNum).rect end -- -- Attach this behavior to an image sprite to toggle the size -- of the image from its original size to full screen size. -- Ken Loge - http://diginoodles.com -- -- toggle the size and position of the image when the sprite is clicked on mouseUp me if pZoom = FALSE then -- get the center point of the stage sprite(me.spriteNum).loc = point(getStageWidth(me) / 2, getStageHeight(me) / 2) sprite(me.spriteNum).locZ = 1000 -- make sure the image is in front of all others -- get the stage width and height for image size sprite(me.spriteNum).rect = rect(0,0,getStageWidth(me),getStageHeight(me)) pZoom = TRUE else pZoom = FALSE sprite(me.spriteNum).loc = pZoom sprite(me.spriteNum).locZ = pZloc sprite(me.spriteNum).rect = pRect end if end -- get the width of the stage on getStageWidth me return _movie.stage.rect[3] - _movie.stage.rect[1] end -- get the height of the stage on getStageHeight me return _movie.stage.rect[4] - _movie.stage.rect[2] end -- enlarge the sprite slightly on mouseEnter me sprite(me.spriteNum).rect = sprite(me.spriteNum).rect + rect(-4,-4,4,4) end -- restore the sprite to its normal size on mouseLeave me sprite(me.spriteNum).rect = pRect end