Jump to content
Search Community

Dynamic image scrolling

mhmda test
Moderator Tag

Recommended Posts



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
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();
if(i>0) shownews();
function shownews()
TweenMax.to(my_news[0], 1, {x:0});


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

Link to comment
Share on other sites

I suggest you add a trace() right before the tween to see if you're calling that method multiple times (I bet you are). Is your code in the root timeline? If so, does that timeline have more than one frame and is it looping (no stop() call)? That'd explain the behavior. I'm pretty sure it has nothing to do with TweenMax.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...