Just some text made out of circles which have a random tween effect when moused over. Try experimenting with different values for delay and distance.
Code stuff here:
import mx.transitions.Tween;
var delay:Number = .5;
var dist:Number = 100;
delayTxt.text = delay;
delayTxt.restrict = "0-9 .";
delayTxt.background = true;
delayTxt.backgroundColor = 0xFFFFFF;
delayTxt.onChanged = function() {
delay = Number(delayTxt.text);
};
distTxt.text = dist;
distTxt.restrict = "0-9";
distTxt.background = true;
distTxt.backgroundColor = 0xFFFFFF;
distTxt.onChanged = function() {
dist = Number(distTxt.text);
};
var coordArray:Array = new Array();
coordArray = [[100, 100], [100, 105], [100, 125], [100, 130], [100, 135], [100, 145], [100, 150], [100, 160], [100, 165], [100, 170], [100, 175], [100, 180], [100, 185], [100, 190], [100, 205], [100, 210], [100, 235], [100, 240], [100, 250], [100, 255], [100, 260], [100, 265], [100, 270], [100, 275], [100, 280], [100, 305], [100, 310], [100, 315], [100, 320], [105, 100], [105, 105], [105, 120], [105, 125], [105, 130], [105, 135], [105, 145], [105, 150], [105, 160], [105, 165], [105, 170], [105, 175], [105, 180], [105, 185], [105, 190], [105, 195], [105, 205], [105, 210], [105, 235], [105, 240], [105, 250], [105, 255], [105, 260], [105, 265], [105, 270], [105, 275], [105, 280], [105, 285], [105, 300], [105, 305], [105, 310], [105, 315], [105, 320], [105, 325], [110, 100], [110, 105], [110, 115], [110, 120], [110, 125], [110, 145], [110, 150], [110, 160], [110, 165], [110, 190], [110, 195], [110, 205], [110, 210], [110, 235], [110, 240], [110, 250], [110, 255], [110, 280], [110, 285], [110, 295], [110, 300], [110, 305], [110, 320], [110, 325], [110, 330], [115, 100], [115, 105], [115, 110], [115, 115], [115, 120], [115, 145], [115, 150], [115, 160], [115, 165], [115, 170], [115, 175], [115, 180], [115, 185], [115, 190], [115, 195], [115, 205], [115, 210], [115, 235], [115, 240], [115, 250], [115, 255], [115, 260], [115, 265], [115, 270], [115, 275], [115, 280], [115, 285], [115, 295], [115, 300], [115, 325], [115, 330], [120, 100], [120, 105], [120, 110], [120, 115], [120, 120], [120, 125], [120, 145], [120, 150], [120, 160], [120, 165], [120, 170], [120, 175], [120, 180], [120, 185], [120, 190], [120, 205], [120, 210], [120, 235], [120, 240], [120, 250], [120, 255], [120, 260], [120, 265], [120, 270], [120, 275], [120, 280], [120, 295], [120, 300], [120, 305], [120, 310], [120, 315], [120, 320], [120, 325], [120, 330], [125, 100], [125, 105], [125, 120], [125, 125], [125, 130], [125, 145], [125, 150], [125, 160], [125, 165], [125, 175], [125, 180], [125, 205], [125, 210], [125, 235], [125, 240], [125, 250], [125, 255], [125, 295], [125, 300], [125, 305], [125, 310], [125, 315], [125, 320], [125, 325], [125, 330], [130, 100], [130, 105], [130, 125], [130, 130], [130, 135], [130, 145], [130, 150], [130, 160], [130, 165], [130, 180], [130, 185], [130, 190], [130, 195], [130, 205], [130, 210], [130, 215], [130, 220], [130, 225], [130, 230], [130, 235], [130, 240], [130, 250], [130, 255], [130, 295], [130, 300], [130, 325], [130, 330], [135, 100], [135, 105], [135, 130], [135, 135], [135, 145], [135, 150], [135, 160], [135, 165], [135, 185], [135, 190], [135, 195], [135, 210], [135, 215], [135, 220], [135, 225], [135, 230], [135, 235], [135, 250], [135, 255], [135, 295], [135, 300], [135, 325], [135, 330]];
var coordLen:Number = coordArray.length;
for (var i:Number = 0; i < coordLen; i++) {
var clip = attachMovie("dot", "dot" + i, this.getNextHighestDepth(), {_x:coordArray*[1], _y:coordArray*[0]});
clip.oldX = clip._x;
clip.oldY = clip._y;
clip.newX = 0;
clip.newY = 0;
clip.onRollOver = function() {
this.useHandCursor = false;
moveIt(this, this.oldX, this.oldY, this.newX, this.newY);
};
}
function moveIt(mc, oldX, oldY, newX, newY) {
newPos = Math.floor(Math.random() * 8);
switch (newPos) {
case 0 :
newX = oldX;
newY = oldY - dist;
break;
case 1 :
newX = oldX + dist;
newY = oldY - dist;
break;
case 2 :
newX = oldX + dist;
newY = oldY;
break;
case 3 :
newX = oldX + dist;
newY = oldY + dist;
break;
case 4 :
newX = oldX;
newY = oldY + dist;
break;
case 5 :
newX = oldX - dist;
newY = oldY + dist;
break;
case 6 :
newX = oldX - dist;
newY = oldY;
break;
case 7 :
newX = oldX - dist;
newY = oldY - dist;
break;
default :
break;
}
myTweenX = new Tween(mc, "_x", None.easeNone, oldX, newX, delay, true);
myTweenY = new Tween(mc, "_y", None.easeNone, oldY, newY, delay, true);
myTweenX.onMotionFinished = function() {
myTweenX = new Tween(mc, "_x", None.easeNone, newX, oldX, delay, true);
};
myTweenY.onMotionFinished = function() {
myTweenY = new Tween(mc, "_y", None.easeNone, newY, oldY, delay, true);
};
}