Digital Clock shakes rather than bounces! AS 3.0 *HELP NEEDED*

Hi everyone, i’m pretty new to Flash CC and AS 3.0 and am trying to create a screensaver style animation with a digital clock that moves around the scene and ‘bounces’ off the edges (in a similar way to the old brick / pong games). In the background, there are also a selection of movie clips playing at random. My first question is about the movie clips. My clips are split into Big Clips (bc1, bc2…) and Standard Movie Clips (mc1, mc2…) and these play at random. I’ve tried to make sure the Big Clips are always on top of / in front of the smaller ones by giving them a Child Index number but these don’t seem to have any effect. Is there a way that I can keep the bigger clips playing above the smaller ones. Secondly, the motion of the digital clock moving around the scene currently isn’t working and instead it just shakes/wobbles and moves slowly to the right. Is there a problem with my code or will this type of movement not work with my dynamic text box?

I’ll post the code and file below. Any help would be greatly appreciated!

import flash.utils.Timer;import flash.events.TimerEvent;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.display.MovieClip;
import flash.events.Event;




// -----------------------------
// --------- FUNCTIONS ---------
// -----------------------------




// -------- small boxes --------




function onLoop(e:Event):void
{ 
   var random:uint = Math.round(Math.random() * 7);
   var randomClass:Class = Class(getDefinitionByName("mc" + random));
   if(randomClass)
   var myRandomX:uint = Math.round(Math.random() * 32);
   var myRandomY:uint = Math.round(Math.random() * 32);
   {
      theClip = new randomClass();
      addChild(theClip as DisplayObject);
      theClip.x = myRandomX * 80;
      theClip.y = myRandomY * 80;
       theClip.parent.setChildIndex(theClip,1);
   }
}




// -------- big boxes --------




function onBigLoop(e:Event):void
{ 
   var random:uint = Math.round(Math.random() * 7);
   var randomClass:Class = Class(getDefinitionByName("bc" + random));
   if(randomClass)
   var myRandomXX:uint = Math.round(Math.random() * 28);
   var myRandomYY:uint = Math.round(Math.random() * 28);
   {
      theBigClip = new randomClass();
      addChild(theBigClip as DisplayObject);
      theBigClip.x = myRandomXX * 160 + 80;
      theBigClip.y = myRandomYY * 160 + 80;
       theBigClip.parent.setChildIndex(theBigClip,2);
   }
}




// -------- clock time --------




function go(event:TimerEvent):void
{
    updateTime();
}


function updateTime():void
{
var date = new Date();
var seconds:uint = date.getSeconds();
var minutes:uint = date.getMinutes();
var hours:uint = date.getHours();
digitalClock.text = pad(hours) + ":" + pad(minutes) + ":" + pad(seconds);
}


function pad (number:Number)
{
var new_num:String = String (number);
    
if (new_num.length <2)
    
{
    new_num = "0" + new_num;
    }
    
    return new_num;
}




// -------- clock bounce --------




function bounceClock(event:Event):void
{
digitalClock.x += velocityX;
digitalClock.y += velocityY;


if (digitalClock.x > stage.stageWidth - digitalClock.width / 2 || digitalClock.x < 0 + digitalClock.width / 2) { velocityX *= -1;
}
else if (digitalClock.y > stage.stageHeight - digitalClock.height / 2 || digitalClock.y < 0 + digitalClock.height / 2) { velocityY *= -1;
}
}




// -----------------------------
// -------- MAIN PROGRAM -------
// -----------------------------




// -------- small boxes --------




var theClip:Object;
stage.addEventListener(Event.ENTER_FRAME, onLoop); 




// -------- big boxes --------




var theBigClip:Object;
stage.addEventListener(Event.ENTER_FRAME, onBigLoop); 




// -------- clock time --------




var myTimer:Timer = new Timer (100);
myTimer.addEventListener(TimerEvent.TIMER, go);
myTimer.start();
updateTime();




// -------- clock bounce --------




var velocityX:Number = -5;
var velocityY:Number = 5;
stage.addEventListener(Event.ENTER_FRAME, bounceClock);