Foros del Web » Creando para Internet » Flash y Actionscript »

bitmapdata y xml

Estas en el tema de bitmapdata y xml en el foro de Flash y Actionscript en Foros del Web. hola de nuavo a tod@s tengo un pequeño problema que espero me podais ayudar... he montado un cargador de imagenes con xml. al ser las ...
  #1 (permalink)  
Antiguo 15/12/2009, 02:31
 
Fecha de Ingreso: agosto-2007
Mensajes: 130
Antigüedad: 16 años, 9 meses
Puntos: 0
bitmapdata y xml

hola de nuavo a tod@s

tengo un pequeño problema que espero me podais ayudar...

he montado un cargador de imagenes con xml. al ser las imagenes externas no es posible activar la casilla "permitir suavizado" por lo que lo hago con "bitmapdata". alguna otra vez lo habia hecho pero esta vez no me funciona. a ver si podeis ayudarme a encontrar el error. os pongo el codigo:

Código:
import flash.display.BitmapData;
///////////////////////////////////////////////////////////////
var precarrega_mcl:MovieClipLoader = new MovieClipLoader();
var detector:Object = new Object();
detector.onLoadStart = function() {
	fade0a100(rueda,0.5,null);
};
detector.onLoadProgress = function(loadedBytes, totalBytes) {
};
detector.onLoadComplete = function(clip) {
	fade0a100(clip,0.5,null);
};
precarrega_mcl.addListener(detector);
///////////////////////////////////////////////////////////////

	fichero = "xml/01.xml";
///////////////////////////////////////////////////////////////
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load(fichero);
myXML.ref = _root.fondos.fondo0;
myXML.onLoad = function(succes) {
	if (succes) {
		var raiz = this.firstChild;
		nodes = raiz.childNodes;
		n = nodes.length;
		for (var i = 0; i<nodes.length; i++) {
			this.ref.attachMovie("cont","cont"+i,i+1,{_x:(i*1280)+1280, _y:0, _alpha:100});
			subnodes = nodes[i].childNodes;
			//this.ref["cont"+i].contImg.loadMovie(subnodes[0].firstChild.toString());
			precarrega_mcl.loadClip(subnodes[0].firstChild.toString(),this.ref["cont"+i].contImg);
			img = this.ref["cont"+i].contImg;
			var img_Bmp:BitmapData = new BitmapData(this._width, this._height);
			img_Bmp.draw(img);
			img.attachBitmap(img_Bmp,img.getNextHighestDepth(),"Auto",true);
		}
	} else {
		trace("no XML");
	}
};

stop();
he probado a no utilizar la variable "img", incluso attachar el bitmap en un contenedor diferente por encima del anterior pero tampoco obtengo resultados.

intente crear una variable bitmap para cada contenedor pero me daba error.(var this.ref["img_Bmp"+i]:BitmapData).

tambien cambie el new BitmapData(this._width, this._height) por new BitmapData(img._width, img._height)

alguna idea?

milchisimas gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:41.