(Borrar) ¿Por qué estas 4 líneas dan resultados tan distintos?

Iniciado por Tachikomaia, 29 Mayo 2020, 00:23 AM

0 Miembros y 1 Visitante están viendo este tema.

Tachikomaia

Poco importa, pero el programa llega a este estado:
CitarLevel #0:
 Variable _level0.$version = "WIN 5,0,32,0"
 Variable _level0.SitID = "U11"
 Variable _level0.Depth = 23
 Variable _level0.C = 1
 Variable _level0.U = 10
 Variable _level0.Us = 11
 Variable _level0.S1 = 11
 Variable _level0.S2 = 5
 Variable _level0.List = 1
Movie Clip:  Target="_level0.Base"
Variable _level0.Base.S1 = 10
Variable _level0.Base.S2 = 5
Movie Clip:  Target="_level0.S5_5"
Variable _level0.S5_5.S1 = 5
Variable _level0.S5_5.S2 = 5
Variable _level0.S5_5.C = "Ninguno"
Movie Clip:  Target="_level0.S4_5"
Variable _level0.S4_5.S1 = 5
Variable _level0.S4_5.S2 = 5
Variable _level0.S4_5.C = -1
Movie Clip:  Target="_level0.U1"
Variable _level0.U1.S1 = 4
Variable _level0.U1.S2 = 5
Movie Clip:  Target="_level0.S6_5"
Variable _level0.S6_5.S1 = 5
Variable _level0.S6_5.S2 = 5
Variable _level0.S6_5.C = 1
Movie Clip:  Target="_level0.U2"
Variable _level0.U2.S1 = 6
Variable _level0.U2.S2 = 5
Movie Clip:  Target="_level0.S3_5"
Variable _level0.S3_5.S1 = 4
Variable _level0.S3_5.S2 = 5
Variable _level0.S3_5.C = -1
Movie Clip:  Target="_level0.U3"
Variable _level0.U3.S1 = 3
Variable _level0.U3.S2 = 5
Movie Clip:  Target="_level0.S7_5"
Variable _level0.S7_5.S1 = 6
Variable _level0.S7_5.S2 = 5
Variable _level0.S7_5.C = 1
Movie Clip:  Target="_level0.U4"
Variable _level0.U4.S1 = 7
Variable _level0.U4.S2 = 5
Movie Clip:  Target="_level0.S2_5"
Variable _level0.S2_5.S1 = 3
Variable _level0.S2_5.S2 = 5
Variable _level0.S2_5.C = -1
Movie Clip:  Target="_level0.U5"
Variable _level0.U5.S1 = 2
Variable _level0.U5.S2 = 5
Movie Clip:  Target="_level0.S8_5"
Variable _level0.S8_5.S1 = 7
Variable _level0.S8_5.S2 = 5
Variable _level0.S8_5.C = 1
Movie Clip:  Target="_level0.U6"
Variable _level0.U6.S1 = 8
Variable _level0.U6.S2 = 5
Movie Clip:  Target="_level0.S1_5"
Variable _level0.S1_5.S1 = 2
Variable _level0.S1_5.S2 = 5
Variable _level0.S1_5.C = -1
Movie Clip:  Target="_level0.U7"
Variable _level0.U7.S1 = 1
Variable _level0.U7.S2 = 5
Movie Clip:  Target="_level0.S9_5"
Variable _level0.S9_5.S1 = 8
Variable _level0.S9_5.S2 = 5
Variable _level0.S9_5.C = 1
Movie Clip:  Target="_level0.U8"
Variable _level0.U8.S1 = 9
Variable _level0.U8.S2 = 5
Movie Clip:  Target="_level0.S0_5"
Variable _level0.S0_5.S1 = 1
Variable _level0.S0_5.S2 = 5
Variable _level0.S0_5.C = -1
Movie Clip:  Target="_level0.U9"
Variable _level0.U9.S1 = 0
Variable _level0.U9.S2 = 5
Movie Clip:  Target="_level0.S10_5"
Variable _level0.S10_5.S1 = 9
Variable _level0.S10_5.S2 = 5
Variable _level0.S10_5.C = 1
Movie Clip:  Target="_level0.U10"
Variable _level0.U10.S1 = 10
Variable _level0.U10.S2 = 5
Movie Clip:  Target="_level0.S-1_5"
Variable _level0.S-1_5.S1 = 0
Variable _level0.S-1_5.S2 = 5
Variable _level0.S-1_5.C = -1
Movie Clip:  Target="_level0.U11"
Variable _level0.U11.S1 = -1
Variable _level0.U11.S2 = 5

Si luego pongo
SitID = eval("S"+Base.S1+"_"+Base.S2+".C");
J = Base.S1;
Base.S1 = eval("S"+Base.S1+"_"+Base.S2+".S1");
Base.S2 = eval("S"+J+"_"+Base.S2+".S2");
if (SitID != "Ninguno") {
List = SitID+" "+List;
gotoAndPlay (4);
} else {
stop ();
};
y se repite, el resultado es el que busco: List = 1 1 1 1 1 1

Pero si en vez de eso pongo:
SitID = "S"+Base.S1+"_"+Base.S2;
C = eval(SitID+".C");
Base.S1 = eval(SitID+".S1");
Base.S2 = eval(SitID+".S2");
if (C != "Ninguno") {
List = SitID+" "+List;
gotoAndPlay (4);
} else {
stop ();
}
y se repite, el resultado es S6_5 S7_5 S8_5 S9_5 S10_5 1

¿Por qué? El 2ndo code es más prolijo, quisiera usar ese.

Edit:
Ya entendí...
El error en el 2ndo caso es usar:
List = SitID+" "+List;
en vez de
List = C+" "+List;

¿Se puede borrar el tema?