I have this gallery which I want to add a floating effect to. I tried this code but it is not really what I am looking for. I want to add an effect like the one on this gallery.
This is my current code:
Actionscript Code:
const SPEED_MULTIPLIER:Number = 5
var speedX:Number = 0
var speedY:Number = 0
var upperLeftLimit:Point = new Point(0, 0)
var bottomRightLimit:Point = new Point(500, 500)
addEventListener(Event.ENTER_FRAME, routine)
function routine(e:Event) {
speedX += Math.random() * SPEED_MULTIPLIER - SPEED_MULTIPLIER / 2
speedY += Math.random() * SPEED_MULTIPLIER - SPEED_MULTIPLIER / 2
if (thumbnail_group.x + speedX > upperLeftLimit.x && thumbnail_group.x + speedX < bottomRightLimit.x)
thumbnail_group.x += speedX
else
speedX = 0
if (thumbnail_group.y + speedY > upperLeftLimit.y && thumbnail_group.y + speedY < bottomRightLimit.y)
thumbnail_group.y += speedY
else
speedY = 0
}
Please help