Jump to content
Search Community

bonassus

Members
  • Posts

    51
  • Joined

  • Last visited

bonassus's Achievements

1

Reputation

  1. Thanks, for the resopnce Carl! I actualy just got there on my own. The animateIn() function is a method defined in object1 that returns a tweenLite instance. public function animateOut() :TweenLite{ return TweenLite.to(_content, .3, {y:100}); } wich you can add to your timeline tl = new TimelineMax({paused:true}); tl.add([object1.animateIn(), object2.animateIn(), object3.animateIn()], 0, "sequence", -.2); Duh. I like your use of inline function to generate the tweenlite object. thats for sharing that. I think im on the right track now. Also thanks for the link to the video, i will watch it now as i am sometimes oop terrified. B
  2. I'm trying to understand how to implement a suggestion made in the the Greensocks Documentation. In The TimelineLite Docs http://api.greensock.com/as/com/greensock/TimelineLite.html It suggestes: I'm confused about how that would look. If one creates a function animateIn(); that creates and returns a new tweenLite instance. and then is called on myObject with myObject.animateIn(); how would myObject be passed to the target property of the tweenLite? public function animateIn() :TweenLite { var myTween:TweenLite = new TweenLite(mc, 1, {x:100}); return myTween; } I might be missing something fundamental about how this should be set up. help will be appreciated. Thanks!
  3. Thanks Carl, You are always super helpful. I need to do some catching up as I was still using v.11 The .add() method looks very useful. By the way I signed up for the talk you are giving next tuesday which is two blocks from my office. I'm looking forward to it, see you then. B
  4. I'm wondering if there is a way i can use Timelinelite and insertMultiple to stagger function calls on objects in an array maybe with dellaycall? Each object in the array has the same public start(); function. I could do this with the timer class and a loop but im wondering if there is a way to use timelinelite to have improved sequencing control. Sorry i don't have a code example of what im trying to do. Is this crazy talk or am is this a good idea? thanks!
  5. Carl, I am glad to hear that TweenLite handles this situation gracefully. I assumed this probably the case. Thank you for your response. B
  6. If ThrowPropsPlugin.to tween is in progress and a TweenLite.to is triggered the ThrowProps onComplete never runs. what happens to the first tween? Is it still using resorces or do i need to/can I, kill it with TweenLite.killTweensOf or something else that i'm not seeing? ThrowPropsPlugin.to(target, {throwProps:{x:{velocity:movment, min:xValue, max:xValue}},ease:Strong.easeOut,onComplete:tpend},1,.5); if(target.x < 0) { TweenLite.to(target, .5, {x:-600,onComplete:onOffStage, onCompleteParams:[target]}); } Thanks a lot, B
  7. I have read them. when i use rawProgress i get an error: Property rawProgress not found on com.greensock.loading.XMLLoader my loaders are defined in the xml file but my progressHandler is reporting for the xml loader loader = new XMLLoader("data.xml", {onComplete:completeHandler, onProgress:progressHandler}); i don't understand how to get the progress of loaderMax mainQueue. which would calculate all the loaders as on loader. I'm guessing this is obvious but i'm not seeing it. thanks!
  8. I would like to set up a preloader for the all the loaders from an xml file. i nested all the loaders in a mainQueue loaderMax but this didn't work. the progress jumps arround seemingly reporting the progress of each nested loader. how can i get the progress of all loaders? Thanks! <?xml version="1.0" encoding="iso-8859-1"?> <data> <LoaderMax name="mainQueue"> <LoaderMax name="queue_MissA" x="540"y="180" scale="1.5" > <LoaderMax name="actor1"prependURLs="Casting_MP3s/" load="true"> <MP3Loader url="JenTullock_MissA_06.mp3" name="JenTullock_MissA_06" actor="JenTullock"autoPlay="false"/> <MP3Loader url="JenTullock_MissA_07.mp3" name="JenTullock_MissA_07" actor="JenTullock"autoPlay="false"/> </LoaderMax> <LoaderMax name="actor2"prependURLs="Casting_MP3s/" load="true"> <MP3Loader url="JenTullock_MissA_06copy.mp3" name="JenTullock_MissA_06copy"actor="JenTullock"autoPlay="false"/> </LoaderMax> </LoaderMax> </LoaderMax> </data> LoaderMax.activate([MP3Loader]); loader = new XMLLoader("data.xml", {onComplete:completeHandler, onProgress:progressHandler, estimatedBytes:20365992}); loader.load(); function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); var s:int = int(event.target.progress * 100); myProgressBar.progressText.text = "progress: " + s.toString() + "%"; myProgressBar.bar.scaleX = event.target.progress; }
  9. Ok getChildren not content and not getLoaders. Thank you! your help was a real life saver!
  10. Carl, Thank you! I feel a bit silly but yes that was it. You saved me more hair pulling I thank you for that. I now have a couple more question that i would very much apreiceate if you could once again direct your expert atention. my project now looks like this: <?xml version="1.0" encoding="iso-8859-1"?> <data> <LoaderMax name="queue_CoachZ" prependURLs="Casting_MP3s/" load="true"> <MP3Loader url="JeffGurner_CoachZ_02.mp3" name="JeffGurner_CoachZ_02" autoPlay="false"/> <MP3Loader url="ChrisPhillips_CoachZ_01.mp3" name="ChrisPhillips_CoachZ_01" autoPlay="false"/> <MP3Loader url="ChrisPhillips_CoachZ_05.mp3" name="ChrisPhillips_CoachZ_05" autoPlay="false"/> </LoaderMax> <LoaderMax name="queue_MrsWordy" prependURLs="Casting_MP3s/" load="true"> <MP3Loader url="CharityJames_MrsWordy_04.mp3" name="CharityJames_MrsWordy_04" autoPlay="false"/> <MP3Loader url="CharityJames_MrsWordy_04.mp3" name="CharityJames_MrsWordy_05" autoPlay="false"/> </LoaderMax> </data> I set two loaderMax objects in the xml that contain mp3Loaders package{ import flash.display.Sprite; import com.greensock.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import flash.media.Sound; import flash.events.MouseEvent; public class TeacherCasting extends Sprite{ private var queue:LoaderMax; private var sound:Sound; private var loader:XMLLoader; private var coachZ_soundArray:Array; public function TeacherCasting(){ LoaderMax.activate([MP3Loader]); loader = new XMLLoader("data.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); btn1.addEventListener(MouseEvent.CLICK, toggleSound); } function completeHandler(event:LoaderEvent):void { trace(event.target + " is complete!"); var queue_CoachZ:LoaderMax = LoaderMax.getLoader("queue_CoachZ"); coachZ_soundArray = queue_CoachZ.content; trace(queue_CoachZ.name); } function toggleSound(event:MouseEvent):void { trace("click"); coachZ_soundArray[2].soundPaused = !coachZ_soundArray[2].soundPaused; } } } Problem 1, I am having trouble getting the name properties of the mp3 loaders. (this confuses me). I grab the loaderMax object named queue_CoachZ. var queue_CoachZ:LoaderMax = LoaderMax.getLoader("queue_CoachZ"); And assign its content property to coachZ_soundArray coachZ_soundArray = queue_CoachZ.content; so now trace(coachZ_soundArray[1]); [object Sound] not MP3Loader? so trace(queue_CoachZ.name); doesn't work. how do i get to the name property of the MP3Loader for coachZ_soundArray[1]? I want to put the sounds from each loaderMax in its own array and control the sounds through the array and have access to its loaders name property through the same array. Is this possible am I going about this the right way? Thank you very much for your help.
  11. Ok what am I missing? ?xml version="1.0" encoding="iso-8859-1"?> <data> <LoaderMax name="sampleQueue" load="true"> <MP3Loader url="sound1.mp3" name="sound1" autoPlay="true"/> </LoaderMax> </data> package{ import flash.display.Sprite; import com.greensock.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import flash.media.Sound; public class TeacherCasting extends Sprite{ var loader:XMLLoader; public function TeacherCasting() { LoaderMax.activate([MP3Loader]); loader = new XMLLoader("data.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); } function completeHandler(event:LoaderEvent):void { trace("loaded"); } } } why isn't the completeHandler tracing anything?
  12. how can i animate all the objects in stuffArray to different x and y positions stored in xArray and yArray? this doesn't work: tl.appendMultiple( TweenMax.allTo(stuffArray, 2, {y:yArray, x:xArray },.2) ); this doesn't work they all animate to the 0 index of xArray and yArray. for (var i = 0; i< stuff.length; i++){ tl.appendMultiple( TweenMax.allTo(stuff, 10, {y:yArray[i], x:xArray[i], ease:Elastic.easeOut }) ); } What is the solution i am missing? Thanks
  13. Ok i'm confused again. I have an animaion based on the tween of marker. the position of multiple objects are updated based on markers position. tl.append( TweenLite.to(marker, 10, {x:1000})); private function loop(e:Event){ area1.x = marker.x; area2.x = area1.x + area1.spacing.width; area3.x = area2.x + area2.spacing.width; } I want to be able to add tweens to the middle of tl without adding to its 10 second duration so that i can add lables based on this 10 second duration. tl.addLabel("label1", .01); tl.addLabel("label2", 3); tl.addLabel("label3", 5.26); tl.addLabel("label4", .77); tl.addLabel("label5", 10); I want to put all tweens in tl to be able to reverse it. if i insert a tween at .01 seconds like this: tl.insert(TweenLite.to(area1.window.background,4,{x:someWidth}), .01); it adds 4 seconds to tl's total duration which i want to be 10 seconds. I thought about using more then one timeline and starting them with callback functions on the lables but that gets tricky with reversing the timeline. I know there is an elegant way to do this with timlineMax but I can't think of it. help would be appreciated. Thanks!
×
×
  • Create New...