frame(s)
private function onEnterFrame(event:Event):void
{
xpos += vx;
ypos += vy;
zpos += vz;
var radius:Number = ball.radius;
if(xpos + radius > right)
{
xpos = right - radius;
vx *= -1;
}
else if(xpos - radius < left)
{
xpos = left + radius;
vx *= -1;
}
if(ypos + radius > bottom)
{
ypos = bottom - radius;
vy *= -1;
}
else if(ypos - radius < top)
{
ypos = top + radius;
vy *= -1;
}
if(zpos + radius > front)
{
zpos = front - radius;
vz *= -1;
}
else if(zpos - radius < back)
{
zpos = back + radius;
vz *= -1;
}