Comunidad de diseño web y desarrollo en internet online

Problema de _root, perdí el camino... =)

Citar            
MensajeEscrito el 07 Nov 2008 09:18 am
Hola, me ayuda alguien? Si entiende esto y me pueden ayudar, bienvenidos!
El swf se llama Galeria y lo cargo desde un escenario_mc dentro de otro swf. Lo carga y barbaro, pero el tema es que si cargo del escenario_mc con otro swf se cruzan las rutas...Cuelgo el codigo entero, y cuelgo la parte del mismo codigo que me parece que hay lio de rutas...

Este es el codigo de la galeria:

Código :

this._lockroot = true;
var imgNum;
var t   = 1;
var yy = 415;

var cargando = true;

var xx = 103;

var imgSelected = null;

var imgLoader   = new MovieClipLoader();


imgLoader.onLoadProgress = function (targetMC, loadedBytes, totalBytes){

   _root["imgBtn"+t].porcentaje_txt.text = Math.round((loadedBytes/totalBytes) * 100)+ "%";
}
imgLoader.onLoadComplete = function (targetMC){

   _root["imgBtn"+t].gotoAndStop("cargado");
   _root["imgBtn"+t].imgToShow = _root["img"+t];
   _root["imgBtn"+t].porcentaje_txt.text = t;

   if(t == 1){
      // _alpha del clip de película a 0
      _root["img"+t]._alpha = 0;
      //Definimos cual es la imagen seleccionada
      imgSelected = _root["img"+t];
      //efecto de "fade in" en las imagenes
         imgSelected.onEnterFrame = function(){
         if (imgSelected._alpha<100){
         imgSelected._alpha=imgSelected._alpha+5;
         }}
   }
   t++;
   loadImg();
}

loadImg = function(){

if(xx > (Stage.width - 150)){
         xx = 103;
         yy = 460;
      }
   if(t <= imgNum){
      
      this.attachMovie("imgBtn", "imgBtn"+t, this.getNextHighestDepth());
      this["imgBtn"+t]._x = xx;
      this["imgBtn"+t]._y = yy;
      this.createEmptyMovieClip("img" + t, this.getNextHighestDepth());
      this["img"+t]._x = 147;
      this["img"+t]._y = 5;
      this["img"+t]._alpha = 0;
      imgLoader.loadClip("../Imagenes/"+t+".jpg", _root["img"+t]);
   }
   xx +=60;
}
//Llamamos a la función LoadImg()
loadImg();
stop();

this.onUnload=function(){
   if(cargando == true){
      this._lockroot = false;
      }
}

this.onEnterFrame = function(){
   if(imgNum == (t-1)){
      cargando = false;
   }
   if(_ymouse < 0){
      if(cargando == false){
      this._lockroot = false;
      }
   }
   if(_ymouse > 0){
      this._lockroot = true;
   }
   
}


(Al principio, tranca la ruta)
Esta parte es la que trata las rutas, no la entiendo bien...

Código :

this.onUnload=function(){
   if(cargando == true){
      this._lockroot = false;
      }
}

this.onEnterFrame = function(){
   if(imgNum == (t-1)){
      cargando = false;
   }
   if(_ymouse < 0){
      if(cargando == false){
      this._lockroot = false;
      }
   }
   if(_ymouse > 0){
      this._lockroot = true;
   }
}

Por Martin12345

2 de clabLevel



 

firefox
Citar            
MensajeEscrito el 09 Nov 2008 03:56 pm
La ruta es siempre la del archivo principal, si cargas en el un archivo secundario que no está en el mismo directorio, debes adecuar las rutas como si estuvieran desde el principal

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 09 Nov 2008 05:48 pm
Jorge, gracias por la respuesta pero sigo aca en eso y no se como hacer con la ruta, de ultima lo metere todo en el swf principal y listo... =P

Gracias de todas formas!

Por Martin12345

2 de clabLevel



 

firefox

 

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