Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Carl last won the day on April 4 2019

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,152
  • Joined

  • Last visited

  • Days Won

    532

Everything posted by Carl

  1. FIrst, thanks so much for posting the code, putting in a trace, and verifying that the slideIn() function is being called. so few people take the time to explain what they have done, tested and need help with so well. what I would do next to troubleshoot is 1: try to verify that the _timeline was created and you have access to it to do this edit your slideIn() function to do this: public function slideIn() { //see if your _timeline has a duration trace("slide in duration = " + _timeline.duration); _timeline.gotoAndStop(0); _timeline.play(); } does the duration trace? when you do your mc1.x = _mc2.x = _mc3.x = _mc4.x = 972; does it set the x of all the mcs properly? just want to make sure your class has access to those clips. And yes, TimelineLite/Max instances do play as they are being created. What you can do to prevent this is pause it in the constructor. _timeline = new TimelineMax({paused:true); although _timeline.stop() does do the same thing. Nothing is jumping out at me as a syntax or structure error, so I'm curious to see if you can trace the _timeline.duration from your slideIn() if you feel like posting your files (flash cs4 for me) I'll take a look at it.
  2. a few lines of code would help to make your problem more clear. I'm having trouble understanding what it is you are tweening. you mention things like "tweenlite tweens to that number" or "buttons sets number to 4 x width, then tweens to that point". and then you have "it will tween to an offpixel such as x = 4999.95. are you tweening the width of a box or its x? assuming that it is the width, while a box is tweening its width is not going to be whole numbers. so if you click mid-tween, the current width of the box is going to be funky like 103.233423 which multiplied by 4 is going to give you a bunch of decimals. you can either disable the buttons while tweens are running, manually round the values you tween to, or use the roundProps plugin. let me know if you need further assistance
  3. Carl

    hide mc

    //start with mc2 invisible mc2.visible = false; //tween mc1 TweenLite.to(mc1, 1, {x:100, onComplete:showMC2}) //when mc1 is done this function will run function showMC2(){ //hide mc1 mc1.visible=false; //show mc2 mc2.visible=true; //tween mc2 TweenLite.to(mc2, 1, {x:200}); } in order for mc2 to be in the same position as mc1, you can either: Create a tween for it that is the same as the first tween and just leave its visible =false; or when the showMC2 function runs you can programmatically have mc2 have the same properties as mc1 such as mc2.x = mc1.x mc2.y = mc1.y
  4. how much do you have working already? have you gotten a few TweenLite tweens to work? Have you experimented with the blur plugin? Do your buttons do anything? Its hard to offer help if we don't know what you have tried as it can easily turn into us just doing your work for you, or trying to explain things which are way to complicated. We love to help you along when you run into trouble, but I don't know where you are having problems. I would suggest starting with having 1 button do the effect that you want on one image, I wouldn't put them in the same position until you know its working (it will make it easier to see what is happening). you can literally copy and paste code from the plugin explorer for the blur effect: http://www.greensock.com/tweenmax/ to start all the images invisible and blurry you can do TweenMax.to(mc1, 1, {blurFilter:{blurX:20}, alpha:0}); TweenMax.to(mc2, 1, {blurFilter:{blurX:20}, alpha:0}); TweenMax.to(mc3, 1, {blurFilter:{blurX:20}, alpha:0}); then when button 1 is pressed you show mc1 and hide mc2 and mc3 in button 1'a eventListener TweenMax.to(mc1, 1, {blurFilter:{blurX:0}, alpha:1}); TweenMax.to(mc2, 1, {blurFilter:{blurX:20}, alpha:0}); TweenMax.to(mc3, 1, {blurFilter:{blurX:20}, alpha:0}); there are more streamlined and elegant approaches using loops and variables to track which button is being shown, but for a beginner with only 3 images, this should suffice Welcome to the forums and GreenSock! Carl
  5. ok, this may be a total hack job, but it works. it is not battle-tested at all. import com.greensock.*; var tl:TimelineLite = new TimelineLite({onComplete:goBack}) tl.append(TweenLite.to(mc, 1, {x:200})); tl.append(TweenLite.to(mc, 1, {y:200})); tl.append(TweenLite.to(mc, 1, {x:100})); tl.append(TweenMax.to(mc, 1, {tint:0x0000ff})); function goBack(){ trace("goBack"); tl.currentTime = 3; TweenMax.to(mc, 0, {tint:0x0000ff}) tl.reverse(); } mc will start red, move around a bit then tween to blue. when the tween to blue is done, the timeline plays backwards and the mc remains blue. files attached
  6. i don't have a solution for you. the timeline is doing what it is supposed to be doing. you can try using addLabel to jump to a certain point in time and then reverse. you can also experiment with either adding new tweens or updating existing tweens in the timeline to force the colors to stay as they are. I know it would take me a while to experiment with this and I don't have the time right now but it I come across something I'll post back carl
  7. no worries, glad to hear you figured it out. It feels good and you learn a lot that way. we all make mistakes, there's a few thousand pages of them in these forums:)
  8. I'm guessing roundProps would make it appear worse as it is not taking advantage of Flash's sub-pixel rendering. when small text isn't moving it is good to have it on whole pixels to keep it sharp. when it's moving it will cause it to appear jerky. From http://www.greensock.com/tweening-tips/ its very difficult to get slow tweens (10 seconds) to look good with low framerates in Flash.
  9. try not using var inside the restart function body for your setInterval as it is already defined elsewhere function restart():void { trace('Total timeline lasted'+myTimeline.duration); myTimeline.restart() addEventListener(Event.ENTER_FRAME,filmGrain); TweenLite.to(FilmGrainContainer, 0, {alpha:1, onComplete:countdown}); maybe bad var intID=setInterval(countdown,1000); maybe gooder intID = setInterval(countdown,1000); countdown_time = 5; c
  10. try not using var inside the restart function body for your setInterval as it is already defined elsewhere function restart():void { trace('Total timeline lasted'+myTimeline.duration); myTimeline.restart() addEventListener(Event.ENTER_FRAME,filmGrain); TweenLite.to(FilmGrainContainer, 0, {alpha:1, onComplete:countdown}); maybe bad var intID=setInterval(countdown,1000); maybe gooder intID = setInterval(countdown,1000); countdown_time = 5; do you have traces inside countdown() before the else statements? you should first confirm whether or not countdown is being called, and then you can figure out if there is a problem with c
  11. good job, you're almost there. the problem is that even though you are resetting the countdown_time, you aren't updating the textfield that displays that number until later. so chances are it is stuck on 1. the next time the countdown starts and you subrtact 1 from 5 it is immediately displaying 4. so I'm guessing somewhere in restart you want to chuck a 5 into that textfield. make your restart() function do this function restart():void { trace('Total timeline lasted'+myTimeline.duration); myTimeline.restart() addEventListener(Event.ENTER_FRAME,filmGrain); TweenLite.to(FilmGrainContainer, 0, {alpha:1, onComplete:countdown}); var intID=setInterval(countdown,1000); countdown_time = 5; CountDownText.countdown_txt.text=String(countdown_time); counter = countdown_time; trace('I have now reset countdown_time to '+countdown_time); trace('and counter to '+counter); trace('Restarted :)'); }
  12. Carl

    blur

    got some errors in where things are going in the {} bad: TweenMax.to(mc, 3, {blurFilter:{blurX:3, blurY:3, quality:3, ease:Quad.easeInOut, repeat:1, yoyo:true}, scaleX:1, scaleY:1}); good: TweenMax.to(mc, 3, {blurFilter:{blurX:3, blurY:3, quality:3}, ease:Quad.easeInOut, repeat:1, yoyo:true, scaleX:1, scaleY:1}); If you want to fade it in, you will need to set the alpha of the mc to 0 either programmatically or in the Flash IDE prior to that tween running and then add an alpha:0 to the TweenMax you can use a 0 duration tween to do this TweenMax.to(mc, 0, {alpha:0}); or a fromTo tween TweenMax.fromTo(mc, 3, {alpha:0, blurFilter:{blurX:0, blurY:0, quality:3}}, {alpha:1, blurFilter:{blurX:10, blurY:10, quality:3}, ease:Quad.easeInOut, yoyo:true}) blue code: are the from vars red code: are the to vars
  13. thanks for posting the file and answering my questions. I will check it out. I'm sure GreenSock will pop in eventually. I'm not cut out to help with the finer details of TimelineLite. Best, Carl
  14. hey, that looks really impressive. I would love to see some sample implementations. I'm assuming you can easily append a SoundTimeline into a regular TimelineLite. Can a SoundTimeline be reversed? What happens if a TimelineLite containining a SoundTimeline gets reversed? very curious. I totally commend you on you efforts and creativity! I'd imagine something like this has a lot of potential. Carl EDIT: I did not see your second post asking for suggestions until after posting this. I unfortunately do not have any suggestions.
  15. i looked at your swf. it seems to be working really well. when you tween out all the days at once, you could probably have all the days for a month in a container movieclip and just tween the container / parent. for the staggered tweens, the allTo() ar allFrom() methods of tweenMax will save you a ton of time and typing.
  16. welcome! yeah, certain plugins need to be activated in TweenLite, whereas some are activated by default in TweenMax. The plugin explorer uses green checkmarks to show which plugins are activated in which version. go back to the plugin explorer on the tweenlite page and where you see each plugin listed you will see a green checkbox next to its name. click the checkbox to see the activation code. for tint you need to put this at the top of your script: import com.greensock.plugins.*; TweenPlugin.activate([TintPlugin]); if this isn't clear, check out this video http://www.snorkl.tv/2010/09/learn-how- ... -explorer/ hope you continue to have fun toying around. its amazing what you can do once you learn just a few things. Carl
  17. Carl

    blur

    thx vonWolfehaus, i have no idea where i got the idea that they were concurrently scaling or changing other properties. I think my wires are crossed. the only advantage to having 2 tweens is that you can have the blur in duration be different than the blur out. your suggestion most likely is better for what they are trying to do. Carl
  18. Carl

    blur

    This method uses 2 tweens: import com.greensock.*; TweenMax.to(mc, 1, {scaleX:2, scaleY:2, blurFilter:{blurX:20, blurY:20}}) TweenMax.to(mc, .3, {blurFilter:{blurX:0, blurY:0}, delay:.7}) //note the first tween never gets its blur values to a full 20 as the second tween interrupts and overwrites it.
  19. it would help if you could post or attach a swf that shows how this is being displayed and animated. there is a bit getting lost in translation and I'm having a hard time visualizing how all the objects have tween to an x of 0.... are they stacked vertically, or in a grid? the good news is that you can make your code much smaller, by perhaps 95%. I suggest you look into the TweenMax allTo() method. if you put all your days into an array like var daysArray:Array = new Array(prvi, drugi, tretji, cetrti, peti, sesti, sedmi) you can tween them all to an x:0 like this TweenMax.allTo(daysArray, 1.5, {x:0, ease:Elastic.easeOut, delay:0}) to remove them from the screen one by one and move them 500 pixesl from where they are with a little delay inbetween you could do TweenMax.allTo(daysArray, 1.5, {x:"500", ease:Elastic.easeOut}, .1) //the .1 is a tenth of a second delay. I just did a little video on the basics of the TweenMax allTo here: http://www.snorkl.tv/2011/02/five-hidde ... tweenlite/ watch the last video
  20. you're welcome. thank YOU too, your question inspired me to use onCompleteAll in my 5 hidden wonders of Tweenlite/Max series. http://www.snorkl.tv/2011/02/five-hidde ... tweenlite/
  21. hi list, that is great to hear. It really helps us to know that the update fixed it as we can now better help other people. that sounds like it was a really strange bug. have fun using GreenSock there is a lot of cool stuff to do. Carl
  22. before you try CS4 can please confirm that a) you understand what an instance name is you followed GreenSock's instructions and the instance name you have in the properties panel matches the one you are using in the code. unless we can get past this, CS4 is not going to make a difference and any further help we attempt to provide is not going to have any meaning. thanks Carl
  23. I'm curious, that loadImagesDisplayArray() function has a lot going on with while loops, dynamic array searching and String replacement. if you remove the call to loadImagesDisplayArray() in nextSlide() will the tween work? maybe experiment with this: function NextSlide():void { spacer = 10; iterations++; //reset the parent_container.x to something arbitrary just for testing parent_container.x = 400; //do not call LoadImageDisplayArray // LoadImageDisplayArray(); myTimer.addEventListener(TimerEvent.TIMER, CallNextSlide); myTimer.start(); } function CallNextSlide(event:TimerEvent):void { TweenMax.to(parent_container, 1, {x:150, onComplete:NextSlide}); // TweenLite.to(parent_container, 2, {x:150, onComplete:NextSlide()}); } } make sure parent_container contains something you can see of course. Being that your code doesn't show any other tweens and you claim there is no other code with tweens that could overwrite the one in question, I wonder if you are doing something to choke the flash player in loadImageDisplayArray. might be worth looking into. At this point the only effective way of testing is to remove things until it works. good luck on your project Carl
  24. just curious. try this: delete your movieclip from your file, copy the mc from my file and paste it into your file. test. -------------- if that doesn't work, cs4 might be worth a shot, but I'd contact adobe as Flash CS5 is too expensive to be giving you that type of trouble. also try a simple piece of code without the greensock stuff like mc.alpha = .5 and see what happens. -c
×