engo una duda respectoa como hacer esa cuestión explico brevemente:
Estoy simuladno los datos que necesito recibir en un arreglo, del cual extraigo datos apra posicionar monitos en el escenario, a estos necesito definirle sus datos de X,Y, Nombre, y Puesto, sin embargo estoy en un dilema como los extraigo de la base (MySQL) y los paso a flash (con PHP).
Estuv revisando uno stutoriale s de hacerlo como cadena y después separarla sin embargo lo veo elaborado por los datos que tengo que separar. Pensaba en traerme los datos desde un xml pero no se si sea funcional.
Que me recomiendan??? Gracias de antemano
Escribo el código que uso para el posicionamiento.
Código :
function CreaColega() {
//construimos el arreglo de objetos
miArreglo = new Array();
miArreglo = [{DeptoID:1, Nombre:"Erwin", x:179, y:320, col:"ROJO", Puesto:"PROGRAMADOR"}, {DeptoID:2, Nombre:"Fernando", x:130, y:126, col:"AZUL", Puesto:"DBA"}, {DeptoID:1, Nombre:"Maribel", x:110, y:317, col:"VERDE", Puesto:"SUPERVISOR"}, {DeptoID:3, Nombre:"Karla", x:229, y:468, col:"VERDE", Puesto:"PUBLIC RELATIONS"}, {DeptoID:4, Nombre:"Yunuen", x:555, y:324, col:"NARANJA", Puesto:"ADVISER"}, {DeptoID:2, Nombre:"Edgar", x:450, y:326, col:"ROJO", Puesto:" DESIGN LEADER"}, {DeptoID:3, Nombre:"Joy", x:345, y:322, col:"AZUL", Puesto:"DEVELOPER"}, {DeptoID:2, Nombre:"Martin", x:120, y:480, col:"ROJO", Puesto:"SUPERVISOR"}, {DeptoID:3, Nombre:"Ian", x:443, y:169, col:"VERDE", Puesto:"ANALYST"}, {DeptoID:4, Nombre:"Carmen", x:456, y:470, col:"AZUL", Puesto:"TESTER"}];
for (var z = 0; z < miArreglo.length; z++) {
var nuevoColega = "colega" + z;
Colega_id = miArreglo[z].DeptoID;
Colega_nom = miArreglo[z].Nombre;
Colega_pues = miArreglo[z].Puesto;
Colega_equis = miArreglo[z].x;
Colega_ye = miArreglo[z].y;
Colega_color = miArreglo[z].col;
//duplicamos la instancia
_root.colega.duplicateMovieClip(nuevoColega,z + 1);
//posicionamos el colega
this[nuevoColega]._x = Colega_equis;
this[nuevoColega]._y = Colega_ye;
//definimos su color
this[nuevoColega].gotoAndStop(Colega_color);
//definimos sus datos a mostrar
this[nuevoColega].globo.gotoAndStop("detalle");
this[nuevoColega].globo.dnombre.text = Colega_nom;
this[nuevoColega].globo.dpuesto.text = Colega_pues;
trace("crea instancia " + Colega_nom + " en x: " + Colega_equis + " y:" + Colega_ye);
//funciones para el control del drag
this[nuevoColega].onPress = function() {
this.swapDepths(50);
startDrag(this, true, 110, 150, 740, 520);
};
this[nuevoColega].onRelease = function() {
this.swapDepths(50);
this.stopDrag();
//revisaEstatus(this);
};
this[nuevoColega].onReleaseOutside = function() {
this.stopDrag();
//revisaEstatus(this);
};
}
}
CreaColega(); 