Hi, John, The first reference to "cloudTween" I see is here:
cloudTween.addEventListener(TweenEvent.MOTION_FINISH, restartAnimation); So I'm guessing you need to declare and assign that object before you try attaching an event listener to it. In the future, the quality of the feedback you'll get will reflect the effort you put into describing the problem. "It ain't working" isn't helpful for someone analysing: Throws an exception? Doesn't compile? Animation starts but then doesn't loop? -joanthan On Mon, Apr 26, 2010 at 10:02 AM, John Singleton <johnsingleton...@yahoo.com > wrote: > Hi; > I would like to have a background image of clouds loop infinitely.Here's my > code: > > function BigPic():void > { > parent_container2 = new MovieClip(); > var square:Sprite = new Sprite(); > parent_container2.mask = square; > addChild(square); > square.graphics.lineStyle(3,0x065566); > square.graphics.beginFill(0xffffff); > > square.graphics.drawRoundRect(22, 22, 966, 146, 20); > > square.graphics.endFill(); > addChild(parent_container2) > var path:String = "images/clouds.png"; > var > req:URLRequest = new URLRequest(path); > var loader:Loader = new Loader(); > loader.load(req); > > loader.addEventListener(IOErrorEvent.IO_ERROR, > function(e:IOErrorEvent):void{ trace(e) }); > > loader.contentLoaderInfo.addEventListener(Event.COMPLETE, BigPicLoaded); > } > > function BigPicLoaded(evt:Event):void > { > var > loaderInfo:LoaderInfo = evt.target as LoaderInfo; > var > displayObject:DisplayObject = loaderInfo.content; > > displayObject.width = 2000; > displayObject.height = 150; > displayObject.x = 20; > displayObject.y = 20; > parent_container2.addChild(displayObject); > // > TweenLite.to(parent_container2, 50, {x:-1000}); > > cloudTween.addEventListener(TweenEvent.MOTION_FINISH, restartAnimation); > } > > function restartAnimation(oEvent:Event):void > { > cloudTween.start(); > } > > But it ain't working. Ideas? > TIA, > John > > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- -jonathan howe _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders