Comunidad de diseño web y desarrollo en internet online

Ayuda AS 2

Citar            
MensajeEscrito el 21 Ago 2005 06:32 pm
Que tranza banda:

Expongo este mensaje por que tengo una duda que eh intentado resolver por mi mismo, pero no he podido, así que pense en exponerla en este foro.

Es asunto esta así:

Descarge de una pagina un ejemploo de Flash de un Menu, que a mi gusto esta chido, pero lo malo es que esta en AS 1, y lo necesito para AS 2.0. Creo que el problema se debe a eso por que al intentar publicarlo me manda el error y en el archivo original, no manda ningun error

EL problema esta en la Línea 107 y dice que el tipo no coincide, esta es la línea:

Código :

grow_mc.bg_mc._width += parseInt((maxWidth-grow_mc.bg_mc._width)/easingSpeed);


Aquí esta el codigo para que vean si el problema es solo esa línea o en alguna otra parte del codigo:

Código :

_global.printf = function() {
   str = "";
   for (var i = 0; i<arguments.length; i++) {
      str += arguments[i]+", ";
   }
   trace(str);
};
function init() {
   space = 5;
   easingSpeed = 2;
   minWidth = 28;
   maxWidth = 223;
   // waiting delay to start resizing
   selectedItem = 0;
   // item nad ktorym bola naposledy mys, ak je roll out tak ho vynuluje na clickedItem
   clickedItem = 0;
   // last clicked item
   growingItem = null;
   reducingItem = null;
   // selectedItem after growTime frames
   growDelay = 5;
   // frames
   growTime = 0;
   // 
   // visual settings
   items_arr = [];
   this.createEmptyMovieClip("updater_mc", -2).onEnterFrame = update;
   // ----------------
   textanimTime = 0;
   textanimDuration = 25;
   this.createEmptyMovieClip("textanim_mc", -1);
}
function addItem(label, data) {
   var i = items_arr.length;
   if (i == 0) {
      data.id = 0;
      data.mc = item0_mc;
      data.smalltext = label;
      items_arr.push(data);
   } else {
      data.id = i;
      data.mc = item0_mc.duplicateMovieClip("item"+i+"_mc", i);
      data.smalltext = label;
      items_arr.push(data);
   }
   data.mc.id = i;
   data.mc.label = label;
   data.mc._x = i*(minWidth+space);
   //
   totalWidth = ((items_arr.length-1)*minWidth)+maxWidth+(items_arr.length-1)*space;
}
function startTextAnimation(oldId, newId) {
   //duration = 20
   //printf("//",newId,items_arr[newId].smallText);
   items_arr[oldId].mc.label = items_arr[oldId].smallText;
   //items_arr[newId].mc.label = items_arr[newId].smallText +":"+ items_arr[newId].text
   var strlen = items_arr[newId].text.length;
   textanim_mc.onEnterFrame = function() {
      var rndstr = "";
      //
      if ((textanimDuration-textanimTime)<strlen) {
         rndstr += items_arr[newId].text.substr(0, strlen-(textanimDuration-textanimTime));
         for (var i = 0; i<(textanimDuration-textanimTime); i++) {
            rndstr += String.fromCharCode(random(100)+30);
         }
      } else {
         for (var i = 0; i<strlen; i++) {
            rndstr += String.fromCharCode(random(50)+20);
         }
      }
      items_arr[newId].mc.label = items_arr[newId].smallText+":"+rndstr;
      //         
      if (textanimTime++>textanimDuration) {
         items_arr[newId].mc.label = items_arr[newId].smallText+":"+items_arr[newId].text;
         textanimTime = 0;
         delete this.onEnterFrame;
      }
   };
}
function selectItem(itemId) {
   growTime = 0;
   selectedItem = itemId;
   //
   totalWidth = maxWidth+(items_arr.length)*(minWidth+space)-space;
}
function deselectItem(itemId) {
   growTime = 0;
   selectedItem = clickedItem;
}
function clickItem(itemId) {
   clickedItem = itemId;
}
function update() {
   // trace(growTime+"//"+growingItem+"//"+selectedItem);
   // printf ("gi si ci",growingItem, selectedItem,clickedItem)
   if (growTime++ == growDelay && growingItem != selectedItem) {
      // 
      textanimTime = 0;
      startTextAnimation(growingItem, selectedItem);
      //
      reducingItem = growingItem;
      growingItem = selectedItem;
   }
   var grow_mc = items_arr[growingItem].mc;
   var reducing_mc = items_arr[reducingItem].mc;
   // LINEA 107
grow_mc.bg_mc._width+=parseInt((maxWidth-grow_mc.bg_mc._width)/easingSpeed);
   var restWidth = totalWidth-grow_mc.bg_mc._width-(items_arr.length-1)*(space+minWidth);
   reducing_mc.bg_mc._width = restWidth;
   var sumWidth = 0;
   //printf(restWidth, reducing_mc, grow_mc);
   for (var i = 0; i<items_arr.length; i++) {
      var item = items_arr[i].mc;
      item._x = sumWidth;
      sumWidth += item.bg_mc._width+space;
   }
}
init();



Otra duda que tengo es:
¿Como puedo realizar el efecto de las letras como el que aparece en www.fortminor.com?

en este ejemplo que les puse arriba sale algo similar, pero no se como aplicarlo a un texto X.

Bien, es todo, espero me ayuden y gracias por molestarse en leer mis dudas.

[moderador]use las etiquetas code para postear codigo y ofrecer una mejor lectura de su post[/moderador]

Por jjjuan_0

4 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 22 Ago 2005 01:26 am
Con respecto al efecto de las letras, visita el foro del BOFH fael, ahí lo tiene bien explicado. :wink:

De lo otro NPI, nunca usé as1, sorry.

Por La100rra

Claber

5776 de clabLevel

11 tutoriales
4 articulos

Genero:Masculino  

Cd. Juárez, Chihuahua, México.

clabbrowser

 

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