Jump to content
Search Community

reverse() my movie clip

artguy test
Moderator Tag

Recommended Posts

I can't get my reverse button to work

it throw this error

 

TypeError: Error #1006: reverse is not a function.

at portfolio1_fla::MainTimeline/reverse()

 

import com.greensock.*;

import com.greensock.easing.*;

import flash.events.MouseEvent;

 

mc_one.addEventListener(MouseEvent.ROLL_OVER, one);

mc_two.addEventListener(MouseEvent.ROLL_OVER, two);

mc_three.addEventListener(MouseEvent.ROLL_OVER, three);

mc_play.addEventListener(MouseEvent.ROLL_OVER, forward);

mc_play.addEventListener(MouseEvent.ROLL_OVER, reverse);

//mc_back.addEventListener(MouseEvent.ROLL_OVER, back);

 

function one(e:MouseEvent):void{

TweenMax.to(mc_move, 1,{frameLabel:"hey"});

}

function two(e:MouseEvent):void{

TweenMax.to(mc_move, 1,{frameLabel:"you"});

}

function three(e:MouseEvent):void{

TweenMax.to(mc_move, 1,{frameLabel:"go"});

}

function forward(e:MouseEvent):void{

mc_move.play();

}

function reverse(e:MouseEvent):void{

mc_move.reverse();

}

Link to comment
Share on other sites

hey artguy,

 

first, and it's probably just a typo or you forgot to uncomment something you were testing:

 

mc_play.addEventListener(MouseEvent.ROLL_OVER, forward);
mc_play.addEventListener(MouseEvent.ROLL_OVER, reverse);

 

you are overwriting the first ROLL_OVER on mc_play with the second.

 

next, reverse() is a method that gets applied to a tween and not a movie clip directly.

 

here is a basic implementation:

 

import com.greensock.*;
import com.greensock.easing.*;

btn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
btn.addEventListener(MouseEvent.ROLL_OUT, btnOut);

var playMovie:TweenMax ;

function btnOver(e:MouseEvent):void{
playMovie = TweenMax.to(play_mc, 1, {frameLabel:"end"});
}

function btnOut(e:MouseEvent):void{
playMovie.reverse();
}

 

 

 

so you are telling the tween to reverse and not the movie clip.

 

 

have fun

 

Carl

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...