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. in this case it it seems that TimelineMax is putting you over the edge: from http://www.greensock.com/timelinemax/ So your results give or take a kb are pretty much in line with what is advertised. since your timeline isn't terribly complex, you can probably get away with just using TweenLite or TweenMax. you could simplify all of your code like so: TweenLite.to (slogan, 1, {y:"-160"}); TweenLite.to (slogan, 1, {y:"160", delay:1}); TweenLite.to (message1, 1, {y:"-240", delay:2}); TweenLite.to (message1, 1, {y:"240", delay:3}); TweenLite.to (message2, 1, {y:"-310", delay:4})); TweenLite.to (message2, 1, {y:"310", delay:5}); you could turn those all into fromTo tweens and just put them in a function that runs 3 times with a delay in between. perhaps TimelineLite will get you in under 20kb, but again you will have to manually work out the repeat
  2. i wish I could resist these challenges. oh well:) check the attachment. I changed around a bunch of stuff and don't have time to explain it all. I tried to comment where I made the larger modifications I sort of combined my 3rd bullet-proof method (custom in AND out animation) with stickyNav. when the main timeline starts each section it calls an "activateCurrentSection" function which handles changing the color of the nav to the "active color". so each new section tween looks like this now: tl.append(TweenMax.to(home_mc, 0, {autoAlpha:1, immediateRender:false, onStart:activateCurrentSection, onStartParams:["home"]})) tl.append(TweenMax.to(blog_mc, 0, {autoAlpha:1, immediateRender:false, onStart:activateCurrentSection, onStartParams:["blog"]})); etc furthermore every time you click a nav item, the same activateCurrentSection function is called which does this: function activateCurrentSection(section:String):void{ currentSection = section; for(var nav in nav_mc){ var mc:MovieClip = nav_mc[nav] if(mc.ID != section){ TweenMax.to(mc, .5, {tint:null}) }else{ TweenMax.to(mc, .5, {tint:0xff66cc}) } } } that function loops through all the items in nav_mc, and if they aren't the "currentSection".. then they get set back to their natural color. the clicked or active item will change color. I did it quick and its a bit messy... but it seems to be pretty solid. you may have better luck importing your artwork into my file then trying to edit your code to reflect my changes
  3. nice to see the progress you've made. it seems that buttons 4 and 5 tend to stay light blue but other buttons stay white when not selected. I don't have time now, but I'll let you know if i come up with a better way to combine the 2 tutorials
  4. Glad you enjoyed the tutorial. That guy is really something else. a few things 1: You may want to read more about Timer(). For it to work it is a little more involved than what you showed. They can come in handy when used properly. 2: Feel free to post comments about the snorkl tutorials on snorkl.tv 3: I actually had to think about your problem for a few moments, but I came up with a solution that I never used before, so I thank you. tweenTo() creates a TweenLite, so what we can do is create another separate timeline that has a series of TweenTo()s appended to it with whatever delay you wish. here is the code: var sectionPause:int = 2;//amount to pause on each section complete //make a new timeline for the special delayed rate of playback var playSections:TimelineMax = new TimelineMax({paused:true}); playSections.append(tl.tweenTo("home_complete")); playSections.append(tl.tweenTo("blog_complete"), sectionPause); playSections.append(tl.tweenTo("portfolio_complete"), sectionPause); playSections.append(tl.tweenTo("about_complete"), sectionPause); playSections.play(); i've attached a cs4 fla
  5. to get the swing motion you could probably get by with 2 consecutive tweens like this: import com.greensock.*; import com.greensock.easing.*; var tl:TimelineLite = new TimelineMax({repeat:-1, repeatDelay:1}); tl.append(TweenLite.to(ball, 1, {rotation:-40, ease:Sine.easeOut})); tl.append(TweenLite.to(ball, 2, {rotation:0, ease:Back.easeOut, easeParams:[5]})); to test, place a single ball on string mc called ball on the timeline with this code. if you want a super-realistic physics based swing, look at: http://www.flashkit.com/tutorials/Math- ... /index.php
  6. i don't know why the alpha isn't working, it could relate to the other issue. the reason your tweens aren't going to absolute positions is because they are being seen as String values which TweenLite interprets as relative values. read tip 4 Relative v Absolute http://www.greensock.com/tweening-tips/ when you are building your properties object make sure the values are converted to Number()
  7. Hello! Being that you didn't ask a question, it is difficult to provide an answer. In general, TweenLite and LoaderMax would be great tools to use to create this project. To get the best assistance, experiment with the tools and then come here for help when you have specific questions.(note there are separate support forums for tweening and loading) in addition your could google "flash banner rotator tutorial" and probably find a few different ways to approach this. Carl
  8. the randomness of the order is because you initiate all the loads at the same time and each asset loads at a different rate based on size and network conditions. if you want to enforce the load order you will need to load each image individually and then have the onComplete of each image trigger then next image... or use LoaderMax which does that seamlessly.
  9. yeah, that's because you are creating individual timelines for each image and they are all loading at basically the same time. you could do: //create 1 timeline outside of onComplete listener var rotaFondo : TimelineMax = new TimelineMax ({paused:false,repeat:-1,yoyo:false}); function beginRotation(e:Event):void{ rotaFondo.append(TweenMax.to(e.currentTarget.content, 3, {autoAlpha:0}),3); rotaFondo.play(); }
  10. Carl

    FramePlugin

    I'm not familiar with a reverse() method on MovieClips. Can you post a simplified fla that illustrates the problem? just for kicks, I experimented with dynamically adding on movie clip to another that has a TweenMax frame tween applied to it and the dynamically added clip stayed in place just fine. perhaps I am misunderstanding your problem.
  11. you need to find away to parse that string value and create an object. what you are doing is creating a string that looks like a TweenLite vars object, but really isn't. what you are doing, appears to flash like this: tl.append(TweenLite.to(green, 2, {"x:400,y:300"})); flash is trying to create an Object out of a string to pass into TweenLite and can't do it. Fortunately others have tried to do this. I edited the code from this discussion: http://stackoverflow.com/questions/1510 ... pt-3-0-as3 the following will work with your approach. no guarantees for support of additional features. import com.greensock.* import com.greensock.easing.* var animXML:XML= var serializedObject:String = animXML.animate.text(); var tween:Object = new Object() var contentWithoutBraces:String = serializedObject.substr(serializedObject.indexOf('{') + 1) contentWithoutBraces = contentWithoutBraces.substr(0, contentWithoutBraces.lastIndexOf('}')) var propertiesArray:Array = contentWithoutBraces.split(',') for (var i:uint = 0; i { var objectProperty:Array = propertiesArray[i].split(':') var propertyName:String = objectProperty[0] var propertyValue:String = objectProperty[1] tween[propertyName] = Object(propertyValue) } var tl:TimelineMax = new TimelineMax(); tl.append(TweenLite.to(green, 2, tween));
  12. if you assign your complete listener inside your loop you may be ok: var contFondos : Sprite = new Sprite(); addChild(contFondos); setChildIndex(contFondos, parent.numChildren +2); //with this i'm getting the images// var urls:Array=new Array("imagenes/FONDO10.jpg","imagenes/FONDO9.jpg", "imagenes/FONDO8.jpg","imagenes/FONDO7.jpg", "imagenes/FONDO6.jpg","imagenes/FONDO5.jpg", "imagenes/FONDO4.jpg","imagenes/FONDO3.jpg", "imagenes/FONDO2.jpg","imagenes/FONDO1.jpg"); // loading// for( var i = 0; i var img = new Loader(); img.load(new URLRequest( urls[i] )); contFondos.addChild(img); img.name = "unique" + (i + 1); img.contentLoaderInfo.addEventListener(Event.COMPLETE,beginRotation); } // then trying to tween but it doesn't work //and try using e.currentTarget.content function beginRotation(e:Event):void{ var rotaFondo : TimelineMax = new TimelineMax ({paused:false,repeat:-1,yoyo:false}); rotaFondo.append(TweenMax.to(e.currentTarget.content, 3, {autoAlpha:0}),3); } I would strongly suggest just using LoaderMax parse() which is designed to load all images in an array: http://www.greensock.com/as/docs/tween/ ... tml#parse()
  13. the problem is you do var img = new Loader() inside a loop. when the loop stops running. that reference is destroyed. or in other words, if you declare a var in a loop, you can not access it in other functions or outside the loop. I haven't used the AS3 Loader since using LoaderMax (which I strongly recommend) http://www.greensock.com/loadermax/ so I may not have the best advice. inside your onComplete, you should be able to use e.target to find out which loader is sending the complete event. try tweening that once you get an onComplete event to fire properly.
  14. I don't think ENTER_FRAME is what you want because that will happen repeatedly... if you want something to happen just once create a function to do that thing and call the function once. function spinInit():void { TweenMax.to(Wheel, .5, {rotation:30, ease:Cubic.easeIn}); Clients.gotoAndPlay("As"); } //when Wheel loads just do: spinIt();
  15. yes! any time you need to animated in Flash, the GreenSock Tweening Platform will make the job easy. What you want to do consists of 5% GreenSock and 95% pure ActionScript. the core of what you need to do is dynamically create a sequence of tweens, meaning each time the sequence runs, the ending x and y values will be different. here is a very basic implementation: import com.greensock.*; OverwriteManager.init(2); function moveSequence(mc, endX, endY){ TweenLite.to(mc, .5, {x:endX}); TweenLite.to(mc, .5, {y:endY, delay:.5}); } moveSequence(box_mc, 100, 200); the above will take a movie clip named box_mc and move it first to an x of 100, then a y of 200. the above assumes: 1:you fla is saved in the same folder as the greensock com folder 2:you have a movie clip with instance name "box_mc" on the stage. of course you will have a number of buttons that will pass in the x and y values, or perhaps you can just pass in a reference to the movie clip that the box_mc is moving to and the function will use the x and y of that movie clip. the above is just an example of the core tweening-related concepts. you could use TImelineLite/Max as well. also you may want to detect if the box is in the same row as the destination, in which case you would omit the y tween. same goes for x. I would suggest experimenting with what I provided. there are a half dozen ways of doing this.
  16. no problem. have fun with the GreenSock Tweening Platform it has a ton of features that make tasks like this super easy. be sure to check out Getting Started: http://www.greensock.com/get-started-tweening/ Tweening Tips and Tricks: http://www.greensock.com/tweening-tips/ Learning Resources: http://www.greensock.com/learning/ you will be a tweening master in no time! Carl
  17. yeah, you need to use a relative value. after the tween runs once, it is already at the absolute value of -10. so subsequent tweens don't have a new position to go to. just use a String value "in quotes" as your destination value and you will be fine: repeatAgain() function repeatAgain():void{ TweenMax.to(mytwitterfeed1, 1, {rotation:"-10", ease:Bounce.easeOut, delay:2, onComplete:repeatAgain }) } by using a relative value each time the tween runs it will rotate to a position -10 degrees away from the objects current rotation
  18. i looked at your file. and since your frame "cazzo" is on the main timeline you would not use mc as your target as mc does not have a frame labeled "cazzo". mc is used in the documentation as a generic instance name. 99% of the TweenLite tweens you will do will control movie clip symbols so you need the instance name to define which object you are tweening. also, the frameLabel plugin is usually used to play through frames in a timeline that already has some timeline-based motion/classic tweens in them. you only have 2 keyframes with static content so there isn't going to be much to see visually as the tween is running. read/watch this tutorial to see a common implementation of the frameLabel plugin: http://www.snorkl.tv/2010/10/overview-o ... backwards/
  19. please familiarize yourself with the GreenSock basics: http://www.greensock.com/get-started-tweening/ assuming your mask is called rectangle_mc and your image is called image_mc import com.greensock.*; //set overwrite mode to auto. read getting started guide OverwriteManager.init(2) //tells the image to be revealed by rectangle_mc (google AS3 mask for more) image_mc.mask = rectangle_mc //move the rectangle to the right for a duration of 2 seconds. substitute your own values TweenLite.to(rectangle_mc, 2, {x:300}); //tween the width of the rectangle after 1.5 seconds. when done call doSomthing function TweenLite.to(rectangle_mc, 2, {width:600, delay:1.5, onComplete:doSomething}); //function that will run when the animation is over function doSomething(){ trace("animation over"); }
  20. Hi, This is most likely not a CS5 issue but more likely the way the OverwriteManager is working http://www.greensock.com/overwritemanager/ add this 1 line of code above everything else OverwriteManager.init(OverwriteManager.AUTO); best, Carl
  21. glad you got it working. thank you for posting your solution. It saves us time, and could possibly help someone else in the future. Carl
  22. I regret that this recent explanation does not clarify things. by shuffling the instance names makes it much harder to understand. I have to constantly refer to your list to make any sense of i made a little demo that has a number of staggered timelines that is quite simplified and maybe close to what you need file attached var tl1:TimelineMax = new TimelineMax({ repeat:-1, repeatDelay:2}) tl1.insert(TweenMax.to(mc1, 1, {y:100})); tl1.append(TweenMax.to(mc1, 1, {alpha:0, delay:1})); var tl2:TimelineMax = new TimelineMax({ delay:1, repeat:-1, repeatDelay:2}) tl2.insert(TweenMax.to(mc2, 1, {y:100})); tl2.append(TweenMax.to(mc2, 1, {alpha:0, delay:1})); var tl3:TimelineMax = new TimelineMax({ delay:2, repeat:-1, repeatDelay:2}) tl3.append(TweenMax.to(mc3, 1, {y:100})); tl3.append(TweenMax.to(mc3, 1, {alpha:0, delay:1})); var tl4:TimelineMax = new TimelineMax({ delay:3, repeat:-1, repeatDelay:2}) tl4.append(TweenMax.to(mc4, 1, {y:100})); tl4.append(TweenMax.to(mc4, 1, {alpha:0, delay:1}));
  23. Also, if you are trying to control the main timeline and NOT a Movie Clip symbol, you can use the this keyword TweenLite.to(this, 1, {frameLabel:"mylabel",ease:Elastic.easeIn})
  24. that seems incredibly confusing. if the third text coming in makes the first one go away. wouldn't the fourth text coming in make the 2nd go away? yet you say the 2nd one fades away after the first one comes in again. when does the 4th one fade away. please describe the entire sequence in as much detail as possible.
×
×
  • Create New...