Jump to content
Search Community

Carl last won the day on December 24 2023

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,824
  • Joined

  • Last visited

  • Days Won

    546

Everything posted by Carl

  1. you can set the timeline back to the beginning by using timeline3.gotoAndStop(0); to play from the beginnning timelline3.gotoAndPlay(0) or timeline3.restart(); to stop the timeline where it is use timeline3.pause(); please read section called Public Methods in the TimelineMax documentation: http://www.greensock.com/as/docs/tween/ ... neMax.html
  2. this should load the coolingSWF loader after the xml loads: //make sure SWFLoader is actived LoaderMax.activate([sWFLoader]); public function completeHandler(e:LoaderEvent):void{ trace("xml loaded"); LoaderMax.getLoader("coolingSWF").addEventListener(LoaderEvent.COMPLETE, showIt); LoaderMax.getLoader("coolingSWF").load(); } public function showIt(e:LoaderEvent):void{ addChild(e.target.content); }
  3. couldn't open your cs5.5 file. I only have 5 try using a pinpoint other than CENTER: ls.attach(mc, ls.BOTTOM_RIGHT, true, true, 2, {ease:Quart.easeInOut}); place some other assets on your stage. export. when you resize the swf you will notice they move with no help from ls. in fact when you resize the swf all the assets on the stage move to maintain their relationship to the center of the stage. so in actuality, the asset that you were pinning to CENTER, is going to maintain its relationship to the center naturally.. so there is no where to tween to. I'm pretty sure that is what you are experiencing.
  4. nope, not a bug. greensock addresses this issue best viewtopic.php?f=1&t=1635&p=13304&hilit=onReverseComplete#p13304 so, use addCallback() as he suggested, if you need the callback only to fire when the timeline is reversed you can add a conditional to your callBack... import com.greensock.*; import com.greensock.easing.*; var tl:TimelineMax = new TimelineMax({onComplete:playBackwards}); tl.append(TweenMax.to(mc, 1, {x:400 })); tl.addCallback(onlyOnReverse, tl.duration); tl.append(TweenMax.to(mc, 1, {y:400 })); function onlyOnReverse(){ if(tl.reversed){ trace("ok i'm going backwards, let's do something"); }else{ trace("moving forwards, ignore..."); } } function playBackwards(){ tl.reverse(); }
  5. perhaps there is something amiss in the way you are embedding your swf in the html. try these settings if using the Flash IDE:
  6. that is because you never instantiated a new TimlineLite() before calling _classChild = new ClassChild(_timeline); A trace in main.as would reveal that. public function addChildren():void { trace(_timeline); // output null _classChild = new ClassChild(_timeline); _classChild.addEventListener(Event.ADDED_TO_STAGE,childrenAdded); addChild(_classChild); } to get rid of the null reference do this: public function addChildren():void { _timeline = new TimelineLite(); trace(_timeline); // output [object TimelineLite] _classChild = new ClassChild(_timeline); _classChild.addEventListener(Event.ADDED_TO_STAGE,childrenAdded); addChild(_classChild); } I would suggest trying to implement all the TimelineLite initialization, adding of tweens, playing, clearing... etc in a single class. Get the functionality bulletproof and then worry about how multiple classes are going to interact with it. just my 2 cents.
  7. for now try: ls.attach(mc, ls.CENTER, false, true, 2, {ease:Quart.easeInOut}); I'm not a LiquidStage expert, but according to the docs, there are 4 parameters that are needed before the tween duration. http://www.greensock.com/as/docs/tween/ ... ml#attach() It's possible that the demo needs to be updated to reflect a change in the feature set. Thanks for posting about your issue.
  8. is that your full code? are you loading the queue? queue.load();
  9. there is one more step: public function completeHandler(event:LoaderEvent):void { var childLoader:SWFLoader = queue.getLoader("Assets"); var librarySymbol:Class = childLoader.getClass("tractor_frames"); trace(librarySymbol); //this will create an instance of your class var myInstance:MovieClip = new librarySymbol(); addChild(myInstance) }
  10. i don't know how you are drawing your triangle, but you can add an onUpdate callback to your tween which will run a function every time the tween progresses TweenLite.to(video, 5, {x:500, onUpdate:doStuff}); function doStuff(){ trace("updating " video.x); }
  11. it seems you are jamming all your thumbnail and fullsize loaders into the same arrays, LoaderMaxes or whatever. then when you try to loop through the thumbnail loaders to assign eventlisteners, you are looping through all the loaders and your var thumbArr = LoaderMax.getContent("assets/thumbnails/product" + (i + 1) + ".swf"); is failing when it hits a full size loader. you can do 2 things: add all your thumbnail loaders to their own array or sub-LoaderMax so that you can easily find them and loop through ONLY the thumbnail loaders OR just assign the CLICK eventListeners as soon as the thumnail loaders are created for (var t:int = 0; t //Setup the thumbnail swfs into mainLoader var tWidth = 80; var tSpace = 18; var tCols = 4; var thumbnailLoader:SWFLoader = new SWFLoader("assets/thumbnails/" + xmlList[t].@url, new SWFLoaderVars() .name(xmlList[t].@thumbName) .x((t % tCols) * (tWidth + tSpace)) .y(415) ); //try adding this thumbnailLoader.content.addEventListener(MouseEvent.CLICK, thumbClick); mainLoader.append(thumbnailLoader); } from the greensock SWFLoader docs:
  12. that's entirely possible with the requireWithRoot property. viewtopic.php?f=6&t=5099&p=20118&hilit=requirewithroot#p20118
  13. once you load your assets.swf with a SWFLoader you should be able to access objects in it's library with getClass() http://www.greensock.com/as/docs/tween/ ... #getClass()
  14. there are a few methods floating around the internet. here is one: http://ronald-maravilla.tumblr.com/post ... workaround read the articles here: http://www.google.com/search?gcx=c&sour ... estriction usually there is some good info in the comments.
  15. you can either use the bezierThrough plugin. visit http://www.tweenmax.com and look in the plugin explorer. or do something like this: import com.greensock.*; import com.greensock.easing.*; TweenMax.to(b, 6, {x:400, ease:Linear.easeNone}); TweenMax.to(b, 1, {y:"100", repeat:5, yoyo:true, ease:Sine.easeInOut});
  16. in order for scaleModes to function properly you need to specify width and height.
  17. bad: queue.append(new SWFLoader(WaterFall.swf, {name:"WaterFall",container:swfHolder})); good: queue.append(new SWFLoader("WaterFall.swf", {name:"WaterFall",container:swfHolder})); url needs to be a String.
  18. oh, now I see, your onComplete and ease needs to be moved outside the transformAroundCenter vars bad: TweenMax.to(full_mc, 1.5, {transformAroundCenter:{x:sw/2, y:sh/2, ease:Expo.easeOut, scale:zoomFactor-=0.25, onComplete:onFinishTween}}); good: TweenMax.to(full_mc, 1.5, {transformAroundCenter:{x:sw/2, y:sh/2, scale:zoomFactor-=0.25} , ease:Expo.easeOut, onComplete:onFinishTween} );
  19. please attach a zip of the simplest example possible that can effectively illustrate the problem. we'll be glad to look at it.
  20. import com.greensock.*; import flash.events.MouseEvent; btn.addEventListener(MouseEvent.CLICK, toggleUpDown); //create a tween that moves the bar up //this tween is paused and reversed var upTween:TweenMax= TweenMax.to(bar, 2, {y:0, paused:true, reversed:true}); //function that changes the direction of the tween and resumes it //since the tween is reversed by default, clicking the btn the first time plays it forward function toggleUpDown(e:MouseEvent):void{ upTween.reversed = !upTween.reversed; upTween.resume(); } this tutorial here: http://www.snorkl.tv/2011/08/peacock-ch ... melinemax/ discusses this technique in the context of a TimelineMax but the main principles apply to single TweenMax tweens as well. cs4 files attached
  21. try defining onFinishTween() outside of the zoomOut function. right now it is nested inside of another zoomOut() which makes finding it difficult.
  22. first add the following trace: for each (var node:XML in SWFsToLoad) { queue.append( new SWFLoader(node.@url, {name:"clip"+j,container:contentHolder}) ); trace("append " + node.@url); j++; } test the movie, you will see that your swfs are getting added to the queue in the proper order ----- Next add this trace: function swfCompleteHandler(event:LoaderEvent):void { trace("complete " + event.target); var loadedSWF:ContentDisplay = event.target.content as ContentDisplay; loadedSWF.alpha = 0; TweenMax.delayedCall(2*i, fadeItIn,[loadedSWF]); i++; } test the movie, and you will see that your movies are loading out of order. ---- This makes me think you are doing everything right! It is weird to me that the switch-up in the first 2 loaders is so consistant but the truth of the matter is even though you are dictating the order in which the swfs should be requested, LoaderMax loads multiple assets concurrently (unless specified otherwise) and its basically a race to see which one gets loaded first. In your case it appears the second swf ALWAYS shows up first. to absolutely ensure that only 1 swf gets loaded at a time and that they load in the order that you dictate, the fix is simple. just set maxConnections to 1 as shown below: var queue:LoaderMax = new LoaderMax({maxConnections:1, name:"mainQueue",onComplete:queueCompleteHandler, onProgress:queueProgressHandler, onChildProgress:swfProgressHandler, onChildComplete:swfCompleteHandler}); Great job on your success in getting that kirupa method to sort your data for you! Also, I gotta say even though I'm terrified of these long posts with tons of code samples, you did an excellent job of documenting what was happening and it made it very easy to trouble shoot. --- By default maxConnections is set to 2. This is a great feature as it allows multiple assets to load as quickly as possible. In your case where the order in which they load and display is of great importance, setting maxConnections to 1 will ensure that the loading completes in the sequence that you dictate.
  23. hello and welcome to the GreenSock forums. there is nothing built into the GreenSock Tweening Platform that is going to manage this for you. you can build an Array that stores all the x values. as the user clicks the "next" button you can grab the next value out of the array and apply it to a TweenLite tween. something like: var currentLocation:int = 0; var locations:Array = [0, 150, 450, 700]; function goToNextLocation(event:MouseEvent):void{ currentLocation++; TweenLite.to(myStripOfMovieClips, 1, {x:locations[currentLocation]}); } keep in mind that you would also want to check to make sure that you don't go to a location that doesn't exist (beyond the limits of what is in the array).
  24. honestly, I have absolutely no idea what you are asking. the only thing I can vaguely suggest is try to make it so that when you click on home_mc the code: mySwf2.content.mask = MaskCloud_mc gets run again, maybe put it in a function that gets called when you go to home_mc. ---- also, please keep in mind that the point of the forums is to help people understand the functionality of the GreenSock Tweening Platform. We unfortunately do not have the resources to assist people with every trouble spot they encounter when building a project.
  25. there are many ways to create an effective loop. although a bit archaic, the easiest way is to have all your ticker items in one parent container. this allows you to move one object instead of many. when you get to the end of the animation, you just replay it. in order for the loop to be seamless, you usually have to have copies of one or more items so that when the last item moves off the stage the first item appears to be following it directly. attached is a very simple and basic approach. --- if you want to get more complex and not have to worry about duplicating elements, I have a way of shifting elements around so as soon as the first element goes off stage it automatically gets sent to the back of the line: http://www.snorkl.tv/2011/02/easy-infin ... ll-part-1/ ----- if you want to try the newest coolest technique in the world, feel free to investigate the BlitMask Wrap: http://www.snorkl.tv/2011/10/use-blitma ... d-looping/ *note this solution may not be great for you since bitmapMode needs to be set to true, which means responding to mouse events may become challenging.
×
×
  • Create New...