Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Simple Mouse Event Detection Question.



Hey guys, This is somewhat of a stupid question..........I havent done any actionscript in a year, im rusty.

I have an MC, I want flash to do something when it detects the mouse rolling over the MC, simple enough. The thing is, I dont want the mouse to turn into a hand as it rolls over the MC. Im looking for somehting like an invisible rollover detector.

Thanks and Cheers.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 07-14-2004, 10:23 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Trigger An MC Event W/ Mouse Detection?
Is there a way to trigger a movie clip event (say play certain frame label) when the mouse moves over a certain area of the flash canvas horizontally?

Really Simple On Mouse Event
Please help, I am stuck with the simplest of codes! Have been away from Flash for a while and am having a mental block!

All I want to do is be able to click on an image and for it to go to another frame.

The code I have used is

on (press) {
gotoAndPlay(4); }

but it doesn't go anywhere! I have tried naming the frame and inputting the code

on (press) {
gotoAndPlay('Sultan'); }

but this still doesn't work - have also tried gotoAndStop but it just doesn't go anywhere - what am I doing wrong?!!? Thanks.

Simple Mouse Event For Animating My MC
Kinda new to this process..

I can get my MC to animate using this:


Quote:




private function btn1_mc():void {
var btn1_mc:MovieClip = new MovieClip();

btn1_mc.addEventListener(MouseEvent.CLICK, btn1Handler);

}




and this is my handler:


Code:
private function btn1Handler(event:MouseEvent):void {
Tweener.addTween(this, {scaleX:1.7, scaleY:1.7, time:1, transition:"easeoutelastic"});
}
this animates all the MC's I have placed in the class, which is not what I want, I'm trying to setup a navigation menu that allows me to easily apply animations to the specific elements of the nav bar.

Problem is that if I try and change the target from:"this", to a specific mc, i get the following error:


Code:
ReferenceError: Error #1069: Property scaleX not found on builtin.as$0.MethodClosure and there is no default value.
at caurina.transitions::Tweener$/::getPropertyValue()
at caurina.transitions::Tweener$/::updateTweenByIndex()
at caurina.transitions::Tweener$/::updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
ReferenceError: Error #1069: Property scaleX not found on builtin.as$0.MethodClosure and there is no default value.
at caurina.transitions::Tweener$/::getPropertyValue()
at caurina.transitions::Tweener$/::updateTweenByIndex()
at caurina.transitions::Tweener$/::updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
at caurina.transitions::Tweener$/::updateTweenByIndex()
at caurina.transitions::Tweener$/::updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
ReferenceError: Error #1069: Property scaleX not found on builtin.as$0.MethodClosure and there is no default value.
at caurina.transitions::Tweener$/::getPropertyValue()
at caurina.transitions::Tweener$/::updateTweenByIndex()
at caurina.transitions::Tweener$/::updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
ReferenceError: Error #1069: Property scaleX not found on builtin.as$0.MethodClosure and there is no default value.
at caurina.transitions::Tweener$/::getPropertyValue()
at caurina.transitions::Tweener$/::updateTweenByIndex()
at caurina.transitions::Tweener$/::updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
ReferenceError: Error #1069: Property scaleX not found on builtin.as$0.MethodClosure and there is no default value.

$fuk actionscript.org for the character limit$


ReferenceError: Error #1069: Property scaleX not found on b
What am i doing wrong?? Any help would be amazing.


Also it should be made clear, I need an event handler to actually be able to animate several different mc's when one of the mc's is clicked, not just the one being clicked. So when i click one button, the others need to move aside.

Event Listener Mouse Event Click - Obstructions
This is an oversimplification of my problem.

I have an event listener on a sprite.
I then have portions of this sprite covered with other sprites or moveclips.

If I click a movieclip, it blocks my eventlistener on the sprite underneath it.

Is it possible to listen to the even click 'through' a movieclip. I dont want interaction with them, but I dont want them as bitmap data onto the base sprite either...

Mouse Angle Detection II - Getting A Root Mouse Value
Hey,

I have been looking at and developing the following tutorial:

http://www.actionscripts.org/tutoria...II/index.shtml

Whilst changing it I was looking to place this tutorial in it's own movie, which could then be placed on to, say the root.

By doing this AS was not picking up the value of the mouse, because (I am guessing) of the following code:
x = this._xmouse;
y = this._ymouse*-1;

The mouse was no long on "this" but in a movie which was above it.

I thought that this could be solved be changing this. to either _root. or _parent. but neither of them worked.

I have had a search on these forums and net, and haven't come to a solution yet, so I was wondering if anybody could advise me on what code I could use to get the value of the mouse on a root or parent movie.

Thanks

Mouse Event, Event.target Vs Movieclip Name
Hi -

Can anyone help me with a mouse event issue, i'm truly baffled. There's a timer event that loads 4 movieclips (named 'serviceType'), each containing an instance of 2 objects (named 'btn' and 'thumbs'). When clicking on the MC (servicetype) it triggers a mouse event. I'm trying to reference child 'thumbs' of the serviceType MC but in the mouse event function, event.target traces no children, but serviceType traces the 2 children. BUT serviceType only refers to the last instance of serviceType that was loaded in the timer event. Why wouldn't event.target work??

Here's the code, and thanks for the help!!

ActionScript Code:
function loadServices(event:TimerEvent):void {
     count = event.target.currentCount -1;
     serviceType = new MovieClip;
     addChild(serviceType);
     btn = new Btn(serviceList, count);
     thumbs = new ThumbContainer(count);
     serviceType.addChild(btn);
     serviceType.addChild(thumbs);
     serviceType.addEventListener(MouseEvent.CLICK,loadThumbs);
}
           
function loadThumbs (event:MouseEvent):void {
     trace(serviceType.numChildren); /// Displays 2 (but refers to the last instance loaded)
     trace(event.target.numChildren);// Displays 0, why??
}

Clip Event Detection
how can i tell whether a on(release) has been used on a movie clip. i'm writing a script and i don't know how to detect this.

Event Handler Detection?
How can I test the existence (or lack thereof) of a movieclip's Event Handler, such as onLoad, onPress, etc?

Browser Event Detection In Flash
Hi,
I have seen quite a few flash site with the capabilites of detecting browser events like browser resize and more. For example, http://www.thibaud.be . If you resize the browser, the navigation are rearranged to fix the new size of the browser. My take is throught javascript but does any one know if flash already have that those event provided or the only way is through javascript and externalinterface API. If thats the case, can someone post a script or show me how. thanks.

Mouse Event Add Event Listener?
sorry, could not think of a better title!
anyway,
I downloaded a class that perfectly works for me,
it's basically a cube that rotates depending on mouse movement,
the way it does it is with the following line:

spBoard.addEventListener(MouseEvent.MOUSE_MOVE,boa rdMove);


what this does is, whenever the mouse moves the cube moves
the boardMove function does the movement based on the mouse's current position

but what i want to do is the keep the cube moving, if the mouse is on its left, it keeps rotating left, and on its rght, keep rotating right...and preferably to have the speed increase/decrease depending on how far/close mouse is to the center of the cube

any suggestions?
firstly is there an event listener that keeps calling the function just for the mouse 'being there' ? i tried rollover, didn't work

or maybe the boardMove function should be modified? i have no idea how though, totally new to AS3, here's the boardMove function for refrence:


ActionScript Code:
private function boardMove(e:MouseEvent):void {
        
                var locX:Number=prevX;
               
               
       
                if(doRotate){
               
               
                prevX=spBoard.mouseX;
                               
               
               
               
                               
                curTheta+=(prevX-locX);
                                   
               
               
                renderView(curTheta);
               
                e.updateAfterEvent();
               
                }
    }

Local Storage Settings Panel Event Detection
Hi, is there a way to detect the close event on the Local Storage Settings Panel of the Flash Player, or a way to know it has been closed after a System.showSettings(1) call ?

thank's

G

Mouse Event Handler Vs. Mouse Listeners?
I found an example use of the onMouseDown, onMouseMove, and onMouseUp event listeners in the ActionScript help files. The example used a listener to listen for the mouse events and draw boxes when the user clicks and drags. I removed the listener and the SWF still seems to work just fine. (See the mouseEventTest.fla.) I don't understand why someone would want to use a mouse event listener if it's not necessary to detect onMouseDown, onMouseMove and onMouseUp. Can someone explain this?

Maybe I'm just not understanding the difference between the listeners used with the top-level Mouse class and the onMouseDown event handlers that work with movie clips. Does my mouseEventTest.fla work without the listener because it's treating the onMouseDown as though it's a movie clip event handler associated with _root?

Mouse Detection
I am trying to create a scrolling menu which when the user moves the mouse away from the menu area the menu scrolls at a set speeed.

What is the best method to set a variable when the mouse is over the menu area.

i have tried several if statements such as

if (_root._ymouse>50){
flag = 1;
}

but this doesn't seem to work


?????
Thanks

Mouse Detection
Is it possible to detect if the mouse pointer is not sitting somewhere on your flash movie(say somewhere else on the browser) and then have a specified movie unload?

Does this make sense?

Mouse Detection?
Is it possible to know which Mc(non-regular shape) does mouse over with? Does the mc return the name on mouse over or i have detection which mc is the mouse touching?

Mouse Detection? Please Help
Hello all,
Can anyone help with this? I have a panoramic image slider embedded in a main movie. The slider works fine, but I would like for the slider to work only when the mouse is on it. Now the slider moves no matter where the mouse is within the flash movie, and that is quite annoying. How can I make the slider function only when the mouse is on top of it? I am really stuck, and any help would be greatly appreciated. Here is the url for the examplehttp://www.toddstudiosinc.com/test/ .

much thanks!

Mouse Detection
The basics
Im using Flash Mx, and Im very new to Actionscript and Flash

The Objective
I have this animation of seperate icons moving on a circle guide, so when the user goes around the circle with the mouse i want the icons to move on that circle guide as the mouse moves in a circle.

My attempts
Ive got pretty damn close with an If loop and the _xmouse but still not there!

It would be appreciated if someone could give me some light on this matter for I only have so much hair I can pull! lol

Thank you in advance!

[F8] Mouse Off Of Mc Detection
This is a recurrent problem.

The case is that I have a stage with 700 x 700 pixels and a centered mc with 620 x 620 pixels on it. I must to detect when mouse goes off of the mc, but it's not news that when you move mouse too fast, Flash cannot capture the action as faster, and it keep registering _xmouse and _ymouse as if it was still there within mc.

Any idea?

Mouse Detection Breaking Down
I am using a flash menu in one frame on an htm page that controls the pages in another frame. I want to close the menu on a rollout. Using the rollout state of a button or using xmouse and ymouse, if the user moves entirely out of the htm frame too quickly the rollout does not register. Is there some way for Flash to check to see if the mouse has left the swf entirely?

Anybody have an idea?

Thanks,
Brad

Detection The Scrollbutton On The Mouse
Does anyone know how i can detect the scrollbutton (on your mouse) in flash?

I'm gonna use it for a txt scroller so it has to be something like.

on (keyPress "<Mousescrollbutton.up>") {
DO THIS
}

on (keyPress "<Mousescrollbutton.down>") {
DO THIS
}

Anyone who can help me out?

Greetings Uhmmie

Mouse Detection ---> Keyframe
I've got a big problem:

I want a movie clip to move along the time line as the mouse mooves a scroller.

Said in another manner: like a text scroller, but instead of changing the _y position of the movie clip, it would send it to the desired frame in real time.

Can anybody help me with this ?

Mouse Detection Help Needed
Hello,
I recently completed this tutorial:
http://www.programmingart.com/free/t...ashvolume.html
My question is related to the up and down volume arrow buttons, and to mouse clicks in general. Is there any way to detect if the mouse is CURRENTLY down? I can use buttons to make the volume go up or down, but I can't seem to figure out how I could allow the user to press and hold the button, and make the volume increment higher or lower consecutively as long as the mouse button remains depressed. Basically, I need to detect if the mouse is down at any given moment, exactly like the Key.isDown function built into flash.
I would greatly appreciate any help and methods around this, and thanks a lot!
Jeremy
Programming Art

Right Mouse Click Detection...
Can Flash 5 ActionScript detect a right mouse click?

Right Mouse Click Detection...
Can Flash 5 ActionScript detect a right mouse click?

Mouse Inactivity Detection
hi everybody!!
I need "something" that makes my projector reset to the first frame of the timeline, in case nobody is at the desk for a couple of minutes...how would be the script for such a control?? should it be attached to a mc or how??
thanks!

Mouse Idle Detection?
Are there any scripts to detect if the mouse is idle? thanks. I'm trying to make a MC disappear with onMouseMove and i want the MC to re-awaken as the mouse is idle.. anyone know how? thanks

Mouse And Rotation Detection
i need some help i can't figure out what i'm doing wrong here. i followed this very easy and clear tutorial . i understand the concept but i cant seem to apply it on flash
this is what i come up with

thanks in advance

[F8] Mouse Inactivity Detection
Hi,

Just wondering if anyone can help me with creating a function that is called if the mouse is not moved for a set period of time (ie. 1 minute) and then cleared once the mouse is moved again.
Kind of like a screensaver.....
I already have the code I want to be called after a minute of inactivity, I just dont know how to write the function to call and clear it.

This is what I need to call after the mouse is idle for 1min.
code:

display = function(){
delay = 2000;
forwardInterval = setInterval(flip_mc, "flipForward", 3000); flip_mc.onLastPage = function(){
clearInterval(forwardInterval);
lastPageInterval = setInterval(closeLastPage, delay);
};

function closeLastPage() {
flip_mc.flipGotoPage(0);
clearInterval(lastPageInterval);
forwardInterval = setInterval(flip_mc, "flipForward", 2000);
};
};


Can anyone help me out ?

Collision Detection - Following The Mouse
Ok, basically, i have a fish following the mouse, which works fine, but then i want the fish to be restricted to it's 'bowl', with the black lines being boundaries.

Currently, it works like so: click me

The .fla file should be attached if that would help.

The movie is basically made up of the fish movie clip which has the following code applied to it:


Code:
onClipEvent (enterFrame) {
myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
_root.yChange = Math.round(_root._ymouse-this._y);
_root.xChange = Math.round(_root._xmouse-this._x);
_root.yMove = Math.round(_root.yChange/20);
_root.xMove = Math.round(_root.xChange/20);
this._y += _root.yMove;
this._x += _root.xMove;
this._rotation = myDegrees += -180;
}


this makes the fish follow the mouse

Then within the movie clip, frame one has the script:

Code:
a = eye._y-_ymouse;
b = eye._x-_xmouse;
angleA = Math.atan2(a, b);
degrees = angleA/(Math.pi/180);
setProperty("eye", _rotation, degrees);
a2 = eye2._y-_ymouse;
b2 = eye2._x-_xmouse;
angleA2 = Math.atan2(a2, b2);
degrees2 = angleA2/(Math.pi/180);
setProperty("eye2", _rotation, degrees2);


which makes the eyes follow the mouse also

frame two is just a gotoandplay thing to make sure the eyes are constantly refreshed


so yea, i'm fairly new to flash, and i just want the fish movie clip to be restricted within the bowl movieclip (the black lines and theres also a 0% alpha line at the top, so it's essentially keeping a box within a box, but all the tutorials i've found seem to be when you're manually controlling an object, which doesn't apply.

any help would be fandabbydosey

Problem With Mouse Detection
Hallo to everybody!
This is my first thread and I hope I didn't brake any rule.

So, my problem is like this:
I have a stage with a little area on the left side where my cursor change with my custom one(bluebox1). In that area I can move the mouse only on the x axis(from left to right and right to left).
After a while(5 seconds) my cusom cursor(blueox1) is free and I want it to move to the very right side of the stage and stop.
My problem is that this move of the bluebox1 is intended to be from the last position of the cursor - from there to go to the left side of the stage.
I attached the fla for more details because, I'm sure, my English is poor and I didn't explained nice.

I put this AS on the first frame of my stage:

Code:
bluebox1.onEnterFrame = function(){
Mouse.hide();
bluebox1.startDrag(this,false,100,100,100,0);
bluebox1._y = 100;
}
bluebox1.onRollOut = function(){
bluebox1.stopDrag();
Mouse.show();
}

My AS is Basic

[CS3] Left Right Mouse Detection
again in as2, how can you write code to say if the cursor is east of a movie clip change movie clip and if it is west of the movie clipchange the movie clip, if you understand, here is kinda what i want but u have to drag the movie clip...
http://www.flashkit.com/movies/Basic...1805/index.php
thanks
funky

Mouse Inactivity Detection
hello..
i want make a screensaver for my flash
i get a coding :


var inactiveTime = 5000;
// 5 seconds
function tooLong() {
trace ('you took long');
}
var intrvl = setInterval(tooLong, inactiveTime);
onMouseMove = function () {
clearInterval(intrvl);
intrvl = setInterval(tooLong, inactiveTime);
};
onKeyDown = function () {
clearInterval(intrvl);
intrvl = setInterval(tooLong, inactiveTime);
};
Key.addListener(this);


i've changed the trace ('you took long') with loadmovie('flash.swf','page'), but it doesn't work.
anyone can help me???

Mouse-Angle-Detection-I In AS3?
I'm looking for something similar to
http://www.actionscript.org/resource...-II/Page1.html

But in ActionScript 3.0 I somewhat understand the math, but I'm not sure if any of the math functions have changed, or how to implement it.

Thanks!

Mouse Inactivity Detection
MOUSE AND KEY INACTIVITY DETECTION

I wondering if anyone can something about mouse and key inactivity settings and how to make a script for it.

It is meant to be a trial work there i have a pet or such a thing that moves and jumps as long as you are active with your mouse or key pressing.

if not that script will take you to the beggining because the pet is run away.


But it would not be anything commercial or like that but a trial ENTERTAINING pet for my homesite. YOU TAKE CARE OF IT BY mouse click and move, and even keypress (i thougt to make soundclips to each and every of letters but it is not difficult)

So can anyone this, or have ready script or maybe can give me some leading clues about it. Is it possible to make in flash. because i tried to find some mouse inactivity script of some kind but there are no such.



Erik

Idle Mouse Detection?
Here's a question - Say I have a flash projector running at full screen and the user clicks a button which opens up a browser leading to a site. Is there anyway for Flash to detect when the user is idle and that when it happens, it goes back to the flash movie? Thanks for your time.

Idle Mouse Detection?
Here's a question - Say I have a flash projector running at full screen and the user clicks a button which opens up a browser leading to a site. Is there anyway for Flash to detect when the user is idle and that when it happens, it goes back to the flash movie? Thanks for your time.

[tip] Mouse L/M/R Button Detection
Hi guys.


The following script can be used to check which mouse button has been clicked.. including the mousewheel button (middle button).

It also detects the right mouse button, but I'm not sure that would be very useful because the Flash context menu appears.

Anyway, have a play with this :


ActionScript Code:
onEnterFrame = function() {
    if(ASnative(800,2)(1)) trace("1 : Left button down");
    if(ASnative(800,2)(2)) trace("2 : Right button down");
    if(ASnative(800,2)(4)) trace("4 : Middle button down");
};

Mouse Detection Gallery
im trying to create an image gallery similar to the one seen here http://www.flashimagegallery.com/pics/artwork/

does any one know any good tutorials or can atleast get me running off on a good start on how to approach something like this? i know it works with the _xmouse and _ymouse coords...what i want to know is how the got the coords of the picture to align with the mask coords as the mouse moves around. can anyone help?

Mouse Detection Query
Hi guys,

I have a particular action (a tween) which Id like to roll out when the mouse is over a particular square on the stage. When the mouse moves off that square, i want it to roll back in.

Thing is, I want to do it without buttons, or at least I want to do it without the mouse cursor switching to the overstate. An invisible button, if you like.

I know its easy to hide the mouse and start dragging a gif or some such on rollover, but I've always hated using that method, because ive found if you move the mouse fast enough, flash sometimes 'forgets' to drag the image; there's a dead-spot, so to speak.

ideally I want to do it by detecting the mouse co-ordinate, but im stumped as to how to do it, any ideas guys? I know how to check for a single mouse co-ordinate, but how do you check for both the x and y co-ordinate at the same time, ie, how can you detect when the mouse is within a square?

hope you can help guys,

s.

Help With Set Interval And Mouse Detection
I want to tell a movieclip to go to frame 46 (after a 5 second delay) if no mousemovement is detected. I'm not really sure how to do this. Here's what I have now, please let me know if you have a solution:


ActionScript Code:
onClipEvent (mouseMove) {
    recentMove = true;
}
onClipEvent (enterFrame) {
    if (recentMove != true) {
        setInterval(gotoAndPlay(46), 5000);
    }
}


Note that this code is placed on an empty movieclip in the timeline of the movie I am trying to control in this manner.

Thanks in advance for any help you can provide!!!

Problem With Mouse Detection
Hi all.. I have several stacked movieclips, and they fade in and out, when you rollover them there is a title that gets changed.. the problem is that if the rollover stays in place the new rollover state doesn't launch. I'm trying to work around that by checking for the position of the mouse and holding the place of the animation in a variable, then kicking off the right title.. it isn't working.. here is the code that is being naughty:


Code:
function changeProductName(){
if (_root._xmouse > item_button._x && _root._xmouse < item_button._x + item_button._width && _root._ymouse > item_button._y && _root._ymouse < item_button._ymouse + item_button._height){

if(animationLocation == 1){
productName.gotoAndPlay("product1");
}
if(animationLocation == 2){
productName.gotoAndPlay("product2");
}
if(animationLocation == 3){
productName.gotoAndPlay("product3");
}
if(animationLocation == 4){
productName.gotoAndPlay("product4");
}
if(animationLocation == 5){
productName.gotoAndPlay("product5");
}
}
}
it never gets inside the first "if" statement.

Mouse Movement Detection Timer
I had asked about a timer that can detect if the mouse has been moved for a certain amount of time and if not it would go back to the first frame (example=intro) , i had got the script of a fellow flash designer here but as my computer crashed i lost the fla file. if that person could get in contact with me that would be great. or if anybody else has the script. thanks in advance for any help.

RollOver Detection While Mouse Is Pressed?
Hello,

I found out that flash doesn't recognize a rollOver event while your mouse button is pressed.
The thing is, I can't do it with hitTest either, because too many mc's have to be tested all the time, so the pc can't keep up.

Does anyone has an alternate solution and wants to help me out?

Thank you,

[AS1] Mouse Speed Detection Problem
I've been facing this problem for years and I finally decided to try and find the answer to it. I use something like this code to detect the speed of the movement of a dragged object


PHP Code:



if (!go) {
        this["position_"+i] = this._y;
        i++;
        if (i == 3) {
            i = 1;
        }
        delta_y = this.position_2-this.position_1;
    }




This way I can find in what direction the mouse vertically has moved and at what speed. The problem is that every once in a while the speed will be in the opposite direction. What do people use to detect the direction of the movement of the mouse?

Moving A Movieclip Using Mouse Detection
Hi,

Does anybody have script that can move a movieclip in all directions depending on where the mouse is moved.

ie. when the cursor is moved to the right, the clip moves to the left etc ( kind of like a scrolling mechanism for scrolling a huge image that cannot all be seen at the same time (in a mask)).

Any help much appreciated

Help With Mouse Movement Detection And Timing
I want to tell a movieclip to go to frame 46 (after a 5 second delay) if no mousemovement is detected. I'm not really sure how to do this. Here's what I have now, please let me know if you have a solution:

code:
onClipEvent (mouseMove) {
recentMove = true;
}
onClipEvent (enterFrame) {
if (recentMove != true) {
setInterval(gotoAndPlay(46), 5000);
}
}


Note that this code is placed on an empty movieclip in the timeline of the movie I am trying to control in this manner.

Thanks in advance for any help you can provide!!!

Detection And Showing Mouse Proximiy
[IMG]Hi All
hope you can help me in my college project
its all about detecting how close the mouse is from multiple movie clips
as the user moves the mouse around the screen when he comes close to a movie clip the movie clip plays, say there are five movie clips on the screen the mouse will always be closest to one movie clip therefore that movie clip would play(could be a simple 2 frame animation of it changing colour)
also a pictorial meter that corresponds to a movie clip would increase as it got closer. I think it could be done with simple buttons but the breif is asking for mainly action scrip and it has got me stumped, i have some code for detecting if the mouse is close but am a bit stuck on the meter side of things
hope someone can help,
regards and thanks
bing

Mouse Detection+circle Movement
hey all,
I am trying to get a circle with a dot to rotate to the position of the mouse when the mouse is over the circle

I am using this mouse detection code:


Code:
this.pos = 0;
this.vel= 0;
this.acc = 0;
_root.onEnterFrame = function() {
this.lastPos = this.pos;
this.lastVel = this.vel;
this.pos = _root._xmouse;
this.vel = this.pos-this.lastPos;
this.acc = this.vel - this.lastVel;
trace("Position:"+this.pos +", Speed:"+this.vel +", Acceleration:"+this.acc);
}
and i tried various if formulas but i can't get them to work as a peace of a circle instead of a square

I was wondering if someone knew a different approach or a way to get the if formulas to work?

Follow Mouse Collision Detection
Ok ,
I have two objects as movieclips, and they both have a script on to follow mouse, and the angle of the mouse (the objects turn to the mouse).

I need to know how to make them not overlap when they come into contact with each other,
I have been able to detect the collision between the two, but i cannot make them 'bounce' off each other when they collide.
heres the script to detect the collision:
(the two objects are called letter, and letter2

letter_x = getProperty("/letter", _x);
letter_y = getProperty("/letter", _y);
letter2_x = getProperty("/letter2", _x);
letter2_y = getProperty("/letter2", _y);
letter_h = getProperty("/letter", _height)/2;
letter2_h = getProperty("/letter2", _height)/2;
letter_w = getProperty("/letter", _width)/2;
letter2_w = getProperty("/letter2", _width)/2;
distance_x = letter_x-letter2_x;
distance_y = letter_y-letter2_y;
area = (Number(letter_h)+Number(letter_w))*(Number(letter 2_h)+Number(letter2_w));
if (Number(Number(distance_x*distance_x)+Number(dista nce_y*distance_y))<=Number(area)) {

?????????

Please please help, !!!

Copyright © 2005-08 www.BigResource.com, All rights reserved