Jump to content
Search Community

raccoon

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by raccoon

  1. Hello i made a simple menu with TimelineMMax, but is not working fine, this is the code:

     

    stop();
    
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.events.MouseEvent;
    
    var timeline:TimelineMax= new TimelineMax({paused:true});
    var timeline2:TimelineMax= new TimelineMax({paused:true});
    
    timeline.append(TweenMax.to(container, 3, {x:0, y:-1000, rotation:0, scaleX:1, scaleY:1}));
    timeline.append(TweenMax.to((container.nos.fondo), 5, {alpha:.6}));
    
    timeline2.append(TweenMax.to(container, 3, {x:1550, y:-1000, rotation:90, scaleX:1, scaleY:1}));
    timeline2.append(TweenMax.to((container.des.fondo), 5, {alpha:.6}));
    
    nos.addEventListener(MouseEvent.CLICK, go);
    
    function go(e:MouseEvent):void {
    timeline2.reverse();
    timeline.play();
    }
    
    des.addEventListener(MouseEvent.CLICK, go2);
    
    function go2(e:MouseEvent):void {
    timeline.reverse();
    timeline2.play();
    } 

     

    sample into the file

     

    Thanks...

  2. this is i want to do, but, using the if statement or applying to a for loop:

     

    stop();
    
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.events.MouseEvent;
    
    var timeline:TimelineMax= new TimelineMax({paused:true, onComplete:prueba2});
    var timeline2:TimelineMax= new TimelineMax();
    
    timeline.append(new TweenMax(alfa,3, {x:5, ease:Elastic.easeInOut}));
    timeline.append(TweenMax.to((alfa.beta),3, {x:5, ease:Elastic.easeInOut}));
    timeline.append(TweenMax.to((alfa.beta.teta),3, {x:5, alpha:1, ease:Elastic.easeInOut}));
    
    boton.addEventListener(MouseEvent.CLICK, prueba);
    
    function prueba(e:MouseEvent):void{
    timeline.play();
    }
    
    boton2.addEventListener(MouseEvent.CLICK, prueba2);
    
    function prueba2():void{
    timeline.reverse();
    timeline2.append(new TweenMax(alfa,3, {x:20, ease:Elastic.easeInOut}));
    }

  3. Hello, I'm trying to control the tween max timeline, i want to reverse a movie clip when clicked another button, write a for loop but i don't know how to finish it.

     

    Thanks for your help

     

    stop();
    
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.events.MouseEvent;
    
    import flash.events.Event;
    
    TweenMax.to(olas,3, {x:5, repeat:-1, yoyo:true, blurFilter:{blurX:5}, ease:Back.easeInOut});
    
    //botones
    var menu=[nos,des,atl,buc,pla,gal,con];
    for each (var botones in menu) {
       botones.addEventListener(MouseEvent.CLICK, clickmouse);
    }
    var timeline:TimelineMax= new TimelineMax({paused:true});
    
    //event listener botones
    function clickmouse(e:MouseEvent):void {
    //    gotoAndStop(e.target.name);
    
       for each (var botones in menu) {
           if (e.target==botones) {
               botones.enabled=false;
               botones.gotoAndStop( "disabled" );
               timeline.play();
           } else {
               botones.enabled=true;
               botones.gotoAndStop( "_up" )
           }    
       }
    }
    
    
    
    nos.addEventListener(MouseEvent.CLICK, go);
    
    function go(e:MouseEvent):void {
    timeline.append(TweenMax.to(container, 3, {x:0, y:-1000, rotation:360, scaleX:1, scaleY:1, /*blurFilter:{blurY:3, remove:true},*/ ease:Elastic.easeInOut}));
    timeline.append(TweenMax.to((container.nos.fondo), 2, {alpha:.6}));
    }
    
    des.addEventListener(MouseEvent.CLICK, go2);
    
    function go2(e:MouseEvent):void {
    timeline.append(TweenLite.to(container, 3, {x:1550, y:-1000, rotation:-270, scaleX:1, scaleY:1, /*blurFilter:{blurY:10, remove:true},*/ ease:Elastic.easeInOut}));
    timeline.append(TweenMax.to((container.des.fondo), 2, {alpha:.6}));
    } 

  4. thank for your answer again, but, i'm stuck with this preloader, i change the code again and i can't finished yet, the code works well in all browser until i want to load the next frame, my intention is not to bother you, but, i really need help, here's the new code and function in red is causing the problem.

     

    Thanks for your help.

     

    stop();

     

    import com.greensock.*;

    import com.greensock.easing.*;

    import com.greensock.TimelineMax;

     

    var total:Number;

    var loaded:Number;

     

    //calls the event listener to listen for the loading function

     

    loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);

     

    //Building the loading function

     

    function progressHandler(e:ProgressEvent):void{

    total = this.stage.loaderInfo.bytesTotal;

    loaded = this.stage.loaderInfo.bytesLoaded;

    var loadedPercentage:Number = (loaded/total) * 100;

     

     

     

    //If over 20% is loaded, tween the first circle.

    if (loadedPercentage > 20) {

     

    //Tween the circle

     

    TweenMax.to(c1, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});

     

    }

     

    //If over 40% is loaded, tween the second circle.

    if (loadedPercentage > 40) {

     

    //Tween the circle

    TweenMax.to(c2, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});

    }

     

    //If over 60% is loaded, tween the third circle.

    if (loadedPercentage > 60) {

     

    //Tween the circle

    TweenMax.to(c3, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});

    }

     

    //If over 80% is loaded, tween the fourth circle.

    if (loadedPercentage > 80) {

     

    //Tween the circle

    TweenMax.to(c4, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});

    }

     

    //If 100% is loaded, tween the fifth circle.

    if (loadedPercentage == 100) {

     

    //Tween the circle

    TweenMax.to(c5, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});

     

    if (total==loaded){

    TweenMax.allTo([c1,c2,c3,c4,c5], 1, {x: -200, alpha: 0, onComplete:goTo}, .1);

    trace("done");

    }

    }

    }

    function goTo():void{

    nextFrame();

    trace("done2");

    }

  5. Thank you for your answer again, you're very kind, the line works, but the fifth tween does not run, how can i add a gap to this tween to be completed?

     

    //If 100% is loaded, tween the fifth circle.
    if (loadedPercentage == 100) {
    
    //Tween the circles
    myTimeline.append(TweenMax.to(c5, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}}));
    
    TweenMax.allTo([c1,c2,c3,c4,c5], .5, {x: -200, alpha:0}, .1, nextFrame);
    
    //tells the movie if everything is loaded to remove the loading function and play the next frame
      if (total == loaded){
         this.removeEventListener(Event.ENTER_FRAME, loading);
      }
      }
    }

  6. Thank you for your answer, i followed your advise, improved the code, now it works but, it can't play the next frame after the time line is finished, used onComplete property, and does not work, what I'm i doing wrong.

    thank you again.

     

    here's the code:

     

    stop();
    
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.TimelineMax;
    
    
    
    //calls the event listener to listen for the loading function
    
    this.addEventListener(Event.ENTER_FRAME, loading);
    
    //Building the loading function
    
    function loading(e:Event):void{
    var total:Number = this.stage.loaderInfo.bytesTotal;
    var loaded:Number = this.stage.loaderInfo.bytesLoaded;
    var loadedPercentage:Number = (loaded/total) * 100;
    
    var myTimeline:TimelineMax=new TimelineMax();
    
    //If over 20% is loaded, tween the first circle.
    if (loadedPercentage > 20) {
    
    //Tween the hex
    
    TweenMax.to(c1, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});
    
    }
    
    //If over 40% is loaded, tween the second circle.
    if (loadedPercentage > 40) {
    
    //Tween the hex
    myTimeline.append(TweenMax.to(c2, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}}));
    }
    
    //If over 60% is loaded, tween the third circle.
    if (loadedPercentage > 60) {
    
    //Tween the hex
    myTimeline.append(TweenMax.to(c3, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}}));
    }
    
    //If over 80% is loaded, tween the fourth circle.
    if (loadedPercentage > 80) {
    
    //Tween the hex
    myTimeline.append(TweenMax.to(c4, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}}));
    }
    
    //If 100% is loaded, tween the fifth circle.
    if (loadedPercentage == 100) {
    
    //Tween the circles
    myTimeline.append(TweenMax.to(c5, 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}}));
    myTimeline.appendMultiple(TweenMax.allTo([c1,c2,c3,c4,c5], 0.5, {x: -200, alpha:0, onComplete:nextframe},.1));
    }
    
    function nextframe():void {
    //tells the movie if everything is loaded to remove the loading function and play the next frame
    if (total == loaded){
    	play();
    	this.removeEventListener(Event.ENTER_FRAME, loading);}
    	}
    }

  7. Hello im testing testing a new web site http://www.deepvfx.com/test I've created a preloader into the about section with the tweening platform 11 and the preloader works in Firefox And Chrome but in IE8 does not, then, created a basic preloader with plain as3 and it works, posting the code hoping to find a solution.

     

    Thanks for your help

     

    stop();
    
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.TimelineMax;
    
    //This array will contain all the preloader circles
    var circles:Array = [c1,c2,c3,c4,c5];
    
    //Listen for the loading progress
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    
    //This function is called as the loading progresses
    function progressHandler(e:ProgressEvent):void {
    
    //Check how much has been loaded (in percentages)
    var loadedPercentage:Number = (e.bytesLoaded * 100 / e.bytesTotal);
    
    //If over 20% is loaded, tween the first circle if it hasn't been tweened yet.
    if (loadedPercentage>20&&! circles[0].tweened) {
    
    	//Tween the circle
    	TweenMax.to(circles[0], 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});
    }
    
    //If over 40% is loaded, tween the second circle if it hasn't been tweened yet.
    if (loadedPercentage>40&&! circles[1].tweened) {
    
    	//Tween the circle
    	TweenMax.to(circles[1], 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});
    }
    
    //If over 60% is loaded, tween the third circle if it hasn't been tweened yet.
    if (loadedPercentage>60&&! circles[2].tweened) {
    
    	//Tween the circle
    	TweenMax.to(circles[2], 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});
    }
    
    //If over 80% is loaded, tween the fourth circle if it hasn't been tweened yet.
    if (loadedPercentage>80&&! circles[3].tweened) {
    
    	//Tween the circle
    	TweenMax.to(circles[3], 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}});
    }
    
    //If 100% is loaded, tween the fifth circle if it hasnn't been tweened yet.
    if (loadedPercentage==100&&! circles[4].tweened) {
    
    	//Tween the circle and call the function circlesTweened() when the tween is complete (this is the last circle).
    	TweenMax.to(circles[4], 1, {tint:0xff0000, glowFilter:{color:0xff0000, alpha:1, blurX:10, blurY:10}, onComplete: circlesTweened});
    }
    }
    
    //This function is called when the cirlces have been tweened (the image is loaded)
    function circlesTweened():void {
    
    //Loop through the circles
    for (var i = 0; i < circles.length; i++) {
    
    	//Tween the circles to the left side of the stage.
    	//Call the function circleLeft() when the tween is finished
    	TweenMax.to(circles[i], 0.5, {delay: i * 0.1, x: -200, alpha: 0, onComplete: circleLeft, onCompleteParams: [circles[i]]});
    }
    }
    
    //This function is called when a circle is animated to the left side.
    function circleLeft(circle:Circulo):void {
    
    
    //Check if the circle is the last one (most right)
    if (circle==circles[4]) {
    	nextFrame();
    }
    }

  8. Hello i'm working with this code, how can I improve the code especially with the TimelineLite class

    thank you

     

    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.TimelineLite;
    
    var menuItems:Array = [menu_mc2, menu_mc3, menu_mc4, menu_mc5, menu_mc6, menu_mc7, menu_mc8, menu_mc9];
    
    var menuTimeline:TimelineLite = new TimelineLite({paused:true});
    menuTimeline.appendMultiple( TweenMax.allTo(menuItems, 0.2, {y:"35", ease:Linear.easeNone}) );
    
    var menu1:Array = menuItems.slice(1);
    var menuTimeline1:TimelineLite = new TimelineLite({paused:true});
    menuTimeline1.appendMultiple( TweenMax.allTo(menu1, 0.2, {y:"70", ease:Linear.easeNone}) );
    
    //button1
    
    menu_mc1.addEventListener(MouseEvent.ROLL_OVER,showMenu);
    menu_mc1.addEventListener(MouseEvent.ROLL_OUT,hideMenu);
    
    function showMenu(event:MouseEvent) :void{
      menuTimeline.timeScale = 1;
      menuTimeline.play();
    }
    
    function hideMenu(event:MouseEvent):void {
     menuTimeline.timeScale = 0.5; //makes it go half as fast
      menuTimeline.reverse();
    }
    
    menu_mc2.addEventListener(MouseEvent.ROLL_OVER,showMenu2);
    menu_mc2.addEventListener(MouseEvent.ROLL_OUT,hideMenu2);
    
    function showMenu2(event:MouseEvent) :void{
      menuTimeline1.timeScale = 1;
      menuTimeline1.play();
    }
    
    function hideMenu2(event:MouseEvent):void {
      menuTimeline1.timeScale = 0.5; //makes it go half as fast
      menuTimeline1.reverse();
    }
    

  9. Hello 'm making an accordion menu with tweenLite, i want to know if there is an easier way to do it?.

    i don't have much experience with AS3

     

    Thank you

     

    var invisible_menu : Number = 0
    var visible_menu : Number = 0
    
    //Rollover btn1
    
    menu_mc1.addEventListener(MouseEvent.ROLL_OVER,showMenu);
    menu_mc1.addEventListener(MouseEvent.ROLL_OUT,hideMenu);
    
    function showMenu(event:MouseEvent) :void{
    visible_menu = 63
    TweenLite.to(menu_mc2, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 92
    TweenLite.to(menu_mc3, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 121
    TweenLite.to(menu_mc4, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 150
    TweenLite.to(menu_mc5, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 179
    TweenLite.to(menu_mc6, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 208
    TweenLite.to(menu_mc7, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 237
    TweenLite.to(menu_mc8, .2, {y:visible_menu,ease:Linear.easeIn});
    visible_menu = 266
    TweenLite.to(menu_mc9, .2, {y:visible_menu,ease:Linear.easeIn});
    }
    
    function hideMenu(event:MouseEvent):void {
    invisible_menu = 29
    TweenLite.to(menu_mc2, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 58
    TweenLite.to(menu_mc3, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 87
    TweenLite.to(menu_mc4, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 116
    TweenLite.to(menu_mc5, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 145
    TweenLite.to(menu_mc6, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 174
    TweenLite.to(menu_mc7, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 203
    TweenLite.to(menu_mc8, .4, {y:invisible_menu,ease:Linear.easeOut});
    invisible_menu = 232
    TweenLite.to(menu_mc9, .4, {y:invisible_menu,ease:Linear.easeOut});
    }
    

  10. Hello i want to know if i can work with arrays and tween lite:

     

    something like this:

    import gs.TweenLite;
    import gs.easing.*;
    
    /************** Slide Menu **************/
    var invisible_menu : Number = menu.menu_mc2.y;
    var visible_menu : Number = 65;
    var D1 : Array = [menu.menu_mc2,menu.menu_mc3,menu.menu_mc4,menu.menu_mc5,menu.menu_mc6];
    trace(D1);
    
    menu.menu_mc1.addEventListener(MouseEvent.ROLL_OVER,showMenu);
    menu.menu_mc1.addEventListener(MouseEvent.ROLL_OUT,hideMenu);
    
    function showMenu(event:MouseEvent) :void{
    TweenGroup.allTo(D1, .4, {y:visible_menu,ease:Linear.easeIn});
    
    }
    
    function hideMenu(event:MouseEvent):void {
    TweenGroup.allTo(D1, .4, {y:invisible_menu,ease:Elastic.easeOut});
    }
    

     

    Or can i use another version?

     

    thank you

×
×
  • Create New...