Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 28th, 2012  |  syntax: ActionScript  |  size: 1.60 KB  |  views: 55  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. handleNextLargeImage();
  2. function handleNextLargeImage()
  3. {
  4.         if(?? new large image left (based on xml??))
  5.         {
  6.                 // load large image
  7.                 runTimerAnimation();
  8.         }
  9. }
  10. function runTimerAnimation()
  11. {
  12.         index = 20;
  13.         setup(index);
  14.         intervalId = setInterval(removeObjectMc,1000);
  15. }
  16. function setup(total)
  17. {
  18.         var objectHolder:MovieClip = this.createEmptyMovieClip("objectHolder",100);
  19.         object = xml.firstChild.nextSibling.childNodes;
  20.         totalObjects = total;
  21.         trace("Total objects: "+totalObjects);
  22.                
  23.         for(i=0;i<totalObjects;i++)
  24.         {
  25.                 var objectMc:MovieClip = objectHolder.attachMovie(objectMc,objectName+i,i);
  26.                
  27.                 objectMc.image = object[i].attributes.image;
  28.                 objectMc.id = i;
  29.                 objectMc.isClicked = false;
  30.                 objectMc.isFront = (i == totalObjects - 1);
  31.                 objectMc._x = Math.floor(object[i].attributes.x);
  32.                 objectMc._y = Math.floor(object[i].attributes.y);
  33.                 objectMc.xpos = objectMc._x;
  34.                 objectMc.ypos = objectMc._y;
  35.                
  36.                 applyBlur(objectMc,i);
  37.                 applyScale(objectMc,i);
  38.                
  39.                 var imageHolder:MovieClip = objectMc.createEmptyMovieClip("imageHolder",10);
  40.                 var myImgLoader:MovieClipLoader = new MovieClipLoader();
  41.                 var myImgListener:Object = new Object();
  42.                 myImgListener.onLoadInit=function(target_mc)
  43.                 {
  44.                         target_mc._x = (target_mc._parent._width - target_mc._width)/2
  45.                         target_mc._y = (target_mc._parent._height - target_mc._height)/2
  46.                 }
  47.                 myImgLoader.addListener(myImgListener);
  48.                 myImgLoader.loadClip(imageURL+objectMc.image,imageHolder);
  49.         }
  50. }
  51. function removeObjectMc()
  52. {
  53.         objectHolder[objectName+index].removeMovieClip();
  54.         if(index==0)
  55.                 clearInterval(intervalId)
  56.         else
  57.                 index--;
  58. }
clone this paste RAW Paste Data