Jump to content
Search Community

mhmda

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by mhmda

  1. Hi,

     

    I'm loading the images dynimaclly and create an array of movieclip after that I want to tween the array of the images one by one, but something weared happened:-> the first mc loops and loops...

     

    here is my code:

     

    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.plugins.*;
    var j,ptr:int;
    var imageLoader:Loader;
    var news:XML;
    var newslist:XMLList;
    var xmlLoader:URLLoader = new URLLoader();
    var my_news:Array = []; 
    
    xmlLoader.load(new URLRequest("adn.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    
    function xmlLoaded(event:Event):void
    {
    news=XML(event.target.data);
    newslist =news.news.image.attributes();
    for (var i:int = 0; i < newslist.length(); i++)
    {
     imageLoader = new Loader();
     imageLoader.load(new URLRequest(newslist[i]));
     imageLoader.x = 0;
     imageLoader.y = 0;
     var mc:MovieClip = new MovieClip();
     mc.addChild(imageLoader);
     my_news[i]=mc;
    }
    if(i>0) shownews();
    }
    function shownews()
    {
    stage.addChild(my_news[0]);
    my_news[0].x=-600;
    TweenMax.to(my_news[0], 1, {x:0});
    }
    

     

    The my_news[0] loops and never stops :?:

×
×
  • Create New...