Ajuda ActionSCript

MindControl

Power Member
Boas... eu tenhu o seguinte codigo:

Código:
char = _root.attachMovie("char" + charNum,"char_mc",_root.getNextHighestDepth());
char._x = 318;
char._y = 332;
char._xscale = 60; 
char._yscale = 60; 
onMouseDown = function () {
with (_root["char_mc"]) {
x_nova_pos=_root._xmouse;
y_nova_pos=_root._ymouse;
_global.em_movimento=true;
}
}
onLoad = function () {
with (_root["char_mc"]) {
_global.em_movimento= false;
}
}
 
onEnterFrame = function () { // When the frame is entered the following code will apply as long as you're on the frame.
with (_root["char_mc"]) { // Assigns the code between the brackets to the stated MC
 
 
/////-----andar para traz e esq
if(_global.em_movimento == true and _global.apontar == "cima_e_esquerda" and voltar == 1){
if(this._y > y_nova_pos and this._x > x_nova_pos and _global.apontar == "cima_e_esquerda"){
this.gotoAndStop("andar_esq_tras");
this._x=this._x-5;
this._y=this._y-5;
}else if(this._x > x_nova_pos and _global.apontar == "cima_e_esquerda"){
voltar == 2;
this.gotoAndStop("andar_esq");
this._x=this._x-5;
this._y=this._y+3;
 
}else{
 
_global.apontar="";
_global.em_movimento = false;
}
}
/////-----fim do codigo para tras e esq
/////-----para quando esta parado
if(_global.em_movimento == false){
if(_root._xmouse>=this._x and _root._ymouse>=this._y){
this.gotoAndStop("parado_drt");
_global.apontar="baixo_e_direita";
voltar=1;
}
if(_root._xmouse < this._x and _root._ymouse >= this._y){
this.gotoAndStop("parado_esq");
_global.apontar="baixo_e_esquerda";
voltar=1;
}
if(_root._xmouse >= this._x and _root._ymouse < this._y){
this.gotoAndStop("parado_drt_tras");
_global.apontar="cima_e_direita";
voltar=1;
}
if(_root._xmouse < this._x and _root._ymouse < this._y){
this.gotoAndStop("parado_esq_tras");
_global.apontar="cima_e_esquerda";
voltar=1;
}
}
/////-----andar para traz e drt
////---- andar para andar para tras e drt
if(_global.em_movimento == true and _global.apontar =="cima_e_direita" and voltar ==1){
if(this._y>=y_nova_pos and this._x<=x_nova_pos and _global.apontar =="cima_e_direita"){
this.gotoAndStop("andar_drt_tras");
this._x = this._x +5;
this._y = this._y -3; 
}else if (this._x< x_nova_pos and _global.apontar =="cima_e_direita"){
voltar == 2
this.gotoAndStop("andar_drt");
this._x = this._x +5;
this._y = this._y +3;
}else{
_global.apontar = "";
_global.em_movimento = false;
}
}
/////-----fim do codigo para tras e drt
////---- andar para andar para baixo e drt
if(_global.em_movimento == true and _global.apontar =="baixo_e_direita" and voltar ==1){
if(this._y>=y_nova_pos and this._x<=x_nova_pos and _global.apontar =="baixo_e_direita"){
this.gotoAndStop("andar_drt");
this._x = this._x +5;
this._y = this._y +3; 
}else if (this._x< x_nova_pos and _global.apontar =="baixo_e_direita"){
voltar == 2
this.gotoAndStop("andar_drt");
this._x = this._x +5;
this._y = this._y +3;
}else{
_global.apontar = "";
_global.em_movimento = false;
}
}
/////-----fim do codigo para baixo e drt
/////-----andar para baixo e esq
if(_global.em_movimento == true and _global.apontar == "baixo_e_esquerda" and voltar == 1){
if(this._y <=y_nova_pos and this._x <= x_nova_pos and _global.apontar == "baixo_e_esquerda"){
this.gotoAndStop("andar_esq");
this._x=this._x-5;
this._y=this._y+3;
}else if(this._x > x_nova_pos and _global.apontar == "baixo_e_esquerda"){
voltar == 2;
this.gotoAndStop("andar_esq");
this._x=this._x-5;
this._y=this._y+3;
 
}else{
 
_global.apontar="";
_global.em_movimento = false;
}
}
 
}
 
}
 
stop();

mas nao esta a funcionar direito... ja fiz varias pesquisas e tentei de tudo mas nao consigo por isto a funcionar... :sad:

Alguem me pode ajudar com isto? é que é muito importante
 
Última edição pelo moderador:
Back
Topo