flash actionscript:
Do you see any reason why this would not work in flash 7 with actionscript 2.0
when it works fine in flash 6 actionscript 2.0? It's basically a panoramic
movie where on the edges you can scroll right or left with the use of easing
and a left end point and right end point. I assume maybe there is some issues
with the declared array with exporting to flash 7.
//
//
mc_pan._x = -1480;
var currentXPos:Array = new Array(0);
var dividerRatio:Number = 1.5;
var currentAccel:Number = -20;
var maxAccel:Number = 10;
var decel:Number = .8;
var fieldFriction:Number = 1;
var fieldWidth:Number = 75;
var movieWidth:Number = 800;
var overlapWidth:Number = 910;
var overlapTriggerRight:Number = -2645;
var overlapTriggerLeft:Number = 10;
var triggerOffset:Number = movieWidth+overlapTriggerRight;
var fieldRight:Number = movieWidth-fieldWidth;
var stateVar:Number = 0;
//
//
//
this.onEnterFrame = function() {
var xmouseVar:Number = this._xmouse-165;
if (moving && !stopped) {
if (xmouseVar<fieldWidth) {
currentAccel += ((fieldWidth-xmouseVar)/(fieldWidth*fieldFriction));
if (currentAccel>maxAccel) {
currentAccel = maxAccel;
}
} else if (this._xmouse>fieldRight) {
var area:Number = fieldWidth-(movieWidth-this._xmouse);
currentAccel -= (area/(fieldWidth*fieldFriction));
if (currentAccel<-maxAccel) {
currentAccel = -maxAccel;
}
} else {
currentAccel *= decel;
if (Math.abs(currentAccel)<.0001) {
currentAccel = 0;
}
}
if (stateVar == 0) {
currentXPos += currentAccel;
if (currentXPos<rightEnd) {
currentXPos = rightEnd;
stateVar = 1;
}
if (currentXPos>0) {
currentXPos = 0;
}
} else if (stateVar == 1) {
var overallMovement = currentAccel*dividerRatio;
mc_pan._x += overallMovement;
if (mc_pan._x<overlapTriggerRight) {
mc_pan._x = overlapTriggerRight;
stateVar = 2;
}
if (mc_pan._x>overlapTriggerLeft) {
mc_pan._x = overlapTriggerLeft;
stateVar = 0;
}
} else if (stateVar == 2) {
currentXPos += currentAccel;
if (currentXPos<rightEnd) {
currentXPos = rightEnd;
}
if (currentXPos>0) {
currentXPos = 0;
stateVar = 1;
}
}
//trace("currentXPos= "+currentXPos);
}
}
any help would be greatly appreciated.