Jump to content
Search Community

bonassus

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by bonassus

  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!
  14. Carl, Thank you for your very detailed explanation. I now understand that I need to access both the video's loader and its content display object in order to add it to the display list, position it and then play it. I wish there was a way to access the video’s loader through its display container. So i could pass a reference to the video's display container between classes and control it's playback the through the same reference. even if it was like this: sim.getLoader("simVid").playVideo(); or even this: sim.getChildByName("simVid").getLoader("simVid").playVideo(); but it looks like I wont be able to do that. Thanks again your responses are always very helpful!!
  15. Ok so if i want to load a video and treat it like a display object i have to do this. var elArray:Array = new Array(bigIdeas,video.content); video.content.x = 180; video.content.y = 220; video.content.name = "sim"; addChild(video.content); how do i get a reference to the loader from the content object loaderMax.getLoader(elArray[1]).playVideo(); What??
  16. var sim:Sprite = new Sprite; var video:VideoLoader = new VideoLoader("assets/SEI_EDU_Math_Demo.f4v", {name:"simVid", container:sim, bgColor:0xffffff, autoPlay:false, estimatedBytes:92000}); why does this not work? sim.playVideo(); or at least this: sim.video.playVideo(); is loadermax putting the video in a container in my sim Sprite that i can only acsses with getContent(); say it isn't so
  17. it was immediateRender. appendMultiple(TweenMax.allFrom([vthumb1 ,vthumb2 ,vtrack1 , vtrack2],1,{ alpha:0,immediateRender:true})); this tweens the clips from 0 alpha (which they already were at) to alpha:1 or at least rendered on screen. And when the timeline moves on they disappear. with immediateRender:false. they stay on screen when the timeline moves forward. immediate render must set alpha.
  18. Thanks for your response. I set this project up in kind of a weird way. all the clips start out on the stage. There a little as3 on frame one that sets all the objects alpha to 0 for (var i:uint = 0; i < this.numChildren; i++){ this.getChildAt(i).alpha = 0; } then i'm showing the clips with var section0Tl:TimelineMax = new TimelineMax({onComplete:onLabelStop}); section0Tl.appendMultiple(TweenMax.allFrom([m.buda,m.topWindow],globalTweenTime, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0,ease:_model.theEase}, globalStagger)); tl.append(section0Tl); this shows the clips which confuses me because i didn't set an alpha to. does immediateRender affect the alpha? I guess it's the weird way i set this file up but it was really convenient for positioning clips I could post the fla and all the classes if that would help Thanks!
  19. I have a bit of confusion here. I set all the movieClips alpha property to 0 as soon as they are added to the stage. section7Tl:TweenMax.allFrom alpha:0 tweens their alpha to 1. which confuses me but does what I want. when section8Tl:TimelineMax starts their alpha goes back to 0. At lease I assume it does as it is no longer displayed. what is going on here. does allFrom default alpha:0 to 1? do I have to set these movieClips.alpha to 1 section7Tl.onComplete? Or am i just confused again? Thanks A lot! tl = new TimelineMax( {} ); var section7Tl:TimelineMax = new TimelineMax({onComplete:onStop}); section7Tl.appendMultiple(TweenMax.allFrom([vthumb1 ,vthumb2 ,vtrack1 , vtrack2 ,vAreaBar, vAreaBar2],globalTweenTime, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, globalStagger)); tl.append(section7Tl); var section8Tl:TimelineMax = new TimelineMax({onComplete:onStop}); section8Tl.insertMultiple(TweenMax.allTo([hNumberBox1, hNumberInput1,vNumberBox2, vNumberInput2 ],globalTweenTime, {alpha:0, ease:_model.theEase})); tl.append(section8Tl); }
  20. I thought i had this figured out but i can't get this to work this morning. How do I get these three tweens to all start at the same time and have the same duration? Now the first to appendMultiples start at the same time but move different distances so the end times are different. throwprops? section6Tl.appendMultiple(TweenMax.allTo([m.numberBox1, m.numberInput1 ],-globalTweenTime, {y:"-15", ease:_model.theEase})); section6Tl.appendMultiple(TweenMax.allTo([m.numberBox2, m.numberInput2 ],globalTweenTime, {x:"-100", ease:_model.theEase})); section6Tl.append(TweenMax.to(m.areaBack, globalTweenTime, {width:250,height:120,x:110,y:80,ease:_model.theEase})); Thanks
  21. Thank you. I just figured that out. this works as well. tl.getLabelBefore(tl.getLabelTime(tl.currentLabel)) thanks again!
  22. I'm having trouble with getLabelBefore with the way I have this TimeLineMax set up. because im adding the labels before calling the upDateCurrenSection() function, currentLabel and getLabelBefore() are the same. I wish i could pass a label to getLabelBefore(). I don't want to pass a time to getLabelBefore() as it might change. Is there a solution to the other then completely restructuring the code. Thanks! tl = new TimelineMax( {delay:.5,onComplete:tlComplete, onStart:onStart} ); tl.addLabel("intro_in", tl.duration); var introTl:TimelineMax = new TimelineMax({onStart:upDateCurrenSection}); introTl.appendMultiple(TweenMax.allFrom( [ m.firstScreen,m.math180Logo ],.8, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, .4)); tl.append(introTl); tl.appendMultiple(TweenMax.allTo( [ m.firstScreen,m.math180Logo ],.8, {alpha:0, ease:_model.theEase}, .4)); //---------------------------------- tl.addLabel("section0", tl.duration); var section0Tl:TimelineMax = new TimelineMax({onStart:upDateCurrenSection}); section0Tl.appendMultiple(TweenMax.allFrom( [ m.buda,m.topWindow ],.8, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, .4)); tl.append(section0Tl); tl.appendMultiple(TweenMax.allTo( [ m.buda,m.topWindow ],.8, {alpha:0, ease:_model.theEase}, .4)); tl.addLabel("section1", tl.duration); var section1Tl:TimelineMax = new TimelineMax({onStart:upDateCurrenSection}); section1Tl.appendMultiple(TweenMax.allFrom( [ m.backBtn,m.sliderWindow,m.slider,m.artDrags,m.labelText,m.stepFrame,m.step ],.8, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, .4)); tl.append(section1Tl); tl.appendMultiple(TweenMax.allTo( [ m.sliderWindow,m.slider,m.artDrags ],.8, {alpha:0, ease:_model.theEase}, .4)); function upDateCurrenSection(){ trace(tl.currentLabel); trace(tl.getLabelBefore()); }
×
×
  • Create New...