Jeremy78
04-23-2008, 02:59 PM
I was wondering if someone could maybe help convert this into AS3. I've posted this before a while back but no one responded. I've considered using !== logical negation instead of using <> but that didn't get me far. Im still missing the concept of setting up the functions and variables for AS3. ANY help would be most appreciated.
function bgmove(){
bg_mc.onEnterFrame=function(){
if(this._x<>Math.round(xpos[pos])&&this._y<>Math.round(ypos[pos])&&this._xscale<>Math.round(wpos[pos])&&this._yscale<>Math.round(hpos[pos])){
this._x+=Math.round((xpos[pos]-this._x))/deceleration;
this._y+=Math.round((ypos[pos]-this._y))/deceleration;
this._xscale+=Math.round((wpos[pos]-this._xscale))/deceleration;
this._yscale+=Math.round((hpos[pos]-this._yscale))/deceleration;
this._rotation+=Math.round((rpos[pos]-this._rotation))/5;
}else{
this.onEnterFrame=null;
}
}
bg2_mc.onEnterFrame=function(){
if(this._x<>Math.round(xpos[pos])&&this._y<>Math.round(ypos[pos])&&this._xscale<>Math.round(wpos[pos])&&this._yscale<>Math.round(hpos[pos])){
this._x+=Math.round((xpos[pos]-this._x))/15;
this._y+=Math.round((ypos[pos]-this._y))/15;
this._xscale+=Math.round((wpos[pos]-this._xscale))/15;
this._yscale+=Math.round((hpos[pos]-this._yscale))/15;
this._rotation+=Math.round((rpos[pos]-this._rotation))/5;
}else{
this.onEnterFrame=null;
}
}
}
function bgmove(){
bg_mc.onEnterFrame=function(){
if(this._x<>Math.round(xpos[pos])&&this._y<>Math.round(ypos[pos])&&this._xscale<>Math.round(wpos[pos])&&this._yscale<>Math.round(hpos[pos])){
this._x+=Math.round((xpos[pos]-this._x))/deceleration;
this._y+=Math.round((ypos[pos]-this._y))/deceleration;
this._xscale+=Math.round((wpos[pos]-this._xscale))/deceleration;
this._yscale+=Math.round((hpos[pos]-this._yscale))/deceleration;
this._rotation+=Math.round((rpos[pos]-this._rotation))/5;
}else{
this.onEnterFrame=null;
}
}
bg2_mc.onEnterFrame=function(){
if(this._x<>Math.round(xpos[pos])&&this._y<>Math.round(ypos[pos])&&this._xscale<>Math.round(wpos[pos])&&this._yscale<>Math.round(hpos[pos])){
this._x+=Math.round((xpos[pos]-this._x))/15;
this._y+=Math.round((ypos[pos]-this._y))/15;
this._xscale+=Math.round((wpos[pos]-this._xscale))/15;
this._yscale+=Math.round((hpos[pos]-this._yscale))/15;
this._rotation+=Math.round((rpos[pos]-this._rotation))/5;
}else{
this.onEnterFrame=null;
}
}
}