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




Detect When Mouse Leaves Flash Object?



Is there an easy way to determine when the mouse has left the flash object in the HTML?

I need to stopdrag() when the mouse is no longer within the bounds ov the movie.



jr member lol...www.inlikeflynn.tv



FlashKit > Flash Help > Flash ActionScript
Posted on: 02-05-2004, 05:15 AM


View Complete Forum Thread with Replies

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

Question On Action Script To Detect When Mouse Leaves Flash Area
Long title, but Search here is being difficult (timing out with a 404 page)
I have a button that covers my entire stage with an action script of:


Code:
on (rollOver) {
gotoAndPlay("start");
}

But I would also like it to do the same if it detects that the user's mouse leaves the flash area on an html page.

What would the action script be?

Detect When Mouse Leaves Movie
Hi. I'm trying to have a function execute when the mouse leaves the entire stage. Unfortunately, if the mouse leaves too soon i need the animation thats going to finish before the new function executes. Kind of like a rollover/rolloff but for the entire movie.

I've tried a couple things but nothing works perfectly. You can see in my code below where I tried a few things with _xmouse etc. I'm also not sure if i'm using the variables correctly. HELP!


Code:
var pos = "in";

import mx.transitions.Tween;
import mx.transitions.easing.*;
bigButton.onRollOver = function (){
if (pos == "in"){
pos = "moving";
//Animation In using tween classes
FadeDetails.onMotionFinished = function() {
pos = "out";
};
};
};
};
/*var xval = _root._xmouse;
var yval = _root._ymouse;
this.onEnterFrame = function() {
if ( xval > 0 && xval < 460 && yval < 236 && yval > 0 ) {
} else {
//if (xval < 0 || xval > 602 || yval > 236 || yval < 0) {
Close();
};
};*/
bigButton.onRollOut = function (){
Close();
};
function Close(){
if (pos == "out") {
pos = "moving";
//Animation Out using tween classes
MoveTextY2.onMotionFinished = function() {
pos = "in";
};
};
};
};

Having A Child Detect When The Mouse Leaves The Stage
I'm using the following to detect when the mouse leaves the stage, which is working fine until I try to add my movie as a child inside another swf when preloading. Then it breaks with a runtime error. I've tried playing around with adding the eventlistener to the parent stage, but can't see to get it to work.

Any advice?

Thanks.



Code:
stage.addEventListener(Event.MOUSE_LEAVE, hideMe);

Mouse Follow/stopfollow After Mouse Leaves Object (with Ease)
well, i think the title covers me entirely, i would like some help with a script.
The problem is, i have a scene with objects that at first they are static, when the mouse comes in and makes a move-over the scene and some objects,i have assigned multiple collision to the objects, i want when the mouse moves over a object, the object to follow the mouse,while colliding to all other objects and after a while i would like as the mouse moves away, the following to stop and the objects to return to its original spot with ease.

I know that this is a big one, but i would like some help if i could get

How Can I Detect When A Mouse Is Not On An Object?
I need to be able to detect when a mouse is not on an object.
I'm having trouble doing what I need to do.

What I have done so far:

I have 2 buttons, a and b.
Button b is much bigger than button a and sits behind button a.
Button b is hidden.
When the mouse is put over a, I have code that hides button a and makes button b visible.
When the mouse goes out of the area of button b, I have some code that hides button b and makes button a visible.
(Does all of that make sense!?)

The problem is that if you click down on button b, keep it held down and drag outside, this causes the code to mess up and not function as intended.

So, what I need to be able to do is: to be able to detect when the mouse is not on button b and then be able to execute my actions.

Any help would be appreciated.

Thanks.


OM

Detecting If Mouse Leaves Flash?
I've been trying to find a solution for several days in reliably detecting if the mouse leaves the Flash window. When I do a trace of the mouse movement, the last pixel is rarely the edge of the window, so I can't just code to shut everything off if the mouse is on the last pixel of the stage.

Example Movie

