Comunidad de diseño web y desarrollo en internet online

Una duda que fastidia sobre instancias? que hacer

Citar            
MensajeEscrito el 05 Mar 2006 05:23 am
Holas a todos bueno no quiero meterles mucho floro . Pucha ojala puedan solucionar mi problema soy flasher adicto a esta pagina desde hace varios meses y hasta ahora me animo a postear algo sobre una duda que tengo .
Les mando todo el codigo . La cuestion es q funciona pero quisiera que funcionara con bucles pero para eso tengo q aumentar la ultima instancia en "1". A primera vista parece facil pero nose hay algo raro alli :shock: .... o no? :lol: .

El archivo SOL :muestra :
¿ |TCSO  gol p1 1 p2 2 p3 2 p4 1 p5 5 p6 1 p7 p8 p9 p10 p11 p12

Pd: acuerdense que el archivo SOL se ubica en :
C:\Documents and Settings\David\Datos de programa\Macromedia\Flash Player\#SharedObjects\87UHC6NC\localhost\Documents and Settings\David\Escritorio\fixture2006.swf
Pd: En mi caso se ubica alli :wink:

Osea por esa parte no hay problema .

Y aqui viene el codigo. :


import mx.containers.Accordion;
import mx.core.View;
var ac:Object = this.createClassObject(Accordion,"acor",this.getNextHighestDepth() );
ac.move(20,30);
ac.setSize(390,350);


acor.createChild(View,"f1",{label:"primera fecha"} );
var objf1:Object = acor.f1.createChild("fecha1","fecha1");
objf1.move(185,120);
acor.createChild(View,"f2",{label:"segunda fecha"} );
var objf2:Object = acor.f2.createChild("fecha2","fecha2");
objf2.move(185,120);
acor.createChild(View,"f3",{label:"tercera fecha"} );
var objf3:Object = acor.f3.createChild("fecha3","fecha3");
objf3.move(185,120);
acor.createChild(View,"f4",{label:"cuarta fecha"} );
var objf4:Object = acor.f4.createChild("fecha4","fecha4");
objf4.move(185,120);

var obj1:SharedObject = SharedObject.getLocal("gol");



// Se daran cuenta creo el acordion dinamicamente luego dentro del acordion
// creo un hijo llamado "f1" y dentro de el jalo un clip de video "fecha1" .Hasta aqui bien
// pero cuando quiero hacerlo con bucles no encuentro la forma de que el valor del shared object pase
// a la instancia "v1" para que lo muestre en su respectivo TextField .Entonces ? que hacer en estos casos.

// --------------------------------------------------------------------------------------
// 1ra prueba
//oc ="acor.f1.fecha1.v"+1; ----- > No funciona esta estretegia...
// oc.text = obj1.data.p1;
// ---------------------------------------------------------------------------------------

// 2da prueba
//i=1;
// this["acor.f1.fecha1.v"+i].text = obj1.data.p1; --> Con esta solucion tampoco me sale....



//acor.f1.fecha1.v1.text = obj1.data.p1; // Si funciona pero no me gusta es demasiado repetitivo el codigo aggg.



acor.f1.fecha1.v2.text = obj1.data.p2;
acor.f1.fecha1.v3.text = obj1.data.p3;
acor.f1.fecha1.v4.text = obj1.data.p4;
acor.f1.fecha1.v5.text = obj1.data.p5;
acor.f1.fecha1.v6.text = obj1.data.p6;
acor.f1.fecha1.v7.text = obj1.data.p7;
acor.f1.fecha1.v8.text = obj1.data.p8;
acor.f1.fecha1.v9.text = obj1.data.p9;
acor.f1.fecha1.v10.text = obj1.data.p10;
acor.f1.fecha1.v11.text = obj1.data.p11;
acor.f1.fecha1.v12.text = obj1.data.p12;


mod_btn.onRelease = function ()
{
obj1.data.p1 = acor.f1.fecha1.v1.text ;
obj1.data.p2 = acor.f1.fecha1.v2.text ;
obj1.data.p3 = acor.f1.fecha1.v3.text ;
obj1.data.p4 = acor.f1.fecha1.v4.text ;
obj1.data.p5 = acor.f1.fecha1.v5.text ;
obj1.data.p6 = acor.f1.fecha1.v6.text ;
obj1.data.p7 = acor.f1.fecha1.v7.text ;
obj1.data.p8 = acor.f1.fecha1.v8.text ;
obj1.data.p9 = acor.f1.fecha1.v9.text ;
obj1.data.p10 = acor.f1.fecha1.v10.text ;
obj1.data.p11 = acor.f1.fecha1.v11.text ;
obj1.data.p12 = acor.f1.fecha1.v12.text ;
}

// Gracias si alguien la sabe me ayuda me quedo hasta tarde siempre GRACIAS....




<IMG SRC="http://davo25.iespana.es/fechas.JPG">
Aqui aparece el enlace de como se ve la imagen.


Por davo25

183 de clabLevel



 

Lima - Peru

msie
Citar            
MensajeEscrito el 12 Mar 2006 02:36 am
Ya me salio esto luego de encontrar un codigo de otro tema :) :) miren
:

acor.f1.fecha1.v1.text = obj1.data.p1;

y debe ser asi : :) :)

acor.f1.fecha1["v"+i].text = obj1.data["p"+i] ;

y en bucle... y ahorras hartas lineas de codigo locazo noooo 8) 8) 8)

Por davo25

183 de clabLevel



 

Lima - Peru

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.