Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/05/2008, 05:35
Flober
 
Fecha de Ingreso: junio-2005
Mensajes: 33
Antigüedad: 18 años, 10 meses
Puntos: 0
Respuesta: ScrollBar y varias instancias a Duplicate Movie Clip

Vale, ya he conseguido cargar los duplicados en el contenedor, pongo el código más abajo por si alguien lo necesita. Pero ahora no me funciona la máscara ni los botones del scroll, me da el siguiente error:

Error: No se pudo efectuar la acción 'with' porque el objeto especificado no existe.


Este es el código de la máscara:
Código:
_root.createEmptyMovieClip("mc_msk", 301);
mc_msk._x = 180;
mc_msk._y = 320;

with (mc_msk) {
beginFill(0xff0000,50);
lineStyle(1,0x00ff00,100);
lineTo(200,0);
lineTo(200,200);
lineTo(0,200);
lineTo(0,0);
endFill();
}

_root.contenedor.setMask(mc_msk);
}
Y este el de los botones:

Código:
on (release) {
if (_root.contenedor._y < _root.mc_msk._y) {
_root.contenedor._y += _root.intSeparar;
}
}
Código:
on (release) {
if (_root.contenedor._y > _root.mc_msk._height - _root.contenedor._height) {
_root.contenedor._y -= _root.intSeparar;
}
}
Puede alguien ayudarme, sé que os estoy pidiendo mucho pero como os dije, estoy empezando y me resulta un poco complicado. Muchas gracias por vuestra paciencia.

Este es el código que a mi me ha funcionada, por si alguien lo necesita, para cargar los datos en el contenedor:

Código:
System.useCodepage = true;
// Creamos el objeto que guardará los datos del archivo XML
cursosXML = new XML();
cursosXML.ignoreWhite = true;
//Cargamos el archivo XML en el objeto recién creado
cursosXML.load("http://localhost/valores/cargaCursos.php");
// Cuando termina de cargar lo mandamos a organizar para poder mostrar los datos
cursosXML.onLoad = organizarXML;
stop();
// Esta es la función encargada de armar los Arrays a partir de los datos
function organizarXML() {

curso = new Array();

for (yy=0; yy<cursosXML.firstChild.childNodes.length; yy++) {

obj = new Object();
obj.nombre = cursosXML.firstChild.childNodes[yy].attributes.nombre;
obj.fechaI = cursosXML.firstChild.childNodes[yy].attributes.fechaI;
obj.fechaF = cursosXML.firstChild.childNodes[yy].attributes.fechaF;

curso.push(obj);
delete obj;
}
// Mandamos los datos ya organizados a que se muestren (la función está más abajo)
mostrarDatos();
}


function mostrarDatos() {

_root.createEmptyMovieClip("contenedor", 300);
_root.contenedor._x = 180;
_root.contenedor._y = 320;

separacionHorizontal=10;
separacionVertical=45;
intSeparar=50;

intPosicion = 0;

for (aa=0; aa<curso.length; aa++) {
_root.contenedor.attachMovie("curso", "curso"+aa, aa);
_root.contenedor["curso"+aa]._y = (intPosicion * separacionVertical);
_root.contenedor["curso"+aa]._x =_root.contenedor["curso"+(aa-1)]._x+(separacionHorizontal);
_root.contenedor["curso"+aa].nombre.text = curso[aa].nombre;
_root.contenedor["curso"+aa].fechaI.text = curso[aa].fechaI;
_root.contenedor["curso"+aa].fechaF.text = curso[aa].fechaF;

intPosicion++;
}