Jump to content
Search Community

sondanz

Members
  • Posts

    11
  • Joined

  • Last visited

sondanz's Achievements

0

Reputation

  1. Thank you so much! I will dig into this and see if I can get this bad boy working.
  2. Thanks Carl for your suggestions and all the wonderful video tutorials you've shared over the years. Unfortunately, this code only seems to loop the final tween, not the entire group. (I read the other thread you linked to earlier this week. It causes a hiccup as you jump from an empty keyframe, so that creates another issue.) import com.greensock.*; import com.greensock.easing.*; function initBanner() { TweenNano.from(text1, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:.5, overwrite:0}); TweenNano.from(text1b, 1, {_alpha:0, _y:"40", ease:Expo.easeOut, delay:.5, overwrite:0}); TweenNano.to(text1, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:2.5, overwrite:0}); TweenNano.to(bg1, 1, {_alpha:0, ease:Expo.easeOut, delay:2.5, overwrite:0}); TweenNano.from(text2, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:3, overwrite:0}); TweenNano.to(text2, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:5, overwrite:0}); TweenNano.from(text3, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:5.5, overwrite:0}); TweenNano.to(text3, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:7.5, overwrite:0}); TweenNano.from(text4, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:7.5, overwrite:0}); TweenNano.from(stall, 2, {_y:"10", delay:10, overwrite:0, onComplete:loop}); } initBanner(); // function to repeat twice var count = 0; function loop() { count++; if (count != 2){ initBanner(); //WHAT AM I DOING WRONG HERE? trace("ahhhh"); } }
  3. Is there any way I can reduce the size of TweenLite's footprint within my Flash banner? On publish, Actionscript 2.0 Classes make up 20K of my 32K banner. I'm not doing anything crazy here, just fading in/out and moving up/down. I tried using TweenNano...file size was GREAT. But I couldn't figure out how to make my banner repeat only two times, since there is no "repeat" or "restart" features like there are in TweenLite. Am I importing something that I don't need? Here's my AS2.0 TweenLite Code: // import the tween engine import com.greensock.*; import com.greensock.easing.*; ////////////////////////////////////////////////////////////////////////// // define the timeline var timeline:TimelineLite = new TimelineLite({onComplete:repeat}); // define repeat function variables var nPlays = 0; var totPlays = 2; // repeat timeline if played less than three times function repeat() { if (nPlays < totPlays) { timeline.restart(); nPlays++; } } ////////////////////////////////////////////////////////////////////////// // get your tween on timeline.appendMultiple([ TweenLite.from(text1, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:.5}), TweenLite.from(text1b, 1, {_alpha:0, _y:"40", ease:Expo.easeOut, delay:.5}), TweenLite.to(text1, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:2.5}), TweenLite.to(bg1, 1, {_alpha:0, ease:Expo.easeOut, delay:2.5}), TweenLite.from(text2, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:3}), TweenLite.to(text2, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:5}), TweenLite.from(text3, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:5.5}), TweenLite.to(text3, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:7.5}), TweenLite.from(text4, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:7.5}), TweenLite.from(stall, 2, {_y:"10", delay:10})]); stop(); Here's my AS2.0 TweenNano code. File size is great, but I can't figure out how to make it repeat only twice. // import the tween engine import com.greensock.*; import com.greensock.easing.*; ////////////////////////////////////////////////////////////////////////// // define repeat function variables var nPlays = 0; var totPlays = 2; // repeat timeline if played less than three times function repeat() { if (nPlays < totPlays) { //initBanner.start(); initBanner(); nPlays++; } } ////////////////////////////////////////////////////////////////////////// function initBanner({onComplete:repeat}) { //the issue is with this line TweenNano.from(text1, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:.5, overwrite:0}); TweenNano.from(text1b, 1, {_alpha:0, _y:"40", ease:Expo.easeOut, delay:.5, overwrite:0}); TweenNano.to(text1, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:2.5, overwrite:0}); TweenNano.to(bg1, 1, {_alpha:0, ease:Expo.easeOut, delay:2.5, overwrite:0}); TweenNano.from(text2, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:3, overwrite:0}); TweenNano.to(text2, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:5, overwrite:0}); TweenNano.from(text3, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:5.5, overwrite:0}); TweenNano.to(text3, 1, {_alpha:0, _y:"20", ease:Expo.easeOut, delay:7.5, overwrite:0}); TweenNano.from(text4, 1, {_alpha:0, _y:"-20", ease:Expo.easeOut, delay:7.5, overwrite:0}); TweenNano.from(stall, 2, {_y:"10", delay:10, overwrite:0}); } initBanner(); stop();
  4. In my experience, the Greensock engine is wonderful for tweening from point A to point B. But can you add some curve like the image below? If so, can you control how crazy you go with it?
  5. Figured out my play function needed to use "resume" instead of "play" function playMorph():void{ morpher.resume(); } Is this the best way to load an external swf? I feel like it's so slow to load.
  6. I really need some help on this! I am trying to load an external swf as soon as my movie start. That works fine. Then I want it to pause as soon as it loads. That works fine. But then I need another function to tell that external swf to play. That's what I can't figure out! My playMorph function is all jacked up! What am I doing wrong?!?! // function to load the external morph.swf var morpher:LoaderMax=new LoaderMax(); function loadMorph():void{ morpher.append(new SWFLoader("www.website.com/morph.swf", {container:boy})); morpher.load(); morpher.pause(); } function playMorph():void{ morpher.play(); } ///////////////////////////////////////////////////////////////////////////////////////////////// // import the tween engine import com.greensock.*; import com.greensock.easing.*; import com.greensock.loading.*; ///////////////////////////////////////////////////////////////////////////////////////////////// // main timeline var timeline:TimelineLite = new TimelineLite(); timeline.appendMultiple([ TweenLite.to(facebook, 1, {alpha:.2, ease:Expo.easeOut, delay:1, onComplete:loadMorph}), TweenLite.from(text1, 1, {alpha:0, ease:Expo.easeOut, delay:1})]); timeline.appendMultiple([ TweenLite.to(text1, 1, {alpha:0, ease:Expo.easeOut, delay:2}), TweenLite.from(boy, 1, {alpha:1, ease:Expo.easeOut, delay:2, onComplete:playMorph})]);
  7. Finally figured this out. I got rid of "this" and replaced it with a mc called "holder". // function to load the external morph.swf var morpher:LoaderMax=new LoaderMax({name:"morpher"}); function loadMorph():void{ morpher.append(new SWFLoader("morph.swf", {name:"morph", container:holder, x:200, y:0})); morpher.load(); TweenLite.to(holder, 1, {x:"-200", ease:Expo.easeOut}); }
  8. I am doing something similar, where I load an external swf. Carl's code was very helpful. But now I want to tween that external swf (just move it to the left) after it loads in. I am having no luck so far, but I feel like I'm pretty close. Any suggestions are greatly appreciated! // import the tween engine import com.greensock.*; import com.greensock.easing.*; import com.greensock.loading.*; //import com.greensock.events.LoaderEvent; //import com.greensock.loading.display.*; // function to load the external morph.swf var morpher:LoaderMax=new LoaderMax({name:"morpher"}); function loadMorph():void{ morpher.append(new SWFLoader("morph.swf", {name:"morph", container:this, x:200, y:0})); morpher.load(); TweenLite.to("morph", 1, {x:"-200", ease:Expo.easeOut}); } // main timeline var timeline:TimelineLite = new TimelineLite(); timeline.appendMultiple([ TweenLite.to(mc1, 1, {x:"255", ease:Expo.easeOut}), TweenLite.to(mc2, 1, {x:"-100", delay:.5, onComplete:loadMorph})]); stop();
  9. Awesome Engine! Awesome forums! However, after all the posts and examples, there are still some things I just can't figure out. I've gotten this timeline to loop 3 times. But how do I put all my MCs back in their starting positions before each repeat? (I must use TimeLineLite for weight reasons). // AS2 TimeLineLite // import the tween engine import com.greensock.*; import com.greensock.easing.*; // tracks how many times it has repeated var cycles:Number = 0; // define a function for repeating function playAgain():Void { if (cycles <= 2) { // define the timeline var timeline:TimelineLite = new TimelineLite(); // begin tweening timeline.append(new TweenLite(box1, 1, {_x:100, ease:Expo.easeOut})); timeline.append(new TweenLite(box2, 1, {_x:200, ease:Expo.easeOut})); timeline.append(new TweenLite(box3, 1, {_x:300, ease:Expo.easeOut})); timeline.append(new TweenLite(box4, 1, {_x:400, ease:Expo.easeOut, onComplete:playAgain})); cycles += 1; } } playAgain();
  10. Hey peeps, I'd love some help trouble shooting this restart button... View the .swf here: http://www.cleanplate.biz/storage/za_extreme/ As you can see, my 'play again' button (at the end of the animation) is restarting with my skydiver already onscreen. It's kinda creepy...she's just floating there...blankly staring at you...judging you... Here's my actionscript (AS2): // clickTag stuff.dlButton.onRelease = function () { getURL(_level0.clickTag,"_blank"); }; // repeat button stuff.playAgain.onPress = function() { myTimeline.restart(); } //////////////////////////////////////////////////////////////////////////////////// // animation import com.greensock.TweenLite; import com.greensock.TimelineLite; import com.greensock.easing.* var myTimeline:TimelineLite = new TimelineLite(); myTimeline.insert(new TweenLite(clouds1, 15, {_y:"-1500"}), 0); myTimeline.insert(new TweenLite(clouds2, 15, {_y:"-1500"}), 0); myTimeline.insert(new TweenLite(clouds3, 15, {_y:"-1500"}), 0); myTimeline.insert(new TweenLite(clouds4, 15, {_y:"-1500"}), 0); myTimeline.insert(new TweenLite(clouds5, 15, {_y:"-1500"}), 0); myTimeline.insert(new TweenLite(girl, 2, {_y:"200", ease:Expo.easeOut}), 0); myTimeline.insert(new TweenLite(chute1, 24, {_x:"40", _y:"850"}), 2); myTimeline.insert(new TweenLite(girl, 1.25, {_y:"600", ease:Expo.easeIn}), 1.75); myTimeline.insertMultiple([ new TweenLite(clouds1, 1, {_alpha:0}), new TweenLite(clouds2, 1, {_alpha:0}), new TweenLite(clouds3, 1, {_alpha:0}), new TweenLite(clouds4, 1, {_alpha:0}), new TweenLite(sky, 1, {_alpha:0}), new TweenLite(stuff, 1, {_alpha:100})], 6.5, myTimelineLite.duration); stop(); Any thoughts?
×
×
  • Create New...