In this example, I have a hitTest for the bottom row of buttons. It activates the button and makes it slide up. Then on top of this movie clip are other buttons (which is why I'm using a hitTest instead of a button to control the slider). But if you exit out of the movie from the bottom, the button you were last on stays up. So frustrating!

Any ideas how to get this to shut off? I've heard of checking to see if you haven't moved your mouse for some time, but this doesn't seem to be a good solution either since sometimes you don't know if the user just isn't moving their mouse but still wants to keep it open.





























Edited: 05/15/2008 at 06:24:09 PM by Think Seed

Trigger When Mouse Leaves Flash
Hi

Is there any way to call a function when the mouse leaves the swf? I have an onRollOut function but it doesnt get triggered when i drag the mouse to fast off the flash file. I also tried with a functioin that is checking mouseposition every two seconds, and then calls a function if its outside the flash. didnt work eiteher any sugestions?

How To Detect When A Movieclip Leaves The Stage Completely?
I have a dynamic text field that scrolls like movie credits. The autosize is set to true so that the field will conform to the content that loads into it.

I want to put in a function that clears the motion interval once the movieclip containing the dynamic textfield leaves the stage.

What's the easiest way to do it?

Detect When The Cursor Leaves The Movie Area?
i thought this would be a trivial task, but i can't make it work.

initially the ball is not visible, then when the mouse is over the command_btn, the ball appears, and when the cursor goes outside the movie, i'd like to make the ball become invisible again.

here's what i thought would work, but i can't figure out why it doesn't.

ball_btn._visible = false;
command_btn.onRollOver = function () {
ball_btn._visible = true;
}
onRollOut = function (){
ball_btn._visible = false;
};

tia

Action When Mouse Leaves Flash Movie Area
Hello All!

I've got a flash movie that is a menu with a photo that is approximatly 700x300. I want an action that will trigger when the mouse leaves the flash movie all together. Is this possibe?

Is there a way to have have my movie know when the mouse is not in it and trigger something?

Detect When User Leaves Text Input Field, How?
Hi,

I will start building some forms in flashMX soon.
I want flash to do the client-side-validation: check to see if requiered fields are indeed filled.

I can do the validation when the user submits the form. No problem.

However I want some fields to evaluated immediately when the user leaves the field.

So assume there is a input text field with var = FirstName which is requiered!

When the user selects this field and leaves it again without filling it in, I want an action (warning) to be done.

How can I detect when the user leaves the field?

When The Mouse Leaves
I've got the mouse over effects thing down but can anyone give me tips on how to make effects after the mouse leaves a button? Where do I put the timeline...definitely not after HIT right?

Mouse Leaves .swf
is there a way of detecting if the mouse pointer leaves an swf movie.

I have an html page containing a small movie.
When the mouse is in the movie it scrolls depending on the position of the mouse but the problem Im having is that if the mouse pointer leaves the movie, it keeps scrolling but I want it to stop.

Anyone offer any help on this.

Thanks

Effect When The Mouse Leaves A Button
Can anyone tell me how to make a effect when the mouse leaves a button? Sort of the opposite of a mouseOver, I guess...

I tried, but i only see the following feilds when editing a button:

Up, Over, Down and Hit

Help me please

Detecting When The Mouse Leaves The Movie
This is my first post, so Hello to everybody.
And my first question is ... well, very simple.
I was playing with senocular's example how to use MOUSE_LEAVE.
The custom cursor should disappear when the mouse leaves the stage.
But it doesn't. It seems that the function cursorHide is never called.

public function cursorHide(evt:Event):void {
cursor.visible = false;

trace ("hide");
}
gives no output.

Mouse Leaves Mc Menu Scrolling
I have a horizontal menu that scrolls depending on the mouses location. I am having a problem when the mouse goes off of the mc the clip doe not go back to it's initial speed of +1 until the mouse enters back into the clip parameters. I have already set the mc to stop scrolling when the mouse reaches a certain x & y coordinates on all 4 sides. Is there a way to have my mc go back to +1 if the mouse has left the mc. The problem occurs when the mouse is pulled off of the clip so fast that it doesn't get its coordinates. I have been all over the forums all day and I am losing my mind. Some sample code would be great. I am a novice at actionscripting.

Fire Function When Mouse Leaves Movie
I'm working with a movie that needs to fire an fscommand whenever the mouse leaves. In case it matters, the movie sits in a table - plenty of margin on all sides.

thx

Falling Leaves Effect That Follows Mouse Cursor
i wish to create a falling leaves effect like http://www.ayatoweb.com/ae_tips_e/ae19_e.html#

i want the leaves to flip and fall, and at the same time, i want it to follow the mouse cursor and fall to the direction of where the mouse is.

how do i do this in flash???

Mouse Leaves Swf Too Fast - Code Breaks
Hey all, old problem in Flash that i've yet to find a great solution to...

PROBLEM: I have a playlist that slides over my video player when you mouse over the video screen. If you mouse away from the swf too fast the playlist doesn't slide away.. I've yet to find a method that always works.

So far I have a 20pixel margin around the video screen that when the mouse goes over the playlist hides.. I've looked into methods that allow for reading the mouse x/y when outside of the flash object which works very well, but it doesn't do much for me unless I can somehow read where on the page the swf loads (which i don't know as the site the swf is on is very modular and things can be moved around the page similar to Facebook)

This is a very common problem with Flash.. just wondering if anyone would like to share their approach to it.

Thaanks!

Trigger Action, When Mouse Leaves Stage?
Hi,

I've made menu in flash (http://www.manuelhuertas.net/ozomate/)

which is over the iframe that displays the contents, and i wanted to know if its possible to set up an action , when the mouse leaves the "stage" of the menu movie clip, so that the menu "collapses" to its original state.

If you rollover a subject,a sub menu displays under, but if you rollover to the next main subject the one before collapses that works well, just that as I say i will like to collapse them as well when the mouse leaves the stage.

Because now if you open a subject, and you rollover the mouse under the page, the submenu, keeps displaying, which becomes anoying.

thanks for your help, if you have a clue about it!

RollOuts Don't Register If The Mouse Leaves The Movie
Hey all, long time reader, first time poster...

This should probably be in the newbie section it seems so basic, but can't seem to find an answer anywhere.

I've basically got a movieClip which overlaps the edge of the _root.movie, with actions on the rollOut handler, but if you go from the clip off the edge of the movie, the rollOut doesn't register as flash stops registering events. I've also tried to track the mouse location and write a function which performs the same actions if the mouse is outside the _root.movie bounds, but this too stops working as soon as you leave the bounds of the movie.

I'm sure there's an easy way of doing it that i'm missing, but i haven't had much sleep

Anyway, would love any suggestions,

Thanks all.

Detecting When Mouse Cursor Leaves Movie
i have a flash movie which controls navigation for my site. i want to be able to detect when the cursor has left the movie so that i may reset the navigational 'rollOver' effects...


is there a simple way (or advanced way) to do something like this psuedo-like-code in actionscript:

if (mouseCursor is off movie){
button.gotoAndPlay("off_state");
}

Thanks!

Falling Leaves Effect That Follows Mouse Cursor
i wish to create a falling leaves effect like http://www.ayatoweb.com/ae_tips_e/ae19_e.html#

i want the leaves to flip and fall, and at the same time, i want it to follow the mouse cursor and fall to the direction of where the mouse is, like the snow falling down in the ultrashock's navigator.

how do i do this in flash???

Mouse Follower Leaves Screen When You Click Outside Browser Window
ok, so basically i'm using this script (three times - each a little different)

onClipEvent (enterFrame) {
if (_root.mainVar == 0) {
homeX = (-_root._xmouse*3)+1600;
} else {
homeX = (-_root.mainVar*3)+1600;
}
thisX = _x;
diffX = homeX-thisX;
if (_root.mainVar == 0) {
moveX = diffX/50;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}

the issue is that, when i test the file tester
it all looks fine, it's just that if you click outside the browser window, ya know on your desktop or something outside the 800 pixel flash movie, the MCs that are being thrown back and forth are going way out of the movie's bounds and eventually disapear until you click back somwhere within a reasonable area ...

now, admitidly i don't know that much about it and am tweaking some code found here to do what i want, so i'm just wondering if there's an easy fix to this little bug cause i know that eventually someone will do this and be like - oh you suck - trying to avoid this... any help is greatly appreciated!

SPEX: MAC OSX.3.6, dual 1.8 G5, 1.25 ram - Flash MX (not 2004) and safari

Makin MC Return To Original Co-ordinates If Mouse Leaves Set Area
Hello,

i have a flash movie, In it, when u move the mouse into set co-ordinates, it changes to a pencil MC. I need it to go back to its orignal position (white box on top) when it leaves those co-ordinates. you can see it here http://www.darkstarmedia.net/cemenu3.html

One extra thing i would like is this, i would like the pencil MC to rotate on the tip, so that whereever it is on the stage, the pencil tip will always point to the center. My code is below and my .fla is here
http://www.darkstarmedia.net/cemenu3.zip

onClipEvent (mouseMove) {
xmousepos3 = _xmouse;
ymousepos3 = _ymouse;
if (ymousepos3>ymousepos4 && xmousepos3>-157 && xmousepos3<160) {
_root.scrollclip.nextFrame();
startDrag("_root.scrollclip", false, 376, 41, 376, 142);
Mouse.hide();
startDrag("_root.arrow", true);
}
if (ymousepos3<ymousepos4 && xmousepos3>-157 && xmousepos3<160) {
_root.scrollclip.prevFrame();
startDrag("_root.scrollclip", false, 376, -41, 376, 42);
Mouse.hide();
startDrag("_root.arrow", true);
}
if (xmousepos3<-157 || xmousepos3>160) {
play();
_root.scrollclip.stopDrag();
_root.arrow.stopDrag();
Mouse.show();
_root.arrow._xmouse(30);
_root.arrow._ymouse(281);
}
xmousepos4 = _xmouse;
ymousepos4 = _ymouse;
}

Help Needed-- Script For Slowing Down And Stopping Rotation When Mouse Leaves .swf
I have a rotating movie clip that slows down and stops as the cursor moves to the center of the stage. When you move the cursor to the left or right it speeds up.

Problem: The movie clip doesn't stop rotating if you move the cursor to either side and then off of the .swf. I need the rotation to slow down and eventually stop if this happens. I've tried a couple things to no avail. Any suggestions?


The .swf can be viewed here: http://www.notveryinteresting.com/rotation.html

Here is the action script:

onClipEvent(load){
reducer=24;
brake=0.2;
frameRate=18;
}

onClipEvent(enterFrame){
mousePos={X:_root._xmouse};
if((0<_root._ymouse)and(_root._ymouse<380)){
rotation=(mousePos.X-275)/reducer;
this._rotation+=rotation;
}

else{
if(rotation>0){
rotation=rotation-brake;
this._rotation+=rotation;
}
if(rotation<0){
rotation=rotation+brake;
this._rotation+=rotation;
}

}
}

Mouse Leaves Area Of Clip, Button Anims Stick
I have a menu bar at the top of my page with buttons that animate- they float up when the mouse moves over them, and reveal a graphic beneath them. However, this is rather buggy for me- when the mouse is no longer over the flash movie, the button will often stick in the up position.. ie- you move your mouse over the home button, it floats up, you click on it and move your mouse back down to the webpage (HTML). The button sticks in the up position until the mouse moves over the swf again.

How do I fix this? I thought about trying the updateafterEvent mousemove, but that doesn't seem to help any... is there a way I could set it to refresh itself based on a timer? Would I be able to use the date object to have it check every 2 seconds or so, and if the mouse isn't currently over a hitbox, return all buttons to their 'down' coordinates? If anyone would quickly know how to program something like this (a basic example would be more than enough to get me started), or a better way to fix, I'd appreciate a little help. Thx!

BTW- link to the site with the prob: Portfolio site under construction

-john

Mouse Leaves Area Of Clip, Button Anims Stick
I have a menu bar at the top of my page with buttons that animate- they float up when the mouse moves over them, and reveal a graphic beneath them. However, this is rather buggy for me- when the mouse is no longer over the flash movie, the button will often stick in the up position.. ie- you move your mouse over the home button, it floats up, you click on it and move your mouse back down to the webpage (HTML). The button sticks in the up position until the mouse moves over the swf again.

How do I fix this? I thought about trying the updateafterEvent mousemove, but that doesn't seem to help any... is there a way I could set it to refresh itself based on a timer? Would I be able to use the date object to have it check every 2 seconds or so, and if the mouse isn't currently over a hitbox, return all buttons to their 'down' coordinates? If anyone would quickly know how to program something like this (a basic example would be more than enough to get me started), or a better way to fix, I'd appreciate a little help. Thx!

BTW- link to the site with the prob: Portfolio site under construction (not so good with Netscapers, yet, either)

-john

Detect Object/embed Tag From Flash
Hi All,

Am not sure whether this is possible or has already been done.

I was wondering if we can detect the Object/emebed tag's ID value from within Flash. It probably can be done through ExternalInterface or something like that but am unaware of how to do it. If someone has some insights into this can you let me know.

- Bala K J

Detect Mouse Outside Flash
I'm not convinced if anyone has a good answer about this issue.

Is there any best practice about detecting if mouse is outside flash movie. I know you can detect if the mouse is not moving ... but frankly this is not really a good answer ..... are we waiting for enhanced features in the coming player or?

How To Detect Flash Object Inside Frameset ?
Hi,

i tried like this
function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? document.getElementById(movieName) : document[movieName];
}
to detetct flash object to call a function inside flash but it shows object doesn't support this property. i am loading this flash movie content page inside a frameset. i have no clue how to detect can any one help me ?

Can We Detect Mouse Right Click In Flash?
Hi Flash Geeks,

Can we detect mouse right click in flash?

Thanx in Advance

No Solution? How To Detect Mouse Out Of Flash
Hi-

I've spent several hours combing posts and trying fixes and no luck with a sticky problem and I'm not sure it's even solvable. Let me describe it.

I have a mc which on one side butts up against the edge of my flash movie. I'm using hitTest to initiate an action on rollout (it is to roll up a drop down menu). This works fine for 3 sides of my movies (where there is aditional stage area). However, the hitTest does not work when rolling out of the flash movie on the one side where the mc butts up against.

I've tired padding the flash movie a bit on that side to give myself some stage area to let the hitTest register. However, i can only afford about 10 pixels, and ideally would prefer to have none. This solution generally works, but on very fast rollouts, it sometimes doesn't and the last _xmouse recorded by flash is still within the mc area.

So, is there a way to check that the mouse has rolled out in order to initiate an action? After combing thru countless online posts and docs, I was certain there was not. However, I came across a page where it does seems to work. It features drop downs that are about 10 pixels or so below the top of the flash movie. And no matter how quickly i roll out, the menu collapse is always triggered right-away (ie. i don't think some kind of timer is being used). How do they do this?!

You can view the page here: http://www.snowshoemountainhomes.com

I would appreciate any help from those more knowledgebale than myself. My thanks in advance!

Smurlin

Detect Flash Lose Focus (mouse Rollout Swf)
Hello All!

I haven't been able to figure out. Here's the deal:

I want my flash movie to go to a specific frame when the user moves the cursor away from the actual swf file (rollout) in the html page.
I tried different things, for instance having a big transparent movieclip in the background and use hitTest:

//this code is in the root level

this.createEmptyMovieClip('penCheck', 100000);
this.penCheck.ref = this;
this.penCheck.onEnterFrame = function() {
var hit = this.ref.stageArea.hitTest(_root._xmouse, _root._ymouse, true);
if (!hit) {
this.ref.gotoAndPlay("rollout");
}
};

This doesn't work until the user clicks outside the flash (flash loses focus).
PS: No Javascript allowed. Just AS.
Any ideas?

Detect Mouse Click Outside Flash Movie Area
Hi Guys,

I was wondering if there was a way to detect a mouse click outside of the flash movie area. I understand that it could be done via javascript, but I was wondering if there was a way to detect a click outside of the swf using actionscript. Thanks!

Detect Mouse _x & _y Attach Specific Clip And Have It Follow Mouse
I'm trying to make a clip that will have another clip attached (eventually it'll be a mask) when you roll over it. I want the mouse positon to be determined on rollover and a different clip (with different registration point) to be attached depending on which quadrant you rollover first. IE- you rollover the lower left quadrant of the mc first so an mc with an upper right registration point is attached and follows the mouse.

basically I want it to look like you're pulling a mask from out of nowhere onto the main mc from whatever corner you start on... (make sense?)

i'm trying to reconstruct what you see here (http://www.mullerphoto.com/)
this is the first baby step!

anyhow, here's my AS and i'll attach the .fla any help is great! I have the actionscript dictionary and am not afraid to use it, I just need help with the mechanics of how to actually do this (i.e.- which methods, properties, etc. to utilize) thanks!


Code:
leftfunction = function(){
if (patch._ymouse <= 100){
llowerfunction;
}else{
//this function starts the maskclip coming in from the upper left with a lower right reg point
_root.patch.attachMovie("lowerright", "lrclip", 1);
lrclip._x = _root.patch._xmouse;
lrclip._y = _root.patch._ymouse;
}
}

llowerfunction = function(){
//this function starts the maskclip coming in from the lower left with an upper right reg point
patch.attachMovie("upperright", "urclip", 1);
urclip._x = patch._xmouse;
urclip._y = patch._ymouse;
}

rightfunction = function(){
if (patch._ymouse <= 100){
rlowerfunction;
}else{
//this function starts the maskclip coming in from the upper right with a lower left reg point
patch.attachMovie("lowerleft", "llclip", 1);
llclip._x = patch._xmouse;
llclip._y = patch._ymouse;
}
}

rlowerfunction = function(){
//this function starts the maskclip coming in from the lower right with an upper left reg point
patch.attachMovie("upperleft", "ulclip", 1);
ulclip._x = patch._xmouse;
ulclip._y = patch._ymouse;
}

_root.patch.onRollOver = function() {
if (patch._xmouse <= 150){
leftfunction;
}else{
rightfunction;
}}

Best Alternative For "when Mouse Leaves Stage" ?
From what I've read the last couple of days there is no direct AS to detect when the mouse has left the stage ?

I thought (and tested) about using a button 2 pixels smaller than the stage, with on (rollOut) { but the whole stage had the pointy hand cursor and the rollOut didn't register! (my guess because there is not enough stage left to detect the mouse outside?) then rolling over the menu buttons caused lots of fun!


Is there a better, much more effective, preferably scripted (to avoid the pointy hand) way of detecting that the mouse is outside, or has just left the stage ?

thanks in advance.

On Mouse Out Of Flash Object
I have a navigation line where I want the tabs to go down when the mouse is off the navigation area.
It works great as long as the mouse continues to stay in the area bounded by the Flash object. I notice, however, that when the mouse is dragged quickly out of the Flash area of the page, it seems to think it is still over the navigation (variables do not get reset as they should on mouseout, etc.).
Is there any way to test if the the mouse is over the Flash object as a whole?
TIA,
Carolyn

_droptarget To Detect Non-top Object
Hi Folks,
I have a number of objects on the screen which I wish to colour modify via a drag-drop approach and setTransform.

This works OK but, where we have added "shadows" (alpha, greyscale overlays) on top of the objects, these now become the "_droptarget".

Is there anyway to get Flash to mark certain layers or objects (i.e. my shadows) not to seen by the _droptarget call so that it is the underlying object that gets "hit"?

Thanks in advance,

Chris. :-)

Detect Object Type
How can I detect the object type of an object referenced by a variable? I would like write a function to pass in "myVar" and have it return "listbox."

Thanks,
Rachel

Detect Closest Object
Hey freinds.
im pretty new to actionscript, but with a lot of help i came up with a script to find the closest object to another object, and get its co-ordinates. the purpouse being is to make an AI that makes one 'robot' shoot another closer target. heres the script.


Quote:




onClipEvent (load) {
var closet;
i = 1;
//interval is 1 to begin with.
}
onClipEvent (enterFrame) {
var closet;
while (i<=3) {
//i use 3 'robots' in my test. robot1, robot2, and robot3. this simply checks thru all of them.
tempDistX = Math.pow(this._x-_root["robot"+i]._x, 2);
tempDistY = Math.pow(this._y-_root["robot"+i]._y, 2);
tempDist = Math.pow(tempDistX+tempDistY, 1/2);
//temporarily retrieve distance of closest 'robot'
tempName = "robot"+i;
//and get its name
if (tempDist<closet || closet == undefined || endname == undefined) {
//if the currently being measured robot is closer then the one currently stored, use its co-ordinates and name
closet = tempDist;
endname = tempName;
}
i++;
//find next robot.
}
i = 1;
closestobject = endname;
endname = undefined;
//set 'closestobject' to the final closest robot, and clear the temporaries.
}




however i want to make the code more bulletproof. is there things i should do to it so i can apply it to other objects later eaisily, or is there something really dumb i should have added, like a 'while' function or whatnot?

thanks for the help!

(PS - I will include the file if you wish)

How Can I Detect The Existence Of An Object?
I need to write code to detect the existence of an object.
I will be writing code where I will have an array of objects.
I want to be able to check if a particular object with a particular name exists or not.

(I know I can track the objects by tracking the array... but I also need to check the existence of objects for other applications.)

Any help would be appreciated.

Thanks.


OM

Detect Selected Object
With the attahced code I load a variable amount of movieclips.

On the Click event I have to know which movieclip instance is selected.

If I ask for "this[movBV]" I always get the last one, what seems to be normal.
I'm sure it is something stupid, but I can't find :(.









Attach Code

function onComplete(event:Event):void
{
var loader:URLLoader = event.target as URLLoader;
if (loader != null)
{
externalXML = new XML(loader.data);
for(i=0;i<=totaalBV;i++)
{
var movID = i+1;
var movBV = "C" + movID;
if(externalXML.blokveld[i].attribute("actief") != "true")
{
this[movBV].visible = false;
}
else
{
this[movBV].buttonMode = true;
this[movBV].addEventListener(MouseEvent.CLICK, gaan);
}
}
}
}

Detect Object Stop With X & Y
Folks,

I'm trying to detect when an object (a golf ball) in my game stops bouncing. I need to track it's x and y position and tell when they both equal a set figure (the hole) a hitTest wasn't working as it was detecting each ball bounce not when it stopped rolling. So when the x and y both equal a figure. I'm not sure of the two operators needed to get this figure, can anyone help.

if ((this._x = -106.5) && (this 47.55)){
_root.cheer.play();
}

This doesn't seem to work.

Cheers all

Munki

Detect Collison With Any Object
i know how to use hitTest() to detect a collision with between two particular objects, but what if i want to detect if one of my objects collides with ANY other object i have out there?

Is This The Best Way To Detect If Mouse Is In MC?
I want a movie clip to have the "Mouseover" effect of a button. (refer to previous post for explanation http://board.flashkit.com/board/show...readid=210471)

Is this the best way? It seems extremely convoluted.

The code is below, but in a nutshell:

Decide if the _xmouse position (relative to MC) made positive is less than half the width of the movie &&
if the _ymouse position (relative to MC) made positive is less than half the height of the movie.

onClipEvent(mouseMove){
this.X = this._xmouse;
this.Y = this._ymouse;

if (this._xmouse >= 0){
MyX = this._xmouse;
} else {
MyX = this._xmouse - (this._xmouse * 2);
}

if (this._ymouse >= 0){
MyY = this._ymouse;
} else {
MyY = this._ymouse - (this._ymouse * 2);
}

if ((MyX < this._width/2) && (MyY < this._height/2)){
this._alpha = 60;
// I used _alpha for testing purposes, anything can go here
}else{
this._alpha = 100;
// I used _alpha for testing purposes, anything can go here
}

}

Help With Mouse Detect....
hi guys,
I dont know how to make a movie clip follow a movie clip. I think I need some code that is based on mouse detection.

I used a tutorial to make a movie clip follow my mouse. But i dont know how to make it follow another movie clip.
-thanks in advance

I am using flash MX 2003

How To Detect What Is Under The Mouse
Hi all,

how do I detect what is under the mouse, not just movie clips, for example flv, text boxes etc

Detect If Mouse Is Still ?
Hi

Is there a way to detect if the mouse is still ?

Basically I want my animation to play if nobody is at the computer for a few seconds.

Maybe I should do this the other way saying the it the animation plays unless someone moves the mouse ?

Thanks
David

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