Chamil
Mensajes: 3 Registrado: 26 Mar 2009
|
Publicado:
Jue Ene 21, 2010 12:24 pm
Asunto:
Enmascarar imagenes dinámicas |
|
|
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: |
- import mx.transitions.Tween;
- import mx.transitions.easing.*;
- import mx.xpath.XPathAPI;
- var delay:Number;
- var animationDuration:Number;
- var current_num:Number = 0;
- var first_num:Number = 0;
- var image_holder:MovieClip = this.createEmptyMovieClip("image_holder", this.getNextHighestDepth());
- var mcl_lis:Object = new Object();
- var mcl:MovieClipLoader = new MovieClipLoader();
- mcl.addListener(mcl_lis);
- var xml:XML = new XML();
- xml.ignoreWhite = true;
- xml.onLoad = function( isLoaded:Boolean )
- {
- if( isLoaded )
- {
- data_arr = XPathAPI.selectNodeList(this.firstChild,"Slideshow/images/image");
- delay = parseInt(XPathAPI.selectSingleNode(this.firstChild,"Slideshow/settings/delay").firstChild);
- animationDuration = parseInt(XPathAPI.selectSingleNode(this.firstChild,"Slideshow/settings/animationDuration").firstChild);
- //optional code to check delay and animationDuration values
- (delay == undefined || delay == null) ? delay = 5000: delay<1000? delay =1000:true;
- (animationDuration == undefined || animationDuration == null) ? animationDuration = .8: animationDuration<.3? animationDuration =.8:true;
- load_image();
- }else
- {
- trace("XML Load error");
- }
- }
- xml.load("XML/data.xml")
-
- function load_image()
- {
- mcl.loadClip(data_arr[current_num].attributes.url, image_holder);
- (current_num>=data_arr.length-1) ? current_num = first_num:current_num++;
- }
-
- mcl_lis.onLoadInit = function(target_mc:MovieClip) {
- var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 0, 100, .5, true);
- setTimeout(function(){
- var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 100, 0, .5, true);
- obj.onMotionFinished = function() {load_image();};
- },5000);//duración
- };
|
_________________ www.amilcardg.com.ar |
|