ActionScript 2.0 :: HitTest To Check If Cursor Is On Navigation
May 10, 2006
I have written a little script for a navigation menu and basically all I want to do is to use hitTest to check if the cursor is on the navigation, and if so I want to play a simple shape tween opening animation, and if the cursor is out of the navigation I want to play a shape tween closing animation sounds simple enough right? But for some reason it doesn't run through the animation it just going there and stops, well here's the code..
Code:
onClipEvent (enterFrame) {
var Mousex = _root._xmouse;
var Mousey = _root._ymouse;
if (this.hitTest(Mousex,Mousey)) {
this.gotoAndPlay("On");
} else {
this.gotoAndPlay("Off");
}}
I've included a screen capture of the animation as well.
The current problem is trying to detect a hitTest with the cursor. I use this code very successfully in AS2, when I cannot use an rollover for whatever reason.
This is my AS2 code:
PHP Code:
onEnterFrame = function(){ if(my_mc.hitTest(_root._xmouse, _root._ymouse)) { race("the mouse is positioned over my_mc") }}
This is me trying unsuccessfully to convert it to AS3:
PHP Code:
stage.addEventListener(Event.ENTER_FRAME, intro); function intro(e:Event):void{ my_mc.hitTest(mouseX, mouseY) { trace("the mouse is positioned over my_mc") }}
Is it possible to send data(level,money,username,email,pw,id..) to my computer into a text document ? or send it to my website where it will save it ? and read the saved data.How to check hittest in AS3 ?(i know that this question is silly, but i have been in as3 only for 3 days)How to make a pause/play button ?
I know how to do custom cursors. I know how to do a MC controllable by keys.Next I would like to create a MC thats controlable by keys and effective on normal(!) buttons. (So don't give me that hitTest crap.)To illustrate the idea:Also, when I use this script:
I know you use the HitTest function to check for collisions, but how would I do that the moment a movie clip is dynamically created. So the moment the clip is created it would check if it is overlapping another clip. Also, does it matter if the clips are at different depths?
I'm trying to get my cursor to switch to a navigation icon. I have seen such things on sites like [URL] If you click on some of their work you'll understand what I mean. If anyone knows how to create this sort of thing.
I currently have a movieclip placed somewhere on my Stage.I'm wondering how I would be able to track if my cursor is within the height and width of that specific movieclip? I was told this could be done with mouseX somehow.
When my movieclip finishes to play I'm adding an eventListeners to it (ROLL_OVER and CLICK). But if at the moment my movieclip finishes to play the mouse cursor is already over the movieclip i want to run ROLL_OVER event handler (play "roll over" label) how can i do this without moving my mouse out the movieclip and back over the movieclip?
i just would like to know how to create an "hitTest" script inside a movieclip that is actually part of that hitTest code?I mean... I have mc A, and mc B. and the current hitTest code im using (that is on the timeline) makes mc A, destroy mc B when collide with it... but there are many mc B on the stage (with the same instance name) so, when mc A collide with one mc B, it destroys ALL mc's B... but i want it to destroy only the mc B that he collides, not all the others... maybe an hitTest script inside a movieclip B would work (somethig like "if MC A hitTest ME = i die" (not all the others)).
I am making use of a custom cursor on itemRenderers in a List component. The custom cursor works just fine except when I mouse over the Text component which is a child of the itemRenderer at which point I get two cursors, the custom and an iBar one on top of the other.Here's the code:
so the custom cursor I'm using works on the main timeline of my project. However, there are buttons in the application that load in movie clip pop-up windows and when this happens the cursor stays on the main timeline behind the movie clip resluting in the cursor not being seen. This is the code I'm currently using:
Working on a small kiosk app that runs in Firefox for Ubuntu. Mouse.hide() works for everything else, but the cursor is showing up in Firefox for Ubuntu
Is it possible to make a custom cursor with restraints (meaning you only see the cursor when you put your mouse in a certain spot, by defining both the max and min of the x & y), that is placed inside a movie clip; then make the movie clip move on the stage when you click certain buttons.
I am trying to make a simple game in flash it is a target shooting game i would like to make it so that the mouse cursor dissapears and a crosshair is shown as the cursor (if you get what i mean). I have created the crosshair and made it into a graphic symbol called: "crosshair" so what is the script i need to make it the cursor for the game
in the swf, when my mouse reaches a dynamic text box, the cursor always changes to the 'I' cursor and the text can be highlighted.how to prevent this from occurring?
For some strange reason, i cant get the precise cursor to work on the pencil tool. I prefer to use the pencil tool when drawing things. I usually use the brush tool for painting in the lines , or sketching something out. I did went to preferences, but even so, the pencil still doesnt turn into a precise cursor.
I'm working on an AS3 flash animation where I am using a custom cursor. At the end of the animation I want to default back to the regular arrow/hand cursor
how to change the cursor when move over a chart in flex i have tried useHandCursor="true" but it's not working in charts.....and it should show values also....
i am controlling a tractor mc with right and left keyboard keys and let the user move the tractor till it reach a certain point where it touch a mc i want to go to a certain frame and stop the keyboard event listener and also the hit test listenerso finally the tractor is moved by user till it touches the mc then we will jump to a certain framethis certain frame will not have both of the tractor and the mcPHP Code:
I am working with CS4 with AS 3. I have defined a MovieClip library symbol. I want the cursor to be hand when mouse is over it. The stage has a single instance of the symbol with the name "btn".
I tried the following in first frame of the symbol:this.addEventListener(MouseEvent.ROLL_OVER,overHand);function overHand(e:MouseEvent):void { Mouse.cursor = "hand";}
is there AS code that changes the cursor to an alternate cursor? i'm thinking like director, where the alt cursors are built-in--i would do a mouse.hide and then have a MC follow the cursor around, but this always seems choppy/slow to me-
See [URL] Now there is a button called Answera, which when clicked should have a symbol (movie clip) called Check appear at the cordinated specified. Check exists in the libary (but does not have an instance name) and no where else on the stage. when I run this code I get: 1180: Call to a possibly undefined method Check. -> var rightCheck = new Check(); How is it undefinded if it exists in the libary?
The following is my codes. This is still work in progress; so, you will see some functions with empty contents. Plus, this is my first Flex application; please bear with me. This is a quiz application that gets the questions and answers to each questions from a ColdFusion web service. There are three types of questions, True or False, Multiple Choice with single selection, and Multiple Choice with multiple selections. So, based upon the question type, the application would dynamically generate the appropriate amount of radio buttons or check boxes for the users to select. I got these working. The problem that I am having is, I am not sure how to check what the users have actually selected. In some other forums and posts on other web site, it said that I can use event.currentTarget.selectedValue to get the user selection. But when I actually do it, I got a run-time error saying, "Property selectedValue not found on mx.controls.FormItem and there is no default value." My question is, what do I need to do to capture the user selections?
does anyone know how to make the initial text in an input text box disappear once your cursor changes from the arrow to the type cursor? For example, I have an input text box which has the text visible saying "enter your email address here" I want this text to disappear automatically when the user goes to type something there...
if i move the cursor to a point A, it automatically moves by itself to a point B. then if i move the cursor from B to a point C, it bounces away to a point D. i stumbled upon this site while googling around. i'm not a techie, but yeah, i can handle word processors.