Im tryig to recreate the same rotation effect in Front Row using Flash. I thik I have most of it figured out, but I keep running into problems.:hangover:
My Code:
[AS]
var home:MovieClip = this;
var Dir:String;
var Slots:Array = [];
var characters:Array = [[“guy1”], [“guy2”], [“guy3”], [“guy4”]];
var numOfChars:Number = characters.length;
var Destination:Number;
var radiusX:Number = 300;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var perspective:Number = 130;
var easing:Number = 0.05;
var menuKeyTimer:Number;
/////////////////////////////////////////////////////////////////////
this.onLoad = function() {
menuKeyTimer = 0;
Destination = 1;
numOfChars = characters.length;
for (var i = 0; i<numOfChars+1; i++) {
var t = home.attachMovie(characters*, characters*, i+1);
Slots.push(i*((Math.PI2)/numOfChars));
t.angle = i((Math.PI*2)/numOfChars);
t.charID = i+1;
t.onEnterFrame = mover;
}
};
/////////////////////////////////////////////////////////////////////
myListener = new Object();
myListener.onKeyUp = function() {
menuKeyTimer = 0;
};
Key.addListener(myListener);
////////////////////////////////////////////////////////////////////
function mover() {
/*if (this.angle>360) {
this.angle = Slots[0];
} else if (this.angle<0) {
this.angle = Slots[numOfChars];
}
*/
this._x = Math.cos(this.angle)*radiusX+centerX;
this._y = Math.sin(this.angle)radiusY+centerY;
var s = (this._y-perspective)/(centerY+radiusY-perspective);
this._xscale = this._yscale=s100;
this.swapDepths(Math.round(this._xscale)+100);
this._alpha = (Math.round(this._xscale)-45);
if (Key.isDown(Key.LEFT)) {
menuKeyTimer++;
if (menuKeyTimer<2) {
if (Destination<=numOfChars && Destination>=1) {
Destination–;
} else if (Destination<=0) {
Destination = 4;
}
Dir = “Left”;
}
//trace(Destination);
}
if (Key.isDown(Key.RIGHT)) {
menuKeyTimer++;
if (menuKeyTimer<2) {
if (Destination<numOfChars) {
Destination++;
} else {
Destination = 0;
}
Dir = “Right”;
}
//trace(Destination);
}
if (this.angle == Slots[Destination+this.charID]) {
//Do Nothing
} else {
if (Dir == “Left”) {
this.angle -= centerX+Slots[Destination-this.charID]*easing;
if (this.angle>360) {
this.angle = 0;
} else if (this.angle<0) {
this.angle = 360;
}
} else if (Dir == “Right”) {
this.angle += centerX+Slots[Destination-this.charID]*easing;
if (this.angle>360) {
this.angle = 0;
} else if (this.angle<0) {
this.angle = 360;
}
} else {
Dir = “none”;
}
}
}
[/AS]
Thanx in advance