Advertisement
WindowsTV

Untitled

Oct 27th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var myXML:XML = new XML();
  2. myXML.ignoreWhite=true;
  3. myXML.load("oman3d.xml");
  4. myXML.onLoad = function(success)
  5. {
  6.     if (success)
  7.     {
  8.         var myImage = myXML.firstChild.childNodes;
  9.         for (i=0; i<myImage.length; i++)
  10.         {
  11.             var imageNumber = i+1;
  12.                 var imageName = myImage[i].attributes.name;
  13.                 var imageURL = myImage[i].firstChild.nodeValue;
  14.                 images_container['img' + imageNumber + '_mc'].loadMovie(imageURL);
  15.                 makeButton(imageNumber);
  16.             trace ("Image number: "+imageNumber+" is titled "+imageName+" and its URL is "+imageURL+".");
  17.         }//end for
  18.     }//end if
  19. };// end of function
  20. function makeButton(name)
  21. {
  22.     var mc = this['img' + name + "_btn"];
  23.     mc.name = name;
  24.     mc.onRelease = function ()
  25.     {
  26.         trace (mc.name + "_clicked");
  27.     };
  28.     mc.onRollOver = function ()
  29.     {
  30.         trace (mc.name + "_hover");
  31.     };
  32. } // End of the function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement