Hello,
I’m wondering if someone could pls help me out with this, i’ve got a MC named ‘enterBtn’, i want the volume of ‘crowd.wav’ to increase when the mouse moves towards ‘enterBtn’ and decrease when moving away.
i don’t know if this helps, but the co-ordinates of enterBtn are x =530, y = 344.
I have had some help with the code already;
function volume() {
BtnCenterX = EnterBtn._x + (EnterBtn._width/2);
BtnCenterY = EnterBtn._y + (EnterBtn._height/2);
DistanceVert = _root._ymouse - BtnCenterY;
DistanceHor = _root._xmouse - BtnCenterX;
Distance = Math._root((DistanceHor * DistanceHor) + (DistanceVert * DistanceVert));
Volume = 100 / Distance;
};
but an error msg returns in the output;
Error Scene=Scene 1, layer=actions, frame=126:Line 13: There is no method with the name ‘_root’.
Distance = Math._root((DistanceHor * DistanceHor) + (DistanceVert * DistanceVert));
Total ActionScript Errors: 1 Reported Errors: 1
thanks
Cam