daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import XML2Object;
  2.  
  3. var slidesData:Object;
  4. var carouselContent:XML = new XML();
  5. carouselContent.ignoreWhite = true;
  6. carouselContent.onLoad = function(success) {
  7.     if (success) {
  8.         // Process config
  9.         var XML2Obj:XML2Object = new XML2Object();
  10.         slidesData = XML2Obj.parseXML(this);
  11.         function getSlides(pageNumber:Number) {
  12.             var slides:Object = slidesData.slides.slide;
  13.             var p:Number = pageNumber-1;
  14.             trace(slides[p].attributes.id);
  15.             trace(slides[p].attributes.thumb);
  16.         }
  17.         getSlides(2);
  18.     } else {
  19.         trace("Cannot find file");
  20.     }
  21. };
  22. carouselContent.load("carousel.xml");
RAW Paste Data
Top