LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


Prev Previous Post   Next Post Next
  #1  
Old 05-28-2004, 03:25 PM
chris12295 chris12295 is offline
Registered User
 
Join Date: Sep 2002
Posts: 35
Rep Power: 0
chris12295 is on a distinguished road
only fade on mouse over

I have a mc that fades when you mouse over it. trouble is, it fades when you move the mouse over other parts of the stage. i only want it to fade if the mouse is over the mc. any ideas? here is my code for fading:

Actionscript:
onClipEvent(load) {
	//Makes variable to store inertia.
	_root.mosx = 0;
	//Makes variable to store inertia.
	_root.mosy = 0;
	_root.inertia = 5;
	_root.ratioX = 206/100;
	_root.ratioY = 138/100;
}
onClipEvent(enterFrame) {
	//Takes '_root.mosx' and subtracts by the _xmouse mouse position to yield the difference.
	_root.difx = _root.mosx - _root.fader._xmouse;
	//Takes '_root.mosy' and subtracts by the _ymouse mouse position to yield the difference.
	_root.dify = _root.mosy - _root.fader._ymouse;
	//Subtracts the total of the _xmouse position and '_root.mosx' and _root.inertia determines the speed of the effect.
	_root.mosx -= _root.difx / _root.inertia;
	//Subtracts the total of the _ymouse position and '_root.mosy' and _root.inertia determines the speed of the effect.
	_root.mosy -= _root.dify / _root.inertia;
	//Used to control the _alpha setting of 'graphic1' with dependency of the mouse position and inertia.
	_root.fader.graphic1._alpha = (_root.mosx / _root.ratioX) - (_root.mosy / _root.ratioY);
	//Used to control the _alpha setting of 'graphic2' with dependency of the mouse position and inertia.
	_root.fader.graphic2._alpha = 100 - (_root.mosx / _root.ratioX) - (_root.mosy / _root.ratioY);
	//Used to control the _alpha setting of 'graphic3' with dependency of the mouse position and inertia.
	_root.fader.graphic3._alpha = (_root.mosy / _root.ratioY) - 100 + (_root.mosx / _root.ratioX);
	//Used to control the _alpha setting of 'graphic_root.ratio' with dependency of the mouse position and inertia.
	_root.fader.graphic4._alpha = (_root.mosy / _root.ratioY) - (_root.mosx / _root.ratioX);
}
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
using mouse to choose array of objects in game stevor Newbies 3 08-11-2008 07:13 PM
positioning image with respect to mouse release within textfield ajayk Flash MX 2004 5 08-05-2005 02:32 PM
Interesting Question.........maybe...... Av General Flash 86 09-24-2002 10:11 AM
mouse up, down, and everything somerovi Newbies 2 04-05-2002 11:06 AM
Check mouse position in specific frame yan Advanced Flash 1 06-24-2001 12:22 AM




All times are GMT. The time now is 09:05 AM.