On Mouse Event
Hi , tornado here, I am looking for some help with an onmouse event. I want my images to slide right when my mouse is over them to the right , and then move left when i move my mouse to the left. Can anyone please help me with this problem. I have seached for tutorials and if anybody knows of one , please let me know cheers tornado
Ultrashock Forums > Flash > Flash Professional
Posted on: 2006-09-13
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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 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??
}
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();
}
}
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?
On Mouse Event
This shold be simple. I want a Movie Clip to start over when you click it. I found the action script, but the OnMouseEvent is greyed out. Any ideas?
Russell
On Mouse Event
I would like to replace a movie clip with another one on a mouse event but I I can't get it to work.I have tried to call it with a tell target but it dosen't work.
Thanks
Shawn
On Mouse Event
I have created a button, and when I go to select "On Mouse Event", it is greyed out and not active.
How do you activate this action?
Mouse Event
Am doing a mouse over to load a movie..everything is fine..would like to have movie dissapear when mouse is off button, could someone please help....thanks
On Mouse Event
I am having problems with this event handler.
i have 2 movieclips. each one has an on mousedown event handler attached to it. each one has a different specific geturl action if a mousedown is detected. for some strange reason, once one movie clip is pressed, it triggers the geturl action in the other movie clip as well, opening both url's - the one clicked and the one not clicked.the evnt handler is not on the movieclip that contains both movie clips. any ideas? any other time iv'e done this it was as simple as it sounds - not this time....thanx
Mouse Event
I am new to flash and I have both version 5 and MX. I am trying to add an action to some text in my movie. What I want is when someone clicks on this test they are taken to another frame. I am trying to add this action but the 'mouse event' selection is greyed out. Can someone help me?
Thanks
Michael
On Mouse Event
i am trying to follow tutorial but it says to add the "on mouse event" action and i cannot find it in MX. Does MX not do that anymore?
Mouse Event
Right is it possible to insert an image where u click the mouse? so say i click on the centre of the screen the imported image will appear there?
tnx
bbb
Mouse Event
ok well i have this nav bar right... each link you roll over there is a little effect, the links cover the entire swf.
here lies the problem:
:::::::::::::::::::::::::::::::::::::::::::
on a layer below the links, there is a little movie clip
there are 2 frames 1 - 2 with stop on both...
what i want to do is this:
when the mouse is present on the swf it plays 2.
when the mouse is not on the swf it plays 1.
how can i accomplsh this?
:::::::::::::::::::::::::::::::::::::::::::::
any help is welcomed!
thanks guys
Mouse Event
How do u do a script similar to the media player function when you move the mouse a list appear with a play list ? in other word a mouser listener so when i move the mouse in flash the player appears any one got a link or script ?
//RaZorCleaN
[CS3] Help With Mouse Over Event Please :)
Hi
I'm making a menu that is made up of two rows of images,3 at the top and 3 at the bottom. I have got to the point where i have all images in place and an actionscript has been applied so that the images increase in scale when the mouse moves over them. The only problem is that when you move the mouse over some of the images, they increase in scale but are behind some of the images which have not been enlarged. Can someone please help me?
Kind Regards
Jerum
Mouse Over Event
hi, made a small moviclip of a line that moves.
how do i get it to move only on mouse over?
thank you
Mouse Event Nothing
Hi there,
I think i have a very simple question:
Is there any way to let a movieclip do something when the mouse isnt over it.
for exaple:
on (nothing) {
gotoAndStop(1);
}
or is there any way to get this effect?
Greets,
Fregl K
On Mouse Event Greyed Out... Why?
Hi all!
I'm trying to make a skip intro button and I've used one of the default common library buttons (VCR Black) and I've placed a text symbol called "skip intro" over the top of it. But for some reason when I try and add the action command "On mouse event", it won't let me. It is greyed out as if I cannot select it. Can anyone tell me what could have caused this?
Thanks for your help pros!
-Airswift-
Mouse Rollout Event
What exactly does the mouse event (rollout) do?
I know what it is supposed to do (when moving mouse out of the button area with it on it should do something that you call when rollout occurs?) but I have never got it working!
Usually I make an invisible button that has a rollover and this acts as the rollout but I can't do it in this case as there is a button directly underneath which stops this from working.
Thanks!
Capturing Mouse Event?
hy,
is there any way for a button action to happen if the mouse pointer, while the button being depressed, mooves in and out of the hit area. (something like paintbrush).
drag out and drag over don't do the thing that I want cause the button action hapens if the mouse button is depressed while in the hit area.
thanx in advance.
On Mouse Event Dbl Click?
Hello
How can i made a buton that will activate on dbl click mouse event ??? Is that posible?
thanx
Right Mouse Click Event
How do I disable the right mouse click on my movie... or something similar to that? Maybe... concider the right click to be left click? I don't know.. I only know some action script, please help
On Mouse Event Troubles?
I am having a hard time accessing the on mouseevent action. Whenever i highlight my button and get up the actions palette, all the basic actions work and i am able to select them but the on mouseover action doesnt work at all? It wont let me select it for my buttons. I have gotten this to work before but cannot figure out how to get it to work again. I have tried several methods but with no success. What am i missing?
On (mouse Event) Not Working
hi.
i'm creating a drop down menu through flash 5 but whenever i try and put and action script: on (roll over) etc... i cant because it's not highlighted in the "basic" list and won't let me make the action. can anyone help me out
thanks.
PS. also, the onclipevent isn't highlighted aswell.
Xml - Flash, Mouse Event ?
hi,
we have dynamic text being pulled from an xml file.
(we have that much working)
the nodes are something like
name (or category)
person
url
what we want to do is if the text has a url value,
i would like it to mouse over a highlight (behind it).
i am guessing that it would be something
like if it has a url then load this symbol...
????
i have no idea what the action script would be or where it should go?
can someone help a first time poster??
thanks a bunch,
panda
Conditional On Mouse Event
I have a movie clip which is basically a "popup" in the middle of the screen, but when it comes up I want to disable all the buttons that are on the main timeline. Is there a way to achieve this?
I tried putting a conditional on a button outside of the movie clip, something like:
if (movie_clip_is_showing == false) {
on (rollOver) {...}
}
but I got scripting errors.
I would be interested in some kind of Flash 4 or Flash 5 solution.
Playing MC On Mouse Event
Hi everyone,
This is what I'm trying to do. I have a movie clip that is long horizontally. I have 2 buttons (left & right) that I want to use to scroll the movie clip with the mouse press and release events.
I have the following code so far:
on (press) {
do {
pics.nextFrame();
} while (pics._currentFrame <> 40);
}
on (release, releaseOutside) {
pics.stop();
}
now, this is not working properly because I'm guessing it does the loop too fast. I tried placing a for loop in the do while to kinda force a pause, but that didn't work.
Anyone have any ideas??
Thanks,
Tony
Mouse Event And Confusion
I have a 20x20 grid of circles all using the same movieclip. It basically duplicates one movie clip to build the grid when the flash movie is run.
I need these circles to change color when you hold the mouse down and drag over them. I want to simulate a paint brush to get the idea that you are painting the circles while the mouse is held down.
I am having trouble, it seems that I can get it to change color when you click or mouse over, but I can't get it to do both at the same time.
The only way I got this to work was to do a hit test with a movieclip attached to the pointer. Well this is 400 loops all executing at the same when the mouse down occurs, and slows the movie down significantly.
Any help would be grateful!!
Transitions Between Swf's On Mouse Event
Im trying to get good transitions between swf's on mouse clicks. What im doing now is I have a mc that is called transition that has the animation i want to use between movies when a button is clicked. Then i have an empty mc that i load transition and the swf's into called empty_mc . I have the action
onClipEvent (data) {
_root.transition._visible = 0;
}
----ON MY EMPTY MC----
--Then i have the action--
on(release){
_root.emptymc.loadMovie("contact.swf");
_root.transition._visible=1;
}
------On a button------
--Then i have the action--
onClipEvent(load){
this._visible=0;
}
------On my transition mc------
The problem with this is that the transition mc runs untill the swf is loaded so it eigther just repeats itself or doesnt play fully depending on how big the swf is. Im trying to figure out how i can get the mc to play through fully just once and then load the movie. If anyone can help i would appreciate it greatly ive been working on this for a long time. If you want to see the movie in question and what it does this is the link http://www22.brinkster.com/ruberbabi/starter.html
Mouse Event Transitions
I posted yesterday with no response. Im just trying to get some advice on a good way to transition between movies on mouse clicks. So like you click a button and it transitions between a movie instead of just unloading it and loading the next. Im trying to figure out a good way to smoothly do it. You can check out my post from yesterday to see what i have now or please any suggestions would be greatly appreciated.
OnLoad Or Mouse Event?
Let say I have the following script in a frame:
lv = new LoadVars();
lv = new LoadVars();
lv.sendAndLoad("update.php", receivelv, "POST" );
receivelv.onLoad = function(success) {
_root.update_status = this.update_status;
}
Flash would KEEP checking if the variable(s) is finished loaded or not. If it the variable is loaded completely. It would execute the onLoad function, right?
My problem is: if i put the above script inside a button, as you know, the button action is only triggered for mouse event. If the variables are not completely loaded right after the mouse event, will Flash still keep checking? if the variables are fully loaded 5 seconds after mouse event, will it still execute the onLoad function after 5 seconds of the mouse's trigger? or only another mouse event's trigger would cause the other checking?
Sorry for my poor english, hope can make you understand. Thanks
Mouse Over Event Problem
I looking to make my mouse stay as a pointer instead of a hand and i want it to go to another keyframe when entering object. Enclosed is my file. I would appreciate the help. Thanks
Mouse Event Problem
i am trying to make this site in flash 5. everything is working fine just that i cant get the mouse event working properly. all i want is when the user clicks on a text, it plays an animation. for this, i used the on (release) event. but my problem is when i click on the button more than once, the box animates and this kinda looks not nice. i cant really explain it in words( sorry for my english ) but if you go to my web site and click on any of the buttons continuously, you would see what i meant!! its still under construction though!!
thanks for any support.
my web site is:
http://www33.brinkster.com/rocrulzs/
Using Keypress Mouse Event
I've got a flash presentation that continuously plays (loops)
I would like the flash to stop playing and open a browser window when someone hits the spacebar. When they hit the spacebar again I would like the flash to resume playing.
How is this done?
Loading A Swf On Mouse Event
hi ,
can anyone pleeeease help me.
i am a beginner.i m actually a designer. and totally new to scripting in flash mx. my problem is i have a button and on relesing it i need to play a .swf.file. the script i wrote is
on relese(){
gotoAndplay("home.swf");
}
but its not working.
i have put the swf in the same folder as the fla file. i donno hw to do the scripting.
pleese help me . anyone who sees this. i did b really grateful.
its real urgent.
thanking u.
timmy
Loading A Swf On Mouse Event
hai everyone,
i found sm mistakes in my script.
and corrected it as
on (release) {
gotoAndplay("home.swf");
}
but still not working.
please help me. pleeese. its going to cost my new job.
lov
timmy
Mouse And Keypress Event
Dear Gurus,
I want to be able to run script on a button when I press the space bar, and it needs to happen to the button that the mouse is over. I have the following script:
on(rollOver){
if (Key.isDown(Key.SPACE)) {...
}
}
and it works fine if I rollover the button whilst holding the Space bar, but it does not work if the mouse is already over the button and I press the Space Bar which is what I need.
Thanks in advance.
[MX] Flash Mouse Over Event Help
Hi Guys,
Can anyone help me on this? Pleeeeeeeeeeeeeeeeze !!
I just wanted to create a flash piece similar to the one like this http://www.pg.com ( can you see a flash piece in the middle ).
To make it easy to understand: here is the functionality it has... there are 4 animations for 4 links which are playing simultaneously. Now, when I am taking my mouse to the other links, its playing the animation corresponding to that particular link and the same for all 4 animations and links. Also clicking on the links taking me to a different url.
See the sliding mouse over effect. Looks very simple but tough to make. :P
Can you help me on this please
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.
Mouse Event - Why Delay?
Thanks in advance for considering this problem! Appreciate your help!
I have actions, buttons and a mc (that contains images on labeled keyframes), each on their own layer on my main timeline in Flash. The problem is I have a 2-4 sec delay on the rollover effect of each mouse event (rollover and/or click)! It's as if the listener doesn't "hear" the event right away.
Here's my script:
function testPage(event:MouseEvent):void
{
NECC_mc.gotoAndStop("test");
}
function savePage(event:MouseEvent):void
{
NECC_mc.gotoAndStop("save");
}
function helpPage(event:MouseEvent):void
{
NECC_mc.gotoAndStop("help");
}
function startPage(event:MouseEvent):void
{
NECC_mc.gotoAndStop("start");
}
function lifePage(event:MouseEvent):void
{
NECC_mc.gotoAndStop("life");
}
function jobPage(event:MouseEvent):void
{
NECC_mc.gotoAndStop("job");
}
test_btn.addEventListener(MouseEvent.MOUSE_OVER, testPage);
save_btn.addEventListener(MouseEvent.MOUSE_OVER, savePage);
help_btn.addEventListener(MouseEvent.MOUSE_OVER, helpPage);
start_btn.addEventListener(MouseEvent.MOUSE_OVER, startPage);
life_btn.addEventListener(MouseEvent.MOUSE_OVER, lifePage);
job_btn.addEventListener(MouseEvent.MOUSE_OVER, jobPage);
[F8] Event... Mouse Stop? AS2
Ok what I want to do is have my nav bars "scoot in" from the left and right of my screen when ever the mouse moves.
So I figured I would set up an event listener to see if the mouse is moving. If so, then go to and play the animation of my nave bars coming in, but how would I have them go to and play the animation of them moving out when the mouse stops? Would I just capture the on mouse move event listener to a boolean variable and use that in an "if" statement?
This brings up another question. If I use an "onEnterFrame" to trigger the listener, how would I get it to not cycle through the animation of it coming as the mouse is being moved? In other word how would I get the animation to play to the end and stop at the end even if the mouse is still moving?
Thanks
Mouse Event Questions
I have my navigational menu. It is set so that the word "home" is italicized and pink. When it is mouse rolled over it changes to a different font that is not italicized and is white.
I need it so that if the user clicks on that "home" button then it STAY's white and un-italicized exactly how the roll over worked.
I have tried all the different mouse events but none seem to work because as soon as I move the mouse away from the "home" button it goes back to its original state whether I clicked on it or not. The entire navigational menu is one movie clip so that takes out some options I believe.
Thanks!
Mouse Event Troubles
I want an object that grows when the mouse is on it and then goes back to its original size when the mouse leaves it.
It works OK using MOUSE_OVER & MOUSE_OUT, or even ROLL_OVER & ROLL_OUT (btw, whats the difference between these?), as long as the mouse stays on the object for a little while.
However, if the mouse just passes over the object and then stops outside it, the object grows (as it should) but then does not go back to its original size, as I want it to do.
Any ideas what I'm doing wrong?
I attach a zipFile with the .fla file, the .swf file, an image file, the caurina tween classes and 2 .as files that are needed to run the example, just put them all in the same directory and run "forCosito.swf"
Thanks!
Trigger Mouse Event Via AS
Hi all
in earlier version of AS you could say
myBut.onRelease();
to trigger the function attached to a clips on release event
How would you do this is AS3?
I have
ActionScript Code:
item.addEventListener(MouseEvent.CLICK,onClick);
//and
private function onClick(e:MouseEvent):void {
_selectedItem = e.target;
}
so how to I trigger onClick with a particular clip as the target?
thanks in advance
|