Jump to content
Search Community

rob_v_5712

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by rob_v_5712

  1. Im having some issues here with timelines but Im just not sure why its happening, Im hoping someone can explain why its doing what its doing. I have an few animations going on, some happen automatically and some happen when I click a button. First I set up a timeline for one of the animations (I use frames b/c for me its easier) Its actually a set of 15 folders that spin onto the stage - only showing 3 for brevity. (The full timeline is 30 frames) var folderTimeline = new TimelineLite( {useFrames:true}); folderTimeline.add("folders",1) .call(trace,['in folderTimeline'],"folders") .fromTo(folder_1,15,{x:-64,y:490,alpha:0},{alpha:1, rotation:360,x:xy.folder_1.x,y:xy.folder_1.y} , "folders") .fromTo(folder_2,15,{x:-64,y:490,alpha:0},{alpha:1, rotation:360,x:xy.folder_2.x,y:xy.folder_2.y} , "folders+=3"); Then I have the main timeline of the slide. What we are concerned with is the folderTimeline myTimeline = new TimelineLite( {useFrames:true} ); myTimeline.add("titleBar", 15) .fromTo(title_bar,30,{x:xy.title_bar.x + 100, alpha:0},{x:xy.title_bar.x, alpha:1},"titleBar") .fromTo(bottomStripe,30,{x:xy.bottomStripe.x - 100, alpha:0},{x:xy.bottomStripe.x, alpha:1},"titleBar") .fromTo(topStripe,30,{x:xy.topStripe.x - 100, alpha:0},{x:xy.topStripe.x, alpha:1},"titleBar") .fromTo(myImage,30,{scaleX:2,scaleY:2,alpha:0},{scaleX:1,scaleY:1,alpha:1}, 30) .to(myImageShadow,30,{alpha:.25}, 30) .add(folderTimeline,65) .fromTo(tab_1,30,{y:xy.tab_1.y + 300, alpha:0},{y:xy.tab_1.y, alpha:1,ease:Strong.easeOut}, 100) so this executes and it works fine - at frame 65 - the folderTimeline runs and the folders are put on the stage where needed. Ok - so far so good. at frame 100 tab_1 shows up and I have an event listener on it for the mouse click. When its clicked - I want to get rid of the folders (I figured I could just reverse the folder timeline) then execute a new timeline for the tab_1 animation. tab_1.addEventListener(MouseEvent.CLICK, tab1Click); function tab1Click(event:MouseEvent) { folderTimeline.reverse(); tab1Timeline.play(); } The results of doing this is that the folderTimeline.reverse() does not execute at all. The folders stay on the screen but the tab1Timeline executes fine. So I then tried adding the folderTimeline.reverse directly into the tab1Timeline var tab1Timeline = new TimelineLite( {useFrames:true,paused:true} ); tab1Timeline.add('folders',1) .call(folderTimeline.reverse,[],"folders") .. .. other animations happens here... When I do this the folderTimeline does not see to reverse, the folders just disappear. They do not spin off and disappear. Any ideas why this would be?
  2. As usually the case, as soon as I hit submit - I got an AhHa moment, tried it, and it worked. I just changed the alpha setting to 0 and that made it fade out smoothly. So for anyone else that happens to run into this issue. Here is the glow on : TweenMax.to(blue.bar_6, 30, {glowFilter:{color:0x003C69, alpha:1, blurX:20, blurY:20,strength:2}}) here it the off TweenMax.to(blue.bar_6, 30, {glowFilter:{ alpha:0}})
  3. Hello all, I have a MC that I add a glowFilter to later one, Id like to fade out that glow filter, but it seems if I use remove:true, it just abruptly turns it off, it does not slowly go away. Am I missing something?
  4. Ok - kind of an odd question, but Im loading several exteral swfs into a player using swfLoader. How can I determine the frame rate of a loaded swf? I know the total frames but Id like to have a timer for each slide ..... 00:02 / 01:00 The only way I know to get the time is the total frame * the frame rate. Thanks
  5. You are getting the error b/c you are trying to reference symbols that do not exist yet. (they exist on frame 2 not frame 1). Sorry - I dont understand why they need to live on frame 2 - but can just alpha everything to 0 on frame 1 - then bring them back on frame 2?
  6. Looks like this was written for v11 - here is a quick port to v12 for the TypewriterPlugin. It won't allow me to attach a file for some reason so here a paste of the file: /** VERSION: 1.2 DATE: 3/27/2010 ACTIONSCRIPT VERSION: 3.0 @author Marco Di Giuseppe, marco [at] designmarco [dot] com @link http://designmarco.com Ported to Greensock v12 by @author Rob Verzera, rbv [at] logicswing [dot] com */ package com.greensock.plugins { import flash.text.TextField; import com.greensock.TweenLite; import com.greensock.plugins.TweenPlugin; /** TypewriterPlugin tweens the characters of a Textfield simulating a typing effect. @usage import com.greensock.TweenLite; import com.greensock.plugins.TweenPlugin; import com.greensock.plugins.TypewriterPlugin; TweenPlugin.activate([TypewriterPlugin]); //activation is permanent in the SWF, so this line only needs to be run once. TweenLite.to(textField, 0.5, {typewriter:"Lorem Ipsum"}); Greensock Tweening Platform @author Jack Doyle, jack@greensock.com Copyright 2010, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership. */ public class TypewriterPlugin extends TweenPlugin { /** @private **/ public static const API:Number = 2; //If the API/Framework for plugins changes in the future, this number helps determine compatibility /** @private **/ protected var _target:Object; //protected var target:TextField; protected var newText:String; protected var newLength:int; protected var oldText:String; protected var oldLength:int; public function TypewriterPlugin() { super("typewriter"); } override public function _onInitTween(target:Object, value:*, tween:TweenLite):Boolean { _target = target; if (!(_target is TextField)) return false; oldText = _target.text; oldLength = oldText.length; newText = String(value); newLength = newText.length; return true; } override public function setRatio(v:Number):void { super.setRatio(v); var valueA:Number = oldLength + (-oldLength * v); var valueB:Number = oldLength + ((newLength - oldLength) * v); _target.text = newText.substr(0, int(valueB - valueA + 0.5)) + oldText.substr(0, int(valueA + 0.5)); } } }
  7. Well it seems I did not have the CHANGE event for the slider set up. I have the slider set up as the demo - using the THUMB_DRAG to move along the timeline w/ a gotoAndStop I added the CHANGE event and it works! Thanks
  8. With some more playing, this is what I was able to do to get it to work, still not sure if this is the easiest way. I modified my addBullet function to create the bullets and add them to a new Timeline object, then return that object. in my code before I create the main Timeline - I do this for each bullet : var bulletTimeline1:TimelineLite = myTweens.addBullet(node_1); var bulletTimeline2:TimelineLite = myTweens.addBullet(node_2); all the way to 5 (1 for each bullet) Then in my main Timeline object - I just add those timelines where needed : .to(node_1,1,{alpha:1}, 3) .add(bulletTimeline1,3) .to(node_2,1,{alpha:1}, 6) .add(bulletTimeline2,6) etc.... This seems to work great. The only issue is, what if I have a situation where I have 10 bullets, do I need to declare 10 new bullet timelines? Is there a way to do that inline in the main Timeline obj so its a bit cleaner and dont have to worry about declaring a new var for each bullet? Note : This is how I initially had it on the timeline - and I will not ff/rewind: .call(myTweens.addBullet,[node_1],3)
  9. I was wondering if anyone had a suggestion on how to handle this. I have a timeline object with several tweens tied to a slider. I can slide fwd and back and the tweens go fwd and back no problem. In this instance the tweens are a list of 5 bullets. Before using Timeline, I had a function that I would call that would would create the bullets and tween them in on the stage. I just added that same function to the Timeline object using .call, if I just let things play, they fire off fine. But if I drag the slider, they don't fire / dont ff / rewind (which I can understand why they dont) The idea behind using that addBullet function is I can just pass it a MC and it will add a bullet to it automatically. I assume I need to modify my thinking in the case where I want to use the Timeline object w/ a slider. Like I mentioned in the beginning, just looking for some suggestions on how to handle this situation. (worst cast, I can just manually add the bullets to the stage first, but would rather not have to deal w/ that).
  10. Just a quick question, I'm defining a timeline Object that has several tweens, then it pauses and waits for user interaction, then will continue. My plan was to define the entire timeline, with the pause in there, then on the interaction have the timeline continue something like this: myTimeline.add("start",0) .to(MC1,1,{alpha:1},"start") .to(MC2,1,{alpha:1},"start") .to(MC3,1,{alpha:1},"start") .add("thePause", 5) .pause("thePause") .add("theEnd",10) .to(MC1,1,{alpha:0},"theEnd") .to(MC2,1,{alpha:0},"theEnd") .to(MC3,1,{alpha:0},"theEnd"); MC1.addEventListener(MouseEvent.CLICK, mcClick); function mcClick() { myTimeline.play(); } But it does not seem to like that. Is it just a syntax thing, or is this not the correct way to do this? The way I was able to get it to work was to do add this in place of the .pause: .call(pauseTimeline,[],"thePause") The pauseTimeline function just does a myTimeline.stop() But it just seems like there is an easier way to do it. Thanks
  11. Is there a simple way to see if a TimelineLite instance is currently playing or is paused? If not, would the best way be to just add a listener on the play and pause events? Looking at the docs - it seems like there are only events for START, UPDATE, REPEAT, REVERSE_COMPLETE, and COMPLETE Thanks
  12. I think I figured it out. If I instantiate a a new TimelineLIte first. the error goes away. So If change it to this : var childTimeline = new TimelineLite(); childTimeline = e.target.rawContent.myTimeline; I can then reference childTimeline and all is good w/ the world Please correct me if Im wrong, but I think the reason I was getting that error before was b/c I have the swfs loading as context="separate" in the XML file.
  13. Carl, I see exactly what you are saying. All my swfs use myTimeline for the TimelineLite object name. I have my SWFLoaders all being loaded via an XMLLoader. XML File : <SWFLoader name="swf_0" url="slide_01.swf" load="true" context="separate" /> The XMLLoader has a onChildComplete handler - so my goal is to just track the timelines in that function for later use. Here is what part of that function looks like : private function slideListChildCompleteHandler(e:LoaderEvent):void { trace("Done loading swf:" + e.target.name); var childTimeline:TimelineLite = e.target.rawContent.myTimeline; trace("The Childtimeline: "+childTimeline); Im getting an error : Error #1034: Type Coercion failed: cannot convert com.greensock::TimelineLite@33a8bf59 to com.greensock.TimelineLite. I suspect its b/c the 'e' is a LoaderEvent and not the actual SWFLoader, I think im just off on the reference or am I way off the mark here? Thanks
  14. Yea - putting the timeline stuff on frame 2 - that works great! Nothing like creating a solutions for a non problem Thanks for the suggestion.
  15. Hmm never though about just putting the TimelineMax stuff on frame 2 I will test that out - sometimes the simplest solutions are right in front of your eyes, you just don't notice them!
  16. Well - Im not sure if it was correct or not - but how I got around this was on the initial load of the swf that is playing, I create an XY object that stores the initial positions of all the objects on the stage. (just loop thru the stage) Then on any subsequent plays of that swf - I just reset the xy of the stage objects based on that XY object. The one other thing I had to do - and Im not sure why, was I had to kill then re-instantiate the TimelineMax object as well. With out doing that, it seemed as if the swf would sometimes start in random spots.
  17. Thanks carl - thats exactly what I was trying to do. The rawContent.tl was what I was missing. Thanks for you help yet again!
  18. Excellent - setting it separate seems to have done the trick. Thanks for the help.
  19. Sorry for the barrage of posts about Timeline...just having a few small issues. Here is the issue Im having. Im using LoaderMax to load up 4 swfs then play them in a player I created. The first 2 swfs use TimelineMax the last 2 are straight tweens using the normal timeline. The player has fwd/back/play/pause buttons and a progress bar. (There is a link below to illustrate whats going on) For this example ignore the progress bar and the play button for the first 2 swfs - they are only 3 frames so the progress bar is full basically from the start - and the play button acts as a next button as well. If I let each swf play to the end, then hit next all the swfs play fine. If I let one of the first 2 swfs start - then click fwd then click back - the positions of the mc's playing when you go back are messed up. If you do the same on the last 2 swfs - they always start fine. The fwd/back buttons basically just do a gotoAndPlay(1) on the current swf loaded. What appears to be happening is that for the swfs using TimelineMax, it seems to take the last position of the mc and start the tween from that spot vs where it lives on the stage normally at frame 1. If you click fwd/next a few times quick on the first 2 swfs you get some interesting results. Here is an example of what I mean : http://tinyurl.com/mprxako I have attached the fla of the actual swf files that are playing. (when you open it, you can publish each scene using ctrl+alt+enter) If that is what is indeed happening, is there a way to force a "reset" in that swf and have that swf start everything from the beginning each time based on original positions of the mc's on the stage? (that is what I was trying to do in the first 2 swfs - you will see the timeline on frame 1, then the start on frame 2.) Thanks for any insight or suggestions.
  20. I think I know the answer to this already - but here it goes. I have created a standalone swf player - you load a list of your swfs via XML -and it plays them. You can then go fwd and back thru your swfs as well as play and pause them. Im having issues when I run into swfs that I create using TimelineLite. Since in reality the entire timeline is only 1 frame but the swf may run say 20 seconds (based on the TimelineLite Object defined). The issue Im having is when I hit pause on the player, it does not effect the running swf. I assume b/c its doing a .stop() on the playing swf, and the stop only effect actual timeline animations. I suspect the answer is that in the "player" I have to check the swf to see if its using TimelineLite/Max vs the actual timeline. If that is the case, is that something that I can just do in the player(lets call it the parent) part of things, or would I have to mod the swf as well? The goal is obviously not to have to mod any swfs, the player should just play and not care what its playing. Any suggestions on an approach would be great.
  21. Thanks for the suggestion of the ApplicationDomain. Im just having some issues as to how to get it to work, or more specifically where it should live. Most of the examples Im seeing us something along these lines : var appDomain:ApplicationDomain = new ApplicationDomain(); var context:LoaderContext = new LoaderContext(false, appDomain); var loader:Loader = new Loader(); loader.load(new URLRequest("myButtons.swf"), context); Im using an XML file that has a list of SWFLoaders in it. var slideListXmlLoader:XMLLoader = new XMLLoader(slideListXmlLocation, {maxConnections: 5, prependURLs: "assets/swfs/", container: mainSwfContainer, onComplete: slideListCompleteHandler, onChildProgress: slideListChildProgressHandler, onChildOpen: slideListChildOpenHandler, onChildComplete: slideListChildCompleteHandler, onOpen: slideListOpenHandler, onInit: slideListInitHandler}); slideListXmlLoader.load(); xml file: <?xml version="1.0" encoding="iso-8859-1"?> <data> <SWFLoader name="swf_0" url="163_01.swf" estimatedBytes="800000" load="true" autoPlay="false" width="980" height="555" x="1" y="1" crop="true" /> <SWFLoader name="swf_1" url="163_02.swf" estimatedBytes="800000" load="true" autoPlay="false" width="980" height="555" x="1" y="1" crop="true" /> <SWFLoader name="swf_2" url="163_03.swf" estimatedBytes="800000" load="true" autoPlay="false" width="980" height="555" x="1" y="1" crop="true" /> <SWFLoader name="swf_3" url="163_04.swf" estimatedBytes="800000" load="true" autoPlay="false" width="980" height="555" x="1" y="1" crop="true" /> </data> Any help would be great.
  22. I already love some of the new features I have seen in 12. The timelineLite stuff is just killer. Here is kind of an related question. Last year I created a swf player, basically a standalone player that would play swfs read from an XML file. I never had any issues w/ it. That is until right now. It seems that any of the files that I publish w/ 12 cause the player to break during the loading phase of things. When I say break - I mean just a hard crash - the swf just goes away. I will try to put together a small demo so you can see what I mean - but can you think of any reason it would do that?
  23. I have been going thru a few tuts on TimelineLite and Max. Specifically the Video3_Demo_Source_Files found here : http://active.tutsplus.com/tutorials/animation/timelinelite-ultimate-starter-guide-advanced-sequencing/ I used the v12 of greensock and when I try to publish I get some errors. 1119: Access of possibly undefined property currentProgress through a reference with static type com.greensock:TimelineLite. 1168: Illegal assignment to function timeScale. 1168: Illegal assignment to function reversed. 1168: Illegal assignment to function paused. Are there any docs that show what those props have changed to in v12? Thanks It looks like in v12 currentProgress is no longer around.
  24. Man this just keeps getting better and better Thanks Carl, Ill give it a shot.
×
×
  • Create New...