Comunidad de diseño web y desarrollo en internet online

Insertar botones en un array

Citar            
MensajeEscrito el 28 Sep 2011 08:33 pm
Hola con todos, tengo el siguiente problema, quiero agregar unos botones que cree en el escenario a un array y lo hice de la siguiente manera:

var arrImgs:Array = new Array( 'btn_uno','btn_dos','btn_tres',
'btn_cuatro','btn_cinco');

Pero al momento de publicar me sale en siguiente error:

Error #2044: IOErrorEvent no controlado: text=Error #2035: No se encuentra la dirección URL.
Error #2044: IOErrorEvent no controlado: text=Error #2035: No se encuentra la dirección URL.
Error #2044: IOErrorEvent no controlado: text=Error #2035: No se encuentra la dirección URL.
Error #2044: IOErrorEvent no controlado: text=Error #2035: No se encuentra la dirección URL.
Error #2044: IOErrorEvent no controlado: text=Error #2035: No se encuentra la dirección URL.

Como podria solucionarlo.

Les dejo el fla.

http://www.megaupload.com/?d=KDIBHO5U

Saludos y gracias por la ayuda que me brinden.

Por EparionaD

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 Sep 2011 08:44 pm
Eso no tiene nada que ver con un array.

Ese error es que estas tratando de "cargar" algo de una URL externa y la ruta no existe.

Por Tmeister

260 de clabLevel

2 tutoriales

 

chrome
Citar            
MensajeEscrito el 28 Sep 2011 09:25 pm
Lo que intento es llenar el array con los botones que estan en el escenario, para luego ordenarlos, utilizo este código:

var arrImgs:Array = new Array( 'btn_uno','btn_dos','btn_tres',
'btn_cuatro','btn_cinco');

var cX:Number = stage.stageWidth / 2;
var cY:Number = stage.stageHeight / 2;
var distX:uint = 120;

for( var i:uint = 0; i < arrImgs.length; i++ ){

var mcImg:MovieClip = new MovieClip();


mcImg.x = cX + ( distX * i );
mcImg.y = cY;

mcImg.origenX = mcImg.x;
var imgLdr:Loader = new Loader();
imgLdr.contentLoaderInfo.addEventListener( Event.COMPLETE, fCentrarImagen );
imgLdr.load( new URLRequest( arrImgs[ i ] ) );
mcImg.addChild( imgLdr );
addChild( mcImg );
}

function fCentrarImagen( evt:Event ):void {
evt.currentTarget.loader.x = - ( evt.currentTarget.width / 2 );
evt.currentTarget.loader.y = - ( evt.currentTarget.height / 2 );
}

Con esto entiendo que no estoy llenando bien el array, es por eso que me sale este error.

Por EparionaD

1 de clabLevel



 

firefox

 

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