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. you had a conflict cause you were calling desactivarBotoes() in an onUpdate. so your tweens were fighting each other function doTweenCanetas() { //trace(TweenMax.isTweening(mcCanetas)); trace(mcCanetas.rotation); trace(nrCorCaneta); btCorpoEsquerda.addEventListener(MouseEvent.MOUSE_DOWN,functionClicarEsquerda); btCorpoEsquerda.mouseEnabled = true; btCorpoDireita.addEventListener(MouseEvent.MOUSE_DOWN,functionClicarDireita); btCorpoDireita.mouseEnabled = true; TweenLite.to(myCorpo, 0.5, {alpha:1, x:20, ease:Elastic.easeOut}); if (botaoPress && !TweenMax.isTweening(mcCanetas)) { //quando der a volta temos que corrigir o angulo para ficar novamentee nos 90º if(mcCanetas.rotation == 89.93999999999996){ mcCanetas.rotation = 90; } TweenLite.to(mcCanetas, 1, {rotation:String(velocidadeCaneta), ease:Linear.easeNone, onComplete:doTweenCanetas}); }else{ //this is new. this happens when the tween of mcCanetas is no longer running TweenLite.to(myCorpo, 0.5, {alpha:0, x:0, ease:Back.easeOut}); } } as for the alpha not working. make sure you are embedding your font
  2. Keep in mind that your timeline's values get recorded as soon as it gets created. if you do something like resize the stage after they have been recorded, the new positions aren't updated. In short, getNewPoint() only runs when the timeline is created, not when its playing. Are you using LiquidStage? if so, I believe the liquidPositionPlugin was created for this very scenario: http://www.greensock.com/as/docs/tween/ ... lugin.html if not, perhaps you can try to invalidate() your timeline when the stage gets resized. I'm not 100% certain that will work as I've never tried it. As a side note I don't think dynamicProps was intended to by integrated with TransformAroundPoint like you have attempted. Carl
  3. can you please re-post your code exactly as it is in your fla so that it can be tested? as it is now it has syntax errors. the following quick demo shows that the y of the clip does in fact get set back to its initial value: import com.greensock.*; import com.greensock.plugins.*; TweenPlugin.activate([TransformAroundCenterPlugin]) trace(mc.y) TweenMax.to(mc, 1, {transformAroundCenter:{scale:1.5}, onComplete:getY}) TweenMax.to(mc, 1, {transformAroundCenter:{scale:1}, delay:1, onComplete:getY}) function getY(){ trace(mc.y); } in my example mc starts with y of 200; first trace:200 trace after first tween: 175; trace after final tween: 200; I would avoid nesting anonymous functions inside your TweenMax calls. I will gladly test your code once it is formatted correctly. thanks Carl
  4. that effect is really pretty cool. It is most likely created by continually repositioning many objects and applying a number of filters with variable settings. There is nothing really in greensock that is going to create that effect "out of the box". GreenSock tweens could very likely be used to complement an effect like that. you could try messing with staggering a bunch of small circles through a bezierThrough tween with some fancy glowFilter settings. Its still going to take someone quite a bit of work to do that. I'd say the $25 price would be well worth it. Even if you used greensock, i'd imagine the continuous filter effects are going to contribute to some relatively heavy cpu usage.
  5. then do like you did with the thumbs and add a conditional statement to check if the image being loaded is the first one by evaluating c.currentTarget.name I am taking a vacation from this thread after this. I'll check back in a few days when I return.
  6. that appears to me to be the thumbsloaded function, so I don't think that is going to effect the big image. right? isn't the big image handled inside imageLoaded? that's where i would start.
  7. until you answer the second question or show where your delay is added there is nothing else I can do
  8. also check out my tutorial here: http://www.snorkl.tv/2011/04/fun-and-qu ... ster-bomb/ and the "bubbles" one that it links to. after you see this stuff in action a few times it will sink in. -c
  9. assuming all boxes are named boxesFlying.boxesFlying1 through boxesFlying.boxesFlying70 import com.greensock.*; import com.greensock.easing.*; function randomNumber(min:Number, max:Number):Number { //good return Math.floor(Math.random() * (1 + max - min) + min); } var masterTimeline:TimelineLite = new TimelineLite(); for(var i:int = 0; i var childTimeline:TimelineMax = new TimelineMax({repeat:10, yoyo:true}); //get a reference to each movieclip in flyingBoxes var mc:MovieClip = flyingBoxes["flyingBoxes" + i] as MovieClip //tween to random x and y at same time childTimeline.insertMultiple([ new TweenLite( mc, 2, { x:String(randomNumber(-200, 200)), ease:Bounce.easeOut}), new TweenLite( mc, 2, { y:String(randomNumber(-200, 200)), ease:Bounce.easeOut}) ]) //tween to another randomx and y at same time (after previous tweens occur); childTimeline.appendMultiple([ new TweenLite( mc, 1, { x:String(randomNumber(-200, 200)), ease:Bounce.easeOut}), new TweenLite( mc, 1, { y:String(randomNumber(-200, 200)), ease:Bounce.easeOut}) ]) masterTimeline.insert(childTimeline); } that will make each movie clip do a bunch of random stuff over and over again. its a bit technical, but ultimately easier than 800+ lines of code. to explain it all would be like a master class in TimelineMax. I recommend you learn about loops and then read the timelinelite/max documentation thoroughly and focus on the append, appendMultiple, insert, insertMultiple methods. give it a shot
  10. the thumb or the large image? are you sure the containers for both are set to be not visible before you are trying to fade them in?
  11. private function thumbsLoaded(e:LoaderEvent):void { //Setup Click Events for (var i:int = 0; i { var cdImg:ContentDisplay = LoaderMax.getContent("p"+(i+1)); cdImg.buttonMode = true; cdImg.addEventListener(MouseEvent.ROLL_OVER, onOver); cdImg.addEventListener(MouseEvent.ROLL_OUT, onOut); cdImg.addEventListener(MouseEvent.CLICK, onClick); //do something only for first thumb if(i == 0){ TweenMax.to(cdImg, .5, {autoAlpha:1}); loadImage(0); } } }
  12. If you are using TweenLite multiple times on the same mc, then you need to init the OverwriteManager http://www.greensock.com/overwritemanager/ import com.greensock.*; OverwriteManager.init(2); TweenLite.to(mc, 1, {_x:100}); TweenLite.to(mc, 1, {_y:300, delay:1}); For more control over robust sequences of tweens read up on TimelineLite/Max http://www.greensock.com/timelinelite/ (be sure to watch the video mentioned at the top of the page) also watch this: http://www.snorkl.tv/2010/08/a-quick-lo ... ax-tweens/ (AS3 but the same concepts still apply)
  13. Hi reinierf, I never would have thought of that being a feature request, but if one person wants it, I'm sure there are others. Its very nice of you to share your solution. I'm impressed. Carl
  14. Filters weren't added to Flash until Flash 8. Mx2004 doesn't support them. That is why the code won't work. You should be okay with doing basic tweens, but there have been many additions to the AS2 language and Flash player since 2004.
  15. you would want to do: LoaderMax.getLoader("p1").load
  16. cool, glad to help and to hear that the tutorials are making sense. thx!
  17. just a guess: have you given some_mc an initial x and y value? if not some_mc will probably remain jammed in the upper left corner close to 0,0 are you getting errors? what exactly isn't working?
  18. yes, the frame forward plugin will allow you to tween from frame 20 to frame 10 by going all the way to the end of a timeline to frame 1 and then to frame 10 i demonstrate it here: wonder #4 http://www.snorkl.tv/2011/02/five-hidde ... tweenlite/
  19. With the convenience of parse() you lose the flexibility to name each loader individually. For ultimate control, flexibility and minimal code I would recommend considering an XMLLoader so that you can define all your loader related info in one place and it will get automatically loaded for you once the xml file loads: http://www.greensock.com/as/docs/tween/ ... oader.html Sample xml format
  20. the main problem is that your moverCanetas function is an ENTER_FRAME function and it runs over and over and over again. so you were creating many many tweens. also this tween always said "tween rotation to 17.4" which is an absolute value. once mcCaneta tweens to 17.4 rotation... there is no animation left to be done. you need to do a relative value which means "the object's CURRENT rotation +/- 17.4. to do a relative tween use a String as your rotation value. rotation:"17.4" OR rotation:String(velocidadeCaneta) ALSO (which made testing difficult) your pens are NOT evenly dispersed inside mcCaneta. they do not have consistent 17.4 degree rotation, so it often appeared the rotation was not landing in the right spot. preview fixes: http://www.snorkl.tv/dev/rotateIncrementsSmooth/ the main changes I made to the code are as follows: function functionClicarEsquerda(event:MouseEvent):void { botaoPress = true; velocidadeCaneta = -17.14; //create the tween in separate function so both butons can use same code AND so that doTween() can be called repeatedly doTween(); } function doTween() { //Make sure a button is pressed AND that a tween is not currently in progress if (botaoPress && !TweenMax.isTweening(mcCanetas)) { //when the tween is done run it again if the button is still pressed notice onComplete TweenLite.to(mcCanetas, 1, {rotation:String(velocidadeCaneta), ease:Linear.easeNone, onComplete:doTween}); } } the above will create smooth and repetitive 17.4 degree rotations. when the user releases the mouse mcCaneta will stop at a 17.4 degree interval every time. In order to get accurate visuals, I programmatically placed "pens" inside mcCaneta with rotations at 17.4 degree intervals. for (var i:int = 0; i var pen:Pen = new Pen(); pen.rotation = i * 17.14; mcCanetas.addChild(pen); } please see my attached file.
  21. if you want your loader to persist, create it outside your function: var queue:LoaderMax=new LoaderMax({onProgressHandler:handleProgress, onComplete: handleImageLoaded}); public function handleImageRequested(imgStr:String):void { queue.append(new ImageLoader("assets/img/" + imgStr, {name: "photo1"})); queue.load(); } once all of your images are loaded you can then dispose/unload it. you may want to also find a way to give each loader a unique name instead of naming them all "photo1" so that any future calls to LoaderMax.getLoader or LoaderMax.getContent will be more intuitive and trouble-free. ideally you would want to be able to do LoaderMax.getLoader("photo30")
  22. The most straight-forward way for me would be to create a loop that stores them in an array var swfs_arr:Array = [] var numberOfLoaders:int = 5; for( var i:int = 0; i swfs_arr.push( new SWFLoader( "pages/page" + i + ".swf", {name:"p" + i", container:pagecontainer,onComplete:completeHandler})) } to tell the first SWFLoader to load: swfs_arr[0].load(); also it might make more sense in your loop to just append them to a LoaderMax. i look forward to our new friendship:)
  23. HI jean. Back.easeOut won't work because the currentProgress value can never be any greater that 1, or if it is, there is nothing to see. Imagine you had a flash pro timeline animation that was 30 frames long, if you told it to play frame 40 it would give you the same trouble. A Back ease overshoots its target. In the case of tweening the currentProgress value of a timeline the max value is 1. A Back ease probably tweens to 1.2 before going back to 1. make sense? Glad you got something from the tutorial. Carl ps: just so you know, I was confused by this too when I was making the tutorial:)
  24. having 2 maps in one mc is the way to go. you just have to loop it right before the 2nd map is fully on screen. attached is an example
  25. you can add as many properties as you wish to the vars object TweenMax.to (a13, 1.5, {x:88.15, y:264.3, width:520.30, height:119, rotation:180, ease:Bounce.easeOut}); to learn more please read: http://www.greensock.com/get-started-tweening/
×
×
  • Create New...