Jump to content
Search Community

reverse movie clip when clicked another button

raccoon test
Moderator Tag

Recommended Posts

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}));
} 

Link to comment
Share on other sites

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}));
}

Link to comment
Share on other sites

I think he doesn't need any answer for his question anymore because they were solved in other forums. Anyway, timeline is your problem if you want to connect two different movies at a time. You have to edit the timeline wherein the new scene will play. I hope to see your project posted here.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...