Autor Mensaje

Chamil



Mensajes: 3
Registrado: 26 Mar 2009

MensajePublicado: Jue Ene 21, 2010 12:24 pm    
Asunto: Enmascarar imagenes dinámicas
Responder citando

Hola!
Estoy queriendo hacer un slideshow con xml. Conseguí uno que que es muy simple, justo lo que necesito, el problema es que necesito enmascarar las fotos, o por lo menos taparles una parte.
Pero en el AS carga la imagen con "getNextHighestDepth" y me tapa todo lo que le ponga encima, ademas que no me respeta las máscar que le pongo.
Acá dejo el código a ver si alguien sabe cómo puedo hacerlo, muchas gracias!!!

Código:
  1. import mx.transitions.Tween;
  2. import mx.transitions.easing.*;
  3. import mx.xpath.XPathAPI;
  4. var delay:Number;
  5. var animationDuration:Number;
  6. var current_num:Number = 0;
  7. var first_num:Number = 0;
  8. var image_holder:MovieClip = this.createEmptyMovieClip("image_holder", this.getNextHighestDepth());
  9. var mcl_lis:Object = new Object();
  10. var mcl:MovieClipLoader = new MovieClipLoader();
  11. mcl.addListener(mcl_lis);
  12. var xml:XML = new XML();
  13. xml.ignoreWhite = true;
  14. xml.onLoad = function( isLoaded:Boolean )
  15. {
  16.    if( isLoaded )
  17.    {
  18.       data_arr = XPathAPI.selectNodeList(this.firstChild,"Slideshow/images/image");
  19.       delay = parseInt(XPathAPI.selectSingleNode(this.firstChild,"Slideshow/settings/delay").firstChild);
  20.       animationDuration = parseInt(XPathAPI.selectSingleNode(this.firstChild,"Slideshow/settings/animationDuration").firstChild);
  21.       //optional code to check delay and animationDuration values
  22.       (delay == undefined || delay == null) ? delay = 5000: delay<1000? delay =1000:true;
  23.       (animationDuration == undefined || animationDuration == null) ? animationDuration = .8: animationDuration<.3? animationDuration =.8:true;
  24.       load_image();
  25.    }else
  26.    {
  27.       trace("XML Load error");
  28.    }
  29. }
  30. xml.load("XML/data.xml")
  31. function load_image()
  32. {
  33.    mcl.loadClip(data_arr[current_num].attributes.url, image_holder);
  34.    (current_num>=data_arr.length-1) ? current_num = first_num:current_num++;
  35. }
  36. mcl_lis.onLoadInit = function(target_mc:MovieClip) {
  37.    var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 0, 100, .5, true);
  38.       setTimeout(function(){
  39.                         var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 100, 0, .5, true);
  40.                            obj.onMotionFinished = function() {load_image();};
  41.                       },5000);//duración
  42. };


_________________
www.amilcardg.com.ar
Mostrar mensajes de anteriores:   
Página 1 de 1 Todas las horas son CST (U.S./Canadá)
Cambiar a:  

 
Puede publicar nuevos temas en este foro
No puede responder a temas en este foro
No puede editar sus mensajes en este foro
No puede borrar sus mensajes en este foro
No puede votar en encuestas en este foro

Powered by phpBB © 2001, 2002 phpBB Group