Jump to content
Search Community

Simple tween > not working? (AS2)

T.Kick test
Moderator Tag

Recommended Posts

Hello,

 

Maybe someone can tell me why this simple set-up is not working ?

 

When I only put coding on 1 Button it works fine,

but when I extend to 2 buttons, strange things start to happen:

- mouse-over gives no hand-pointer-cursor

- and coding simply does not work.

 

Am I approaching the whole thing wrong, or did I miss some vital info ?

 

Thanks in advance

 

Note:

Flash CS4

AS2

 

 

stop();

import com.greensock.*;

import com.greensock.easing.*;

import com.greensock.plugins.*;

OverwriteManager.init(2)

 

// TweenLite

 

mcBut1.onMouseDown = function() {

TweenLite.to(object1,1.5,{_x:100, _y:210, _alpha:100});

}

mcBut2.onMouseDown = function() {

TweenLite.to(object1,1.5,{_x:300, _y:210, _alpha:100});

}

Link to comment
Share on other sites

You used onMouseDown instead of onPress - that's the problem. onMouseDown fires anytime the mouse gets pressed anywhere! So when you click mcBut1, BOTH of your functions were getting called. Same for mcBut2. Add a trace() inside each one and you'll see.

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