Array problema con el establecimiento de toda la fila en lugar de una sola célula.

  • biznuge
  • Born
  • Born
  • No Avatar
  • Registrado: Jul 22, 2004
  • Mensajes: 2
  • Status: Offline

Nota Julio 22nd, 2004, 4:59 am

Código: [ Select ]
on (press)
{
    _global.cogrot[1];
    _global.cogarray = new Array(5,6);
    _global.matflag = new Array(1);
}

on (releaseOutside)
{
    var madvar=1000;
    var num1;
    var num2;
        overpeg=0;
    //stopDrag();
        for (num1=1; num1<=4; num1++)
        {    for (num2=1; num2<=5; num2++)
            {    if (this._x>((73.5*num1)+105.3))
                {    if (this._x<((73.5*num1)+105.3+16))
                    {    if (this._y>((73.5*num2)+20.2))
                        {    if (this._y<((73.5*num2)+20.2+16))
                            {    this._x=(num1*73.5)+105.3+8;
                                this._y=(num2*73.5)+20.2+8;
                                trace(1000000);
                                for (num3=0; num3<=5; num3++)
                                {    for (num4=0; num4<=6; num4++)
                                    {    trace(_global.cogarray[num3,num4]);
                                    }
                                }
                                trace(1000000);
This line is causing the problem....            
                    ----------->_global.cogarray[num1,num2]=1;
  1. on (press)
  2. {
  3.     _global.cogrot[1];
  4.     _global.cogarray = new Array(5,6);
  5.     _global.matflag = new Array(1);
  6. }
  7. on (releaseOutside)
  8. {
  9.     var madvar=1000;
  10.     var num1;
  11.     var num2;
  12.         overpeg=0;
  13.     //stopDrag();
  14.         for (num1=1; num1<=4; num1++)
  15.         {    for (num2=1; num2<=5; num2++)
  16.             {    if (this._x>((73.5*num1)+105.3))
  17.                 {    if (this._x<((73.5*num1)+105.3+16))
  18.                     {    if (this._y>((73.5*num2)+20.2))
  19.                         {    if (this._y<((73.5*num2)+20.2+16))
  20.                             {    this._x=(num1*73.5)+105.3+8;
  21.                                 this._y=(num2*73.5)+20.2+8;
  22.                                 trace(1000000);
  23.                                 for (num3=0; num3<=5; num3++)
  24.                                 {    for (num4=0; num4<=6; num4++)
  25.                                     {    trace(_global.cogarray[num3,num4]);
  26.                                     }
  27.                                 }
  28.                                 trace(1000000);
  29. This line is causing the problem....            
  30.                     ----------->_global.cogarray[num1,num2]=1;

Da una salida en el sistema que se parece a.....

/ / 0 0 0 0 0 0............................. 0 0 0 0 0 0
/ / 1 1 1 1 1 1............................. 0 0 0 0 0 0
/ / 0 0 0 0 0 0............o.............. 0 0 0 0 0 0
/ / 0 0 0 0 0 0............................. 0 0 0 0 0 0
/ / 0 0 0 0 0 0............................. 1 1 1 1 1 1
/ / 0 0 0 0 0 0............................. 0 0 0 0 0 0
/ / 0 0 0 0 0 0............................. 0 0 0 0 0 0

/ / dependiendo del lugar donde el objeto ha sido eliminado...

/ / Como puede ver, en lugar de establecer una única célula de la matriz que establece una línea completa ..

/ / Que realmente no tienen ni idea de lo que podría ser el problema con este único
/ / línea de código, pero este es definitivamente donde está el problema!

Código: [ Select ]
                                trace(1000000);
                                for (num3=0; num3<=5; num3++)
                                {    for (num4=0; num4<=6; num4++)
                                    {    trace(_global.cogarray[num3,num4]);
                                    }
                                }
                                trace(1000000);
                                
                                _global.num1glob=num1;
                                _global.num2glob=num2;
                                overpeg=1;
                                oddeven=(num1+num2)%2
                                
                                checkmatrix(num1,num2);
                                
                                
                                
                                if (_global.matflag[1]>0){
                                if (oddeven<1)
                                {
                                    _global.cogrot[1]=-5;
                                }
                                if (oddeven>0)
                                {
                                    _global.cogrot[1]=5;
                                }}
                                _global.matflag[1]=0;
                            }
                        }
                    }
                }
            }
        }
    if (overpeg<1)
    {
        this._x=initx;
        this._y=inity;
    }
}
  1.                                 trace(1000000);
  2.                                 for (num3=0; num3<=5; num3++)
  3.                                 {    for (num4=0; num4<=6; num4++)
  4.                                     {    trace(_global.cogarray[num3,num4]);
  5.                                     }
  6.                                 }
  7.                                 trace(1000000);
  8.                                 
  9.                                 _global.num1glob=num1;
  10.                                 _global.num2glob=num2;
  11.                                 overpeg=1;
  12.                                 oddeven=(num1+num2)%2
  13.                                 
  14.                                 checkmatrix(num1,num2);
  15.                                 
  16.                                 
  17.                                 
  18.                                 if (_global.matflag[1]>0){
  19.                                 if (oddeven<1)
  20.                                 {
  21.                                     _global.cogrot[1]=-5;
  22.                                 }
  23.                                 if (oddeven>0)
  24.                                 {
  25.                                     _global.cogrot[1]=5;
  26.                                 }}
  27.                                 _global.matflag[1]=0;
  28.                             }
  29.                         }
  30.                     }
  31.                 }
  32.             }
  33.         }
  34.     if (overpeg<1)
  35.     {
  36.         this._x=initx;
  37.         this._y=inity;
  38.     }
  39. }
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Julio 22nd, 2004, 4:59 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Julio 22nd, 2004, 4:10 pm

Bienvenido a Ozzu Biznuge :)

Por favor, recuerde usar [code] [/ code] al publicar las etiquetas de código en las juntas.
Strong with this one, the sudo is.
  • biznuge
  • Born
  • Born
  • No Avatar
  • Registrado: Jul 22, 2004
  • Mensajes: 2
  • Status: Offline

Nota Julio 22nd, 2004, 4:20 pm

gracias por la punta

Este hilo ha sido contestada!

Gracias! :idea:

Publicar Información

  • Total de mensajes en este tema: 3 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 44 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC