Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Thread Tools Rate Thread Display Modes
Old 10-27-2009, 09:41 PM   #1
Registered User
Join Date: Oct 2009
Posts: 1
Default Making a unique tweenFunction for different buttons mouse events?

Hello my name is Alfredo

And im developing a web site which needs animation for buttons in the Mouse_over and Mouse_out state.

i got my code Like this :

btn1.addEventListener(MouseEvent.MOUSE_OVER, oversection);
btn1.addEventListener(MouseEvent.MOUSE_OUT, outsection);

function outsection(evtObj:MouseEvent) {
trace ("mouse is out of "+evtObj.target.name+"")
var btnTween:Tween = new Tween(btn1_mc, "y", Strong.easeOut, -40,0,1, true);

What i want to do is change the red text which is the button to be animated for a variable which gets the name of the button in which the mouse event is taking place.
This way i dont have to do a function for each button.

Tried this but reports an error.
var btnTween:Tween = new Tween(""+evtObj.target.name+"_mc", "y", Strong.easeOut, -40,0,1, true);

Any ideas any one ?
a_gaudy is offline   Reply With Quote
Old 10-28-2009, 04:17 AM   #2
matthewjumpsoffbuildings's Avatar
Join Date: Nov 2007
Posts: 66

var btnTween:Tween = new Tween(evtObj.target, "y", Strong.easeOut, -40,0,1, true);

should work.
matthewjumpsoffbuildings is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:08 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.