Jump to content
Search Community

Thomas James Thorstensson

Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by Thomas James Thorstensson

  1. Good evening, Curious, the documentation for TimelineMax.to says .to( target:Object, duration:Number, vars:Object, position:* ) : * Adds a TweenLite.to() tween to the end of the timeline (or elsewhere using the "position" parameter) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.to(...) ) but with less code. - But what if I instead wanted a TweenMax.to() added ? Is there way to still use to.() instead of doing : TimelineMax.add(TweenMax etc. Have a good one .t
  2. Thanks for your swift reply, yes I understand that that will fetch the last child in the array. But what I don't understand is why he first fetches the entire array, then fetches the last child. I mean, there are two calls to getChildren(): tl.remove(tl.getChildren()[tl.getChildren().length-1]) I am not sure what is happening under the hood: Is tl.remove first removing based on tl.getChildren() - and then a second time removing based on [tl.getChildren().length-1] Many Thanks .t
  3. Hello There. Hows it going? In a banner project I'm working on I see this used where 'tl' is an instance of TimelineMax tl.remove(tl.getChildren()[tl.getChildren().length-1]) Hmmmmm. That is slightly different to the api explanation: .remove().remove( value:* ) : *Removes a tween, timeline, callback, or label (or array of them) from the timeline. Hmm.... Question, what can the previous coder be up to by the first line of code. Can you feed it multiple arguments? Hmmm...not sure where I am, is this the way to the coffe machine? Thankful for reply .t
  4. Nice loaders by Jack. This might be a dumb question but what about a generic html5 banner containing video. I assume theres no point in trying to polite load the video as well? In other words: after loading images and scripts banner is ready to go and that is when we start the video. Thanks in advance
  5. Good evening all I found the answer here, thanks go to Carl, and thanks for looking into it,Shaun. http://greensock.com/forums/topic/10063-how-to-controlplayreverse-to-a-specific-tween-inside-a-timeline-then-pause-after-animation/ You have to use TimlineMax's tweenFromTo which can 'scrub' the playhead between two labels. So if I have a label "a" and a label "b" and "a" comes before "b" then tl.tweenFromTo("a","b") will in effect play the timeline as if it was in reverse with the difference that I now can stop when the playhead reaches the "a" label - whereas with the reverse() method you don't have the label control in that way (with reverse you can as far as I can see however control from where you want to reverse - which is different from wanting to control where you want to stop reversing to). (Unless I missed something in the docs) So this worked just fine: var tl = new TimelineMax() var $frame1 = document.getElementById('frame1'); var $txt1 = document.getElementById('txt1'); var $txt2 = document.getElementById('txt2'); tl.set($txt2, { opacity: 0 }) tl.add("a",1) tl.add("b",4) tl.add(TweenLite.to($frame1, 1, { alpha: 1 })); tl.add(TweenLite.to($txt1, 1, { scaleY: 0, ease: Elastic.easeOut }, 2)); tl.add(TweenLite.to($txt1, 1, { alpha: 0, ease: Elastic.easeOut }), "-=.7"); tl.add(TweenLite.to($txt2, 1, { alpha: 1 }), "-=.5"); tl.add(TweenLite.to($frame1, 1, { backgroundColor: "#08b200" }),"-=1"); tl.play(); var callbk = tl.eventCallback("onComplete", doReverse); function doReverse() { tl.tweenFromTo("b","a") tl.remove(callbk) } Thanks,
  6. Todays last question Is there a way that when I reverse an animation I can choose for it not to run until the very beginning (seeing as there is a way that I can reverse from before the end of animation). I tried the following since I wanted the 'reversed' version of the animation to stop 2 seconds from its beginning (otherwise it fades out to blank). But it didnt work. var callbk = tl.eventCallback("onComplete", doReverse); function doReverse() { tl.reverse(); timeline.addPause(2); } Perhaps there is a way I can continually listenfor progress during the reversal and break/pause at a certain time? Ideas welcome, in your own time. I'm done for today!
  7. Hello again Looking at the documentation and having used it a lot in the past days, it seems to me that TimelineLite can almost always be used. Since from your own example it can be written in two ways:= //add another tween at the end of the timeline (makes sequencing easy) tl.add( TweenLite.to(element, 0.5, {opacity:0}) ); //append a tween using the convenience method (shorter syntax) and offset it by 0.5 seconds tl.to(element, 1, {rotation:30}, "+=0.5"); The second way above is very similar to how you would write if using TweenLite.to( etc...) So I wonder if there's any good reason to not always use TimelineLite- it seems to inherit the same callbacks too ? Thanks in advance .S
  8. Ehhhhhh. Ignore I got the seconds wrong on the last part. It does work! My Bad! Back to coffe .S
  9. Hello Again The following works nicely var tl = new TimelineLite(); var $frame1 = document.getElementById('frame1'); var $txt1 = document.getElementById('txt1'); var $txt2 = document.getElementById('txt2'); tl.set($txt2, {opacity:0}) tl.add( TweenLite.to($frame1, 1, {alpha:1}) ); tl.add( TweenLite.to($frame1, 1, {backgroundColor:"#ff6a6a"}) ); tl.add( TweenLite.to($txt1,1,{scaleY:0, ease:Elastic.easeOut},2) ); tl.add( TweenLite.to($txt1,1,{alpha:0, ease:Elastic.easeOut}) ); tl.add( TweenLite.to($txt2, 1, {alpha:1}),"-=2" ); tl.play(); It works: my last timelinelite addition happens with intended overlap. But what if I would like to have the alpha begin to fade out as I shrink the text of the same object. This won't work: tl.add( TweenLite.to($txt1,1,{scaleY:0, ease:Elastic.easeOut},2) ); tl.add( TweenLite.to($txt1,1,{alpha:0, ease:Elastic.easeOut}, "-=2.5") ); I tried with a few different values just to make sure it is not the numbers. Is there a way I can do an overlap in tweening of the same object: should I perhaps default to the old skool delay method here and so not put it as a timelinelite parameter but "bake it in with the TweeLite. Thanks again .S, over coffe
  10. Gentlemen, I thank you for clearing this out! Great. Now I can have coffe and move on with my day, .S
  11. Me included among those folks as I have a well thumbed copy of 'HTML5 for Flash developers' . Great to know, one less gray hair today Thanks .S
  12. Here is another question How come that I can tween CSS properties directly without using the CSSPlugin. The below works. var $frame1 = document.getElementById('frame1') tl.add( TweenLite.to($frame1, 3, {backgroundColor:"#ff6a6a"}) ); tl.play() Am I missing something obvious here? If so, when should the CSS plugin be used since the above works in any case? Thanks in advance .S
  13. Hello! I know the difference between opactiy and autoAlpha: But what is the difference between opacity and alpha? Yes I realise that opacity is a css property: But if you use alpha on a dom object what is the difference to using opacity? I am sure this is a really dumb question, I must have missed something. Thankful for reply, Snoop out, .S
  14. Hi Well, the mystery is it works in a separate project and I tried cleaning the cache. Hmm. Maybe I have some good idea sooner or later. But I solved this for now by using Matrix.transformAroundInternalPoint. I mite send you some files next week though, if you dont mind, Ill pay in beer. Goodbye T
  15. I tested this in a separate SWF and it works fine when using club greensock and I have not forgotten to activate the plugin. But when I put the same code inside a view class in a Flashbuilder Flash Professional Robotlegs project I get the error from Flash on compile ReferenceError: Error #1069: Property onInitAllProps not found on com.greensock.plugins.TransformAroundPointPlugin and there is no default value. at com.greensock.plugins::TweenPlugin$/onTweenEvent()[C:\Users\Public\Documents\workspace\ClubGreensock\src\com\greensock\plugins\TweenPlugin.as:250] at com.greensock::TweenLite/init()[D:\_Flash\_AS3\src\com\greensock\TweenLite.as:389] In my View class I have TweenPlugin.activate([TransformAroundCenterPlugin, TransformAroundPointPlugin]); TweenLite.to(lever.leverHandle as MovieClip, 4, {ease:Sine.easeOut,transformAroundPoint: {point: new Point(50, 50), pointIsLocal: true, rotation: 100}}); The exact same code works if I do it in a non flash professional flashbuilder project. Is something being lost in translation ? Is the initAllProps for some reason not avaiable to the Flash swf that is compiled in Flash? Albeit I made sure also the Flash has the import to the club greensock swc? Is there some mysterious domain issue here/ As said the code works in a pure flashbuilder project or a pure flash project but not in a flashbuilder flash professional project, heeeeeeeeeeelp. heeeelp. Wait. Heeeeeeeeeeeeelp. Wait Heeeeeeeeeeeeeeeeeeeeel P
  16. Im my AssetLoaderProxy I have public function handleImageRequested(imgStr:String):void { trace ("image requested " + imgStr + " matching loader " +_imageDictionary[imgStr]); loaderNameStr=_imageDictionary[imgStr]; LoaderMax.prioritize(loaderNameStr).addEventListener(LoaderEvent.COMPLETE, handleImageLoaded); } /////////////// EDIT Can you do this : it seems to work but only for the first already loaded image ??? if (LoaderMax.getLoader(loaderNameStr).status == LoaderStatus.COMPLETED){ trace ("already loaded"); } //////////////////////////////////// SECOND EDIT ! It worked was me and my mediator not agreeing ruling out already loaded checks due to a boolean that was set to false! New question I suppose you can remove an event listener like so LoaderMax.getLoader(loaderNameStr).removeEventListener(LoaderEvent.COMPLETE, handleImageLoaded) I get a warning in Flasbuilder but it seems the code is doing its job! Hum ? Thanks
  17. Doing the following LoaderMax.activate([imageLoader]); mainQueue=LoaderMax.parse(dimVO.oneArr, {onProgress: handleAllProgress, onComplete: handleAllImagesLoaded}, {autoPlay: false}); mainQueue.prependURLs('assets/img/'); Where I parse an array of images. Question: Is there any way for me to get LoaderMax to name each image on the fly or does it somehow keep a named reference that I can acess. Cause I would like to be able to do the above AND prioritize any requested image with LoaderMax.prioritize("mylittlename"); Thanks Thomas ///// EDIT ////// Hum a trace reveals the following of onChildComplete : ImageLoader 'loader2' (assets/img/monaco_MS_14.00001.jpg) ImageLoader 'loader1' (assets/img/monaco_MS_14.00000.jpg) ImageLoader 'loader4' (assets/img/monaco_MS_14.00003.jpg) ImageLoader 'loader3' (assets/img/monaco_MS_14.00002.jpg) ImageLoader 'loader6' (assets/img/monaco_MS_14.00005.jpg) ImageLoader 'loader5' (assets/img/monaco_MS_14.00004.jpg) ImageLoader 'loader8' (assets/img/monaco_MS_14.00007.jpg) ImageLoader 'loader7' (assets/img/monaco_MS_14.00006.jpg) ImageLoader 'loader10' (assets/img/monaco_MS_14.00009.jpg) That is after parsing array of images. Hmm. Can I have any control over the naming ? Otherwise I see now how it can be done I believe just use the 'loader5' I can hang the name upon my event /////END EDIT/////
  18. Yes done so Doing the following now LoaderMax.activate([imageLoader]); mainQueue=LoaderMax.parse(dimVO.oneArr, {onProgress: handleAllProgress, onComplete: handleAllImagesLoaded}, {autoPlay: false}); mainQueue.prependURLs('assets/img/'); Where I parse an array of images. Question: Is there any way for me to get LoaderMax to name each image on the fly or does it somehow keep a named reference that I can acess. Cause I would like to be able to do the above AND prioritize any requested image with LoaderMax.prioritize("mylittlename"); Thanks Thomas
  19. Hi Im doing a 360 VR rotate tool which is based on a 2 dimensional array of images. At the moment no queloading in place but first port of call is to load the requested image in view. There are lots of images. At the moment my AssetLoaderProxy class has public function handleImageRequested(imgStr:String):void { var queue:LoaderMax=new LoaderMax({onProgressHandler:handleProgress, onComplete: handleImageLoaded}); queue.append(new ImageLoader("assets/img/" + imgStr, {name: "photo1"})); queue.load(); } It seems to me this is perhaps not best practice as I am everytime method is called creating a new instance of LoaderMax. I havent checked the GC yet but suspect this will force things to run slower. What would be best way of doing such a method as above. I need to use queue as background loading will be added to this. Thanks on beforehand Thomas
×
×
  • Create New...