Comunidad de diseño web y desarrollo en internet online

Error #2035: No se encuentra la dirección URL.

Citar            
MensajeEscrito el 10 Jun 2011 04:36 pm
Si quieréis lo puedo traduir al español tambien.

Hi
I am trying to load an swf into another swf as part of a course. I try to pass in some parameters to the getData function within the new swf but an error is show,
I am testing by hardcoding values where I would normally use variables. The definitionsArray is where the problem lies.
I tested the new game by harcoding the values instead of passing them in and it was loaded successfully. However when I send the same details to the SAME FUNCTION of getData game from the container/ loader it throws the above error. The ERROR is thrown on the code highlighted below.
Cheers if you are able to have a quick look. Spent two days on the xml and this and learnt loads but now I'm stuck big time.

Código ActionScript :

main body of code of the loader swf

private function xmlGameDataLoadComplete(e:Event):void
{
xmlGameData = XML(e.target.data);
var objectList:XMLList = XMLList(xmlGameData.object);
this.definitionsArray = new Array();//an array of objects and sounds

//Hard code in the definitionsArray
this.definitionsArray = new Array();
this.definitionsArray.push({ mc:"Apple", sound:"AppleSound" });
this.definitionsArray.push({ mc:"Banana", sound:"BananaSound" });
this.definitionsArray.push({ mc:"Bread", sound:"BreadSound" });
this.definitionsArray.push({ mc:"Cake", sound:"CakeSound" });
this.definitionsArray.push({ mc:"Water", sound:"WaterSound" });
this.definitionsArray.push({ mc:"Tomato", sound:"TomatoSound" });
this.definitionsArray.push({ mc:"Sandwich", sound:"SandwichSound" });
this.definitionsArray.push({ mc:"Pizza", sound:"PizzaSound" });
this.definitionsArray.push({ mc:"Pear", sound:"PearSound" });
this.definitionsArray.push({ mc:"Orange", sound:"OrangeSound" });

dataReadyF();
}

private function dataReadyF():void
{
//booleans to tell which type of game to play - they trace fine
trace(xml.lesson.(@id=="1").game[0]);//trace check = undefined
if (xml.lesson.(@id=="1").game[0].@getDataHigh == undefined)
{
var getDataBool:Boolean = true;
var getDataHighBool:Boolean = false;
}
else
{
getDataHighBool = true;
getDataBool = false;
}
//loaderF("../"+xml..lesson.(@id==starLesson).gamesRoute+xml..lesson.(@id==starLesson).game[0],getDataBool,getDataHighBool)
loaderF("../../games/"+xml.lesson.(@id=="1").game[0],getDataBool,getDataHighBool);
trace("../../games/"+xml.lesson.(@id=="1").game[0]);
}

public function loaderF(urlS:String,sendDataB:Boolean=false,sendDataHighB:Boolean=false):void
{

if (loader.content)
{
loader.unloadAndStop(true);
}
this.sendDataBool = sendDataB;
trace(this.sendDataBool);

this.sendDataHighBool = sendDataHighB;
trace(this.sendDataHighBool);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
loader.load(new URLRequest(urlS));
trace("urlS="+urlS);// ../../animalDragAS3.swf ie: up two levels from revisionKids1.swf
}

private function loadCompleteF(e:Event):void
{

this.libraryRouteX = "library/food.swf";

if (this.sendDataBool)
{

MovieClip(e.target.loader.content).getData(this.libraryRouteX,definitionsArray);//ERROR;
}

if (this.sendDataHighBool)
{

// MovieClip(e.target.loader.content).getDataHigh(1,1);
}
this.addChild(e.target.loader);
}



}

}

code function targeted inside loaded swf game

public function getData(libreria:String, matriz:Array) {
this.definitionsArray = matriz;
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
 
var loader:Loader = new Loader();
            var req:URLRequest = new URLRequest("../"+libreria);

            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoaded);
try{
                loader.load(req, context);
            }catch(e:Error){
                trace("Asset load error: " + e);
            }
this.levelFinal_mc.avatar_mc.gotoAndStop(this.avatarID + 1);
}

Por codeBeast

5 de clabLevel



Genero:Masculino  

chrome
Citar            
MensajeEscrito el 10 Jun 2011 08:35 pm
Para acceder a los datos mira el evento init, que es cuando los objetos cargados están disponibles, no en el evento complete, que es cuando recién ha terminado de cargar.

Y sigue el hilo en español, please

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 10 Jun 2011 08:45 pm
Gracias. Esta solucionado el tema. Era el juego que daba el error. Era ../../libraria - osea el juego tenía que buscar dos carpetas arriba.

Por codeBeast

5 de clabLevel



Genero:Masculino  

chrome

 

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