Posted By

n00ge on 11/08/07


Tagged

actionscript slideshow fusekit


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

gasface
arala22
jmelgoza
crashdr
sebastianassaf
abdsign


XML Slideshow


 / Published in: ActionScript
 

This is a XML based slideshow that uses FuseKit for transitions.

  1. import com.mosesSupposes.fuse.*;
  2. ZigoEngine.register(Fuse, PennerEasing, FuseFMP);
  3.  
  4. function loadXML(loaded) {
  5. if (loaded) {
  6. xmlcontent = this.${1:firstChild};
  7. loadPics();
  8. } else {
  9. trace("file not loaded!");
  10. }
  11. }
  12. xmlData = new XML();
  13. xmlData.ignoreWhite = true;
  14. xmlData.onLoad = loadXML;
  15. xmlData.load(${2:"$3"});
  16.  
  17. function loadPics(){
  18. if(picsint) clearInterval(picsint);
  19. if(!nexti) nexti = 0;
  20. targetpic = xmlcontent.{$4:childNodes[nexti].firstChild.nodeValue};
  21. thepic_mc = ${5:pic_mc}.createEmptyMovieClip("thepic_mc", $5.getNextHighestDepth());
  22. thepic_mc._x = 0;
  23. thepic_mc._y = 0;
  24. var my_mcl:MovieClipLoader = new MovieClipLoader();
  25. var mclListener:Object = new Object();
  26. mclListener.onLoadStart = function(target_mc:MovieClip) {
  27. trace("loading pic");
  28. }
  29. mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
  30.  
  31. }
  32. mclListener.onLoadComplete = function(target_mc:MovieClip) {
  33.  
  34. }
  35. mclListener.onLoadInit = function(target_mc:MovieClip) {
  36. trace("load init");
  37. picsint = setInterval(loadPics,${6:5000});
  38. var f:Fuse = new Fuse();
  39. f.push({target:target_mc, ${7:brightOffset}:${8:100}, time:0});
  40. f.push({target:target_mc, $7:${9:0}, time:${10:2}, ease:"easeOutQuad"});
  41. f.start();
  42. }
  43. mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
  44. trace("error loading movie: " + errorCode);
  45. loadPics();
  46. }
  47. my_mcl.addListener(mclListener);
  48. my_mcl.loadClip(targetpic, thepic_mc);
  49.  
  50. nexti++;
  51. if(nexti >= xmlcontent.childNodes.length) nexti = 0;
  52. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: arala22 on January 15, 2008

is there a link to the XML file associated with this?

You need to login to post a comment.