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. unfortunately I don't have any idea what a common problem might be that would cause this. If the issue still remains after stripping out or pausing the non-troublesome timelines, perhaps posting the code to the funky timeline will help us assist you.
  2. yeah just a little adjustment is necessary: TweenMax.to(myLabel, 0.5, {glowFilter:{color:0x000000, alpha:0.75, blurX:15, blurY:15, yoyo:true, repeat:1}}); should be TweenMax.to(myLabel, 0.5, {glowFilter:{color:0x000000, alpha:0.75, blurX:15, blurY:15}, yoyo:true, repeat:1}); it gets tricky with all the {}, but you had the yoyo included as part of the glowFilter props. enjoy.
  3. there are a few ways of doing this probably. using a tweenMax frame tween you could try something like timeline.append(TweenMax.to(countdown_mc, 6, {frame:3, ease:Linear.easeNone, delay:1})) the next tween in the timeline may have to be delayed as well so that the last frame of the countdown_mc has time to be read you may have to play around with the timing to get it to work exactly like you want. i added the delay as without it the first frame didn't seem to show as long as the second frame. also, you may need to have a stop() action in frame 1 of the countdown MovieClip.
  4. hmmm, i used your code exactly as is except I had different instance names on my buttons and it worked fine. try putting trace(e.target.name); right before the switch statement like so function overBtn(e:Event):void{ trace(e.target.name); switch(e.target.name){ case"btn1": buttonTween1.play(); break; case"btn2": buttonTween2.play(); break; } } make sure it is tracing btn1 or btn2 unless there is a good reason to use MOUSE_OVER... I would suggest ROLL_OVER instead.
  5. yup, after the stagger amount you can add the the name of the onCompleteAll function like so var nav_array:Array = [logo_mc, work_btn, about_btn, contact_btn, about_mc, breadcrumb_mc] TweenMax.allFrom(nav_array, 1, { x:253, rotation:"40"}, 0.1, setMainNavBtns);
  6. nothing to worry about. it happens to me all the time
  7. cool thanks! here you Go! function fl_ClickToGoToWebPageS(event:MouseEvent):void { yourTimeline.currentProgress = 0.9; } should be function fl_ClickToGoToWebPageS(event:MouseEvent):void { yourtimeline.currentProgress = 0.9; } the T should be t in yourtimeline! Carl
  8. hello timaging. I am having difficulty understanding your problem. I am confused by also: also please post the error. from what I can tell, your code: buttonSkipOff.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPageS); function fl_ClickToGoToWebPageS(event:MouseEvent):void { yourTimeline.currentProgress = 0.9; } appears to be correct. Perhaps if you rephrase the question with just the elements that are not working I can be of better assistance also if you want yourTimeline to stop when it gets to .9 be sure to add yourTimeline.stop(); to the button code. Carl
  9. doh. i thought the scroller was part of the image
  10. i'm glad you got this resolved and updated the post, although it is puzzling that TimelineMax somehow fixed it. I also don't see how the screenshot proved the existence of a scene that was supposedly missing and causing an error. very strange. I wonder, is stateOutline something that is even capable of having a "scene"? i'm happy that you got it working!
  11. Hello Learner_7n, The car animation you linked to is actually a flash timeline animation. The easiest approach would be: TweenLite.to(some_mc, 1, {x:200}); TweenLite.to(some_mc, 1, {x:400, delay:5}); Carl
  12. try this: TweenMax.to(stateOutline, .5, {alpha:0, delay:14.5, onComplete:goNextScene}); function goNextScene(){ stateOutline.gotoAndPlay(1, "Nav01intro") } for the onComplete property it is best to pass in the name of a function and not try to define a function there. -Carl
  13. using TimelineMax you can adjust playback rate / timeScale so you can speed up or slow down a single tween or an entire sequence of tweens. http://www.greensock.com/timelinemax/ view the interactive example and adjust the timeScale property. I believe that once a TweenLite/Max instance is created its duration and all properties are set for the lifespan of the Tween. the dynamicProps plugin will allow the end values of the properties to change mid-tween. see the plugin explorer. using TweenLite or TweenMax you can dynamically set a duration upon the tweens creation by calculating the distance needed to travel and the desired speed of movement. If you have a specific scenario you need a solution for perhaps someone can provide more detailed help. I think you will find that the many features of greensock can enhance anything you would do with normal ActionScript.
  14. are you familiar with mask layers? it sounds like you want to do something similar to this: http://www.snorkl.tv/2010/08/hgtv-text- ... ith-flash/ are you using tweenlite?
  15. Carl

    TimelineMax

    timeline.append(mc1, 1, {x:200})); timeline.append(mc2, 1, {x:200}), -.5); mc2 will start half a second before mc1 ends because it has a negative offset -.5 check out http://www.greensock.com/as/docs/tween/ ... ml#append() and the rest of the info. There are a ton of fun things to play with Carl
  16. Hello FelipeSAMA, I had a hard time understanding what your question is. I looked at your zip but you only included a swf which didn't help much. The animation is very nice. TimelineLite/Max can basically replace anything you can do on the maintimeline in Flash and much more Being that it is code-based you have tremendous flexibility to adjust the speed of your animation and sequence hundreds or thousands of tweens. please watch these videos http://www.greensock.com/timeline-basics/ http://www.snorkl.tv/?s=timelinemax If after watching the videos you have a specific question about implementing any of the features, someone here will be glad to help you. it is always best to start learning this stuff by experimenting with a very small goal in mind. Trying to learn it while trying to integrate into a complex project may prove frustrating. Carl
  17. the gs.easing folder is an old version. your code should be: import com.greensock.TweenLite; import com.greensock.easing.*; if for some reason that doesn't work and you have old mixed up files.... get rid of the com and gs folders download the most recent version from www.greensock.com extract the zip place only the com folder (pertinent to your actionscript version AS3/AS2) next to your fla try again. good luck! Carl
  18. Damian, Glad to help. Yeah, your final code is great and I like the switch on the navClick. As for best practices and classes v timeline code. It can be a divisive issue. The way things are going I would encourage you to experiment more with breaking things into classes as that is the way things are going and you will learn good habits that will pay off as your skills increase and the scope of your projects increase. I find with my audience and the style of tutorials I do it is just easier to keep everything in one file and focus on very basic concepts. Also I'm no master of the class-based approach as I am still learning and sorting it all out. There is a time and a place for everything. There is plenty of cool stuff you can do on frame 1 of a timeline but it can get messy fast. The main problem is that most people (with no programming experience) struggle just to understand how to "click the button and go to a url"... when you throw in... create a new AS file... import these 12 classes... make this a private function... this protected... extend that... I feel it is a huge barrier to people who just want to make a circle bounce and change color every 5 seconds;) If you are just starting out, continue to read as much about OOP as you can... it will pay off! You should be very pleased with yourself for getting your project to work as you did. If you can get that far you have what it takes to keep learning more and it will get progressively easier. Carl
  19. Hey iceKomo, I'm flying a bit blind here but what I'll take a stab. what happens if you remove this.mouseChildren = false. does this class define the behavior of a menu that contains individual buttons or does it define the behavior of an individual button? the best thing to do is run a trace(event.target.name) in your mouse event handler functions. I'm thinking that killing the mouseChildren is preventing subclips from being the target of mouse events. Carl
  20. Hello, First, off congratulations on getting your buttons to work and your effort to implement the greensock classes. There are so many cool things to play with. There are many ways to get things done with AS3 in general and greensock. As for the efficiency aspect of your code. I don't see that there is much benefit to using TimelineLite in your particular case as TweenLite on its own can handle the simple fade. TimelineLite comes into play more when you are dealing with sequencing tweens. I notice you are using the timeScale property which is cool, but if you just have one tween, changing the duration is just as easy as setting a timeScale. your event handler functions code could simply be: function navBtnRollOver(evt:MouseEvent):void { TweenLite.to(this.deco_mc, .4, {alpha:1, ease:Sine.easeIn}); } function navBtnRollOut(evt:MouseEvent):void { TweenLite.to(this.deco_mc, .4, {alpha:0, ease:Sine.easeOut}); } I guess having timelineLites built could help for extending the animation effects in the future, but for a fade-in it is a bit overkill. Below are a few video tutorials I made that show a few different ways of efficiently having multiple MovieClip buttons share similar functionality. They are not class-based but pretty much hammer home the concepts of using target vs currentTarget properties of event objects. If anything download the sample files and take a look at them. They may serve as a good starting point for projects in the future. http://www.snorkl.tv/2010/08/assign-eve ... enttarget/ http://www.snorkl.tv/2010/11/create-a-s ... y-clicked/ http://www.snorkl.tv/2010/11/part-1-bui ... flash-as3/ http://www.snorkl.tv/2010/09/tweenmax-t ... wn-by-now/ of greater importance: http://www.greensock.com/tweening-tips/ read the api docs often! spend time reading through the posts on this forum. there is so much good stuff hidden in here. enjoy Carl
  21. hey artguy, first, and it's probably just a typo or you forgot to uncomment something you were testing: mc_play.addEventListener(MouseEvent.ROLL_OVER, forward); mc_play.addEventListener(MouseEvent.ROLL_OVER, reverse); you are overwriting the first ROLL_OVER on mc_play with the second. next, reverse() is a method that gets applied to a tween and not a movie clip directly. here is a basic implementation: import com.greensock.*; import com.greensock.easing.*; btn.addEventListener(MouseEvent.ROLL_OVER, btnOver); btn.addEventListener(MouseEvent.ROLL_OUT, btnOut); var playMovie:TweenMax ; function btnOver(e:MouseEvent):void{ playMovie = TweenMax.to(play_mc, 1, {frameLabel:"end"}); } function btnOut(e:MouseEvent):void{ playMovie.reverse(); } so you are telling the tween to reverse and not the movie clip. have fun Carl
  22. from what i'm getting of your situation (and i could be wrong)... i think the solution could be much simpler. I would suggest taking the use of the duration of the video as a delay / offset out of the equation completely. add an onComplete callback to the arrow tween that does a timeline.pause(). Or whenever it is that the video starts playing when the video is done playing fire an event that will trigger the timeline to resume or play. when the user clicks "skip" do the same. it appears you are already using an onComplete and have a solid knowledge of greensocky stuff so it should be pretty easy for you to whip up. its my impression that when the video is playing, the timeline isn't tweening any other objects so pausing it shouldn't hurt. when you resume... everything just tweens out as scheduled. hope this helps -Carl
  23. add the imports import com.greensock.*; import com.greensock.easing.*; assuming your button is starting with a y of 0: btn.tween = TweenLite.to(btn, 3, {y:2-*(btn.height + 10), ease:Elastic.easeOut}; take a look at the interactive tweening demo here: http://www.greensock.com/tweenlite/ enjoy greensock. Carl
  24. fixed fla attached here is the code import flash.display.MovieClip; import com.greensock.*; import com.greensock.plugins.*; import com.greensock.TweenMax; import flash.events.MouseEvent; import fl.transitions.*; import fl.transitions.easing.*; var imageLoader:Loader; var xml:XML; var xmlList:XMLList; var xmlLoader:URLLoader = new URLLoader(); var numClips:int=6; var columns:int=2; xmlLoader.load(new URLRequest("data/images.xml")); xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded); function xmlLoaded(event:Event):void { xml=XML(event.target.data); xmlList=xml.children(); for (var i:int = 0; i imageLoader = new Loader(); imageLoader.load(new URLRequest(xmlList[i].attribute("thumb"))); imageLoader.x = 6 +( i % columns )*600; imageLoader.y = 6 +(Math.floor(i/columns)*106); imageLoader.name=xmlList[i].attribute("source"); imageLoader.addEventListener(MouseEvent.CLICK, showPicture); //Carl did this: imageLoader.alpha=0; imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, startListener) //addChild(imageLoader); } } function showPicture(event:MouseEvent):void { imageLoader = new Loader(); imageLoader.load(new URLRequest(event.target.name)); imageLoader.x=165 imageLoader.y=6; //Carl did this imageLoader.alpha=0; imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, startListener) //addChild(imageLoader); } //this is where the fade happens function startListener(e:Event):void{ trace("loaded"+ e.target); var thisClip = e.target.loader; addChild(thisClip); TweenMax.to(thisClip, 1, {alpha:1}) } each imageLoader now has the ON_COMPLETE listener added to its contentLoaderInfo. one thing to watch out for in the future... you are literally re-creating A NEW loader over and over each time you click on a thumbnail and adding it to the stage. if you click the first thumb 10 times... the large image will load 10 times and you will have 10 instances of that image on the stage. in a larger gallery this could become problematic. for now, it works Carl
  25. you can just attach it to this thread / post. just hit "post reply" and use the upload attachment tab under the submit button.
×