Is There A Way To Get The Mouse To Shut Up?
OK, I asked this on the AS 2.0 Forum and got no response. I am guessing the level of expertise is higher on this list, so here is my issue.
I need to keep the mouse from being detected by the flash application I am creating. I want the focus to stay on the buttons (which are operated by the keyboard). The problem is that anytime the mouse is over any part of the stage, the buttons lose focus.
I have tried:
- Mouse.hide()
- onMouseOver/Move = undefined on everything including the root
- onMouseOver/Move = function that sets focus on the 1st button
Anybody have any other ideas?
Paul
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 02-12-2008, 10:22 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Shut-down.exe
im using objectdock to beautify my desktop, and i wanna add one"shut-down " button on my desktop, but i dun know how to search for the link, i mean the "shutdown.exe"
can anybody help me with this problem
Shut Down
Hi Friends,
There Is Any Way To Shut Dowm The System Using Flash(Actionscript Or Other Method).
ie,When We Click A Button The System Will Shut Down Or Restarted.
Shut Down Computer
Can anyone tell me if there is a command in Flash or if Flash can access a command to shut down the computer? I have not been able to find anything on this. Thanks in advance.
Shut Down The Player...
ok, I'm sure this is an easy one for you guys:
I would like an Action Script command that shuts down the flash player.
unloadMovie(_level0)
seems to close everything but the player.
fscommand()
is my next best deal (if I knew javaScript)
Any Ideas?
Thanks
22G
Shut Down Computer
Hello there!
anyone could tell me if is possible to shut down computer from a flash application.
if the answer is no, how could i make a button that execute a program .exe.
thanks a lot!!
marlowe
Shut That Button Up
Hey guys... I'm a new member of the forums. I'm trying to make buttons for my website that have sounds playing on them during the over states.
But when you move the mouse off the button, the sound keeps playing. Run that mouse everywhere, the sounds are all playing, it's chaos.
How do I fix a button so that the sound stops playing when the mouse moves off?
Thanks! <3 <3 <3
Shut That Button Up
Hey guys... I'm a new member of the forums. I'm trying to make buttons for my website that have sounds playing on them during the over states.
But when you move the mouse off the button, the sound keeps playing. Run that mouse everywhere, the sounds are all playing, it's chaos.
How do I fix a button so that the sound stops playing when the mouse moves off?
Thanks! <3 <3 <3
Shut Off Script
How can i shut this off once it starts? I have this code on frame 1 and i need some code for frame 2 to shut it off. Thanks in advance...
maxBugs = 20;
damp = .95;
for (i=0; i<maxBugs; i++) {
bug = attachMovie("bug", "b"+i, i);
bug._x = Math.random()*550;
bug._y = Math.random()*400;
bug.speed = Math.random()+1;
bug.onEnterFrame = bugMove;
}
function bugMove() {
var dx = _xmouse-this._x;
var dy = _ymouse-this._y;
var angle = Math.atan2(dy, dx);
this._rotation = angle*180/Math.PI;
var dist = Math.sqrt(dx*dx+dy*dy);
this._alpha = 100-(dist/200)*100;
this.vx += Math.cos(angle);
this.vy += Math.sin(angle);
this.vx += Math.random()*4-2;
this.vy += Math.random()*4-2;
this.vx *= damp;
this.vy *= damp;
this._x += this.vx;
this._y += this.vy;
}
Accidental Shut-off, Is There Any Way To Recover?
It is looking like their isn't Do any of you guys know a way to get back what I was working on but hadn't saved yet when the power went off? Does flash store temp versions anywhere or is there any sort of recover feature? It looks like I'm screwed but I have to ask.
Is There A Button That Can Shut Down A Page? (MX)
One site ... on the main page ... a button...clicking on it opens a second page... it overlaps the main page...
What I'm after is the action script that enables a button to shut down this second page once the reader is finished.
Thank you for the help.
How Do You Shut Off Sound Completely?
Hey all -
having an issue where I'm trying to completely turn sound on and off globaly using AS in variable form.
I basically tried using stopallsound(); but the problem is the sound in the MC that loop play the sound next time they loop. there anyway to come up with code with a variable that i can have sound = 0 off sound = 1 on for the entire movie including with the movie clips?
thanks
Error/Shut Down After Publishing
Twice today I was working on two different projects. I got one up and working, showing in "test movie" and when I went to publish it, it gives a general error message and says it must close. When I reopened the program and tried to view the movie, it would not work. The second one, I imported an mpg into flash and when I went to view it in browser, the same thing happened. Any tips?
Help Shut Off A Tween Pls- Eating CPU
Hello. This was originally a move tween that I modified to be an elastic scale tween:
ActionScript Code:
MovieClip.prototype.scaleItElastic = function (scalex, scaley, inertia, k) { vx = -this._xscale+scalex; vy = -this._yscale+scaley; this.xp = this.xp*inertia+vx*k; this.yp = this.yp*inertia+vy*k; this._xscale += this.xp; this._yscale += this.yp;}
on the to-be-tweened movieclip when it loads:
ActionScript Code:
onClipEvent(load) {// set MC scale to 0 this._xscale = 0; this._yscale = 0;// var xp = 0; var yp = 0;}
and finally the function to call it on a keyframe:
ActionScript Code:
onEnterFrame = function () { trace("running"); if (this.copy_mc._xscale == 100) { this.copyStatus = "loaded"; trace("elastic function shut off"); delete this.onEnterFrame;//else} else if (this.copyStatus != "loaded") { this.copy_mc.scaleItElastic(100, 100, .75, 0.1);}}
Works great EXCEPT, the function is very CPU intensive because even though the tween is no longer VISIBLY working (the clip has no more elasticity), it continues to run in the background for 5-8 seconds after the last visible movement has occured.
i tried to take care of this with this part of the above actionscript (see below), but it seems that the scale is passing back and forth through 100% that the code is failing to work until the passing has truly stopped. Any way to get this code to stop after 1 or two springs? Or after 2 seconds or so?
ActionScript Code:
if (this.copy_mc._xscale == 100) { this.copyStatus = "loaded"; trace("elastic function shut off"); delete this.onEnterFrame;
Exit/Shut Down? - Easy Question...
This should be an easy question, but I just don't know how to do it....
I want to put an exit button on my project so that when a user clicks it, it completely shuts down the projector - what script would I put on the button to do that?....
Thanks, all!....
UI Loader Causing Flash To Shut Down
Hello all, The Kraken here
I have an issue and was hoping for some insight.
In the prosess of creating a website I have come accross an issue that has me stumped !!
I created a "swf" file that needs to load into one of my pages using the UI Loader component. The "swf" file does exist in the same directory as the index file which is the website.
In the component parameters the only thing I changed was the resizing to "false" and in the source I entered "services.swf" which is the "swf" that needs to load.
The website loads fine to the home page, but when I try to click the services button to load th services page Flash shuts down every time.
I made a new blank AS2 file to test the "swf" file using the UI loader and it works fine, just not in my website.
So if anybody has any ideas where I can start to diagnose this issue it would be appreciated.
Yours In FLASH
The Kraken
Error Has Occured Flash9d.ocx Internet Must Shut Down
OK
So apparently im not the only person with this issue from what ive read in forums online. I have tried all the listed fixs that ive found but every time i go to msn games i get the flash9d.ocx internet explorer has to shut down error. Ive wiped my computer 4 times in the past 2 days to try and fix the issue but i guess thats not good enough because its still happening. I would really appreciate it if someone could give me some useful advise so that my games work. Please dont tell me to download adobe uninstaller cause ive already tried that. Dont tell me to to copy and past the flash9d.ocx file....paste and rename the new file flash.ocx.....dont delete the orginal file...blah blah blah cause ive done that too. I just want something that works.
Movie Clip Mouse Speed Control Depending On Mouse Press
Hi,
Please help me !
As iam developing a small ball game in flash, where i need to control the speed of the ball (i.e, to increase or decrease the speed of ball)when clicked on a button depending on mouse press .
I have done similar on key press but iam not able to do the same for mouse pressed.
Please help me out
Your help will be appreciated.
Thanks & Regards
Zabi
OnPress Doesn't Work If The Mouse Button Is Pressed Again But The Mouse Is Not Moved.
I have a very simple piece of code but it has one very annoying bug. When I press the button a second time, the code doesn't work. The only way to get the code to work is by moving the mouse a tiny bit, or moving the mouse off the button and back on.
Does anyone know a way to make a button that can be clicked many times without moving the mouse?
Code:
randommultiquiz.onPress = randommultiquizOnPress;
function randommultiquizOnPress() {
_root.attachMovie("connect", "newconnect", 200);
newconnect._x = 0;
newconnect._y = 0;
newconnect._xscale = 100;
newconnect._yscale = 100;
}
How Do I Create A Movieclip To Play If Mouse Is Unactive, And Stops When Mouse Moves?
I am in the process of creting a world map navigation for a global ite portal.
In the map a user can hover over different continents to zoom in on specific countries then click on that country's to goto its specific website.
However I think the world map looks a little un-user friendly so was looking at playing a quick tutorial movie (a mouse cursor, moving over a continent and highlighting it) when the mouse is not being moved, then stops when the user moves the mouse.
This feature a little reminisant of when sonic the hedgehog used to tap his foot if you didnt use your joypad for a while.
I would also like to start the movie (after he preloader ive used) with the tutorial playing, so the user can understand the way it works straight away.
I am a novice at action scripting, so all help would be appreciated!
Thanks
M
How Do I Create A Movieclip To Play If Mouse Is Unactive, And Stops When Mouse Moves?
I am in the process of creting a world map navigation for a global ite portal.
In the map a user can hover over different continents to zoom in on specific countries then click on that country's to goto its specific website.
However I think the world map looks a little un-user friendly so was looking at playing a quick tutorial movie (a mouse cursor, moving over a continent and highlighting it) when the mouse is not being moved, then stops when the user moves the mouse.
This feature a little reminisant of when sonic the hedgehog used to tap his foot if you didnt use your joypad for a while.
I would also like to start the movie (after he preloader ive used) with the tutorial playing, so the user can understand the way it works straight away.
I am a novice at action scripting, so all help would be appreciated!
Thanks
M
How Do I Create?: Scrolling Image Stops On Mouse Over-starts On Mouse Off
I’m trying to create this animation:
I have an long rectangular image (with more images going across it) scrolling FROM the right side of the screen to the left (very slowly). similar to a ticker.
I want the scrolling to stop when the viewer mouses over the menu strip. If they press on the image that they have just moused over, I have a movie clip I want to play for that image (a few images pop up, one bigger than the other). When the viewer mouses off, the movie clip disappears, and the menu continues scrolling to the left, from the right.
Greatly appreciated!!
Playing A Movie Clip On Mouse Over And Continue To Last Frame On Mouse Out
Hi All,
I have a movie clip on the timeline which is an animated mouseover button
Basically what I need to do is for the movie to be stopped at frame one when there is no mouse over and loop continuosly when I do have mouse over then on mouse out i want it to finish it's frames playing from where ever it was at when the mouse was moved out to the last frame and then display frame one so it is stopped again ready for a new mouse over.
Something I have found difficult to work out is that whilst it is doing the "out" play to to last frame, if you put the mouse back over again, it starts from frame 1 so looks like it jumps so i need the mouse over to also read what frame it is currently playing so that it can continue its endless loop from that frame to avoid it jumping about.
I hope that makes sense, it's really difficult to describe in words.
Here's the movie clip's action as it is now.
on (rollOver)
{
this.gotoAndPlay("over");
}
on (releaseOutside, rollOut)
{
this.gotoAndPlay("out");
}
ok so in the movie's timeline itself, the label "over" is a frame containing another movieclip which is basically a continous 30 frame loop and my movie timeline is stop();
so, on (rollOut) it plays at label "out"
I have placed a copy of the movie loop at the "out" frame which plays the movie slower at the end to make it a nice wind down stop
what I thought to do in action script is to read the current frame that the movie loop is at and make so the "out" position movie starts its playing frame from that frame number until it reaches the end frame where it jumps back to frame one of the timeline with the first stopped frame.
I've seen a command something like this below used to get the current frame number and take it away from the total to continue playing from that point, that's not totally right for what I am doing but it shows me the sort of thing i need to write but i don't know how to write an actionscript to read the current frame from the movie1 whcih is playing and start playing movie2 at "out" from that frame number?
on (rollOut) {gotoandPlay(_totalframes - _currentframe); }
maybe there is an easier way to get this to work, i've seen lots of similar examples on the web but nothing that specifically plays a lopp and then continues to the end on mouse out. it sounds simple but I've tried all weekend to do it without success?
Can anyone help me please?
Thanks,
Terrence.
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
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;
}}
Custom Mouse Cursor Conflict With Mouse Trail
When I put mouse trails and custom mouse cursor script in the same scene the mouse trails work but the cursor does not change to the custom cursor. If I use the custom mouse cursor script in a seperate scene, on its own, it works fine. I think that the two scripts are conflicting.
Mouse trail script:
onClipEvent (enterFrame) {
//x movement
mx=_root._xmouse;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}
moveSpeedx=dx/10;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
//y movement
my=_root._ymouse;
if (my<_y) {
dy=_y-my;
}
else {
dy=my-_y;
}
moveSpeedy=dy/10;
if (my<_y) {
_y=_y-moveSpeedy;
}
else {
_y=_y+moveSpeedy;
}
}
Custom mouse cursor script:
Layer 1(functions):
stop();
/* update the cursor coords */
function updateCursor() {
_root.cursor._x = _xmouse;
_root.cursor._y = _ymouse;
updateAfterEvent();
}
Layer 2(on event handlers):
onClipEvent(load) {
Mouse.hide();
this.swapDepths(100);
}
onClipEvent(mouseMove) {
_root.updateCursor();
}
Please help!
Mouse Direction Scroll With Mouse Over Image Enlargement...
Hi all..
Haven't had much luck finding a tutorial to help me do this one so any help locating it would be good.. I'm trying to design an image gallery where the images scroll left to right depending on mouse movement. Once a mouse is over an image it enlarges then returns to normal shape with mouse off.
any help appreciated..
cheers!
Scroller That Moves According To Mouse Movement Not Mouse Location.
I am trying to recreate the effect seen here:
Express Top Ten
alright here's the request:
I have found many scroller tutes most of which use buttons to control them. What I need or think I need is a tute or file to refer to, that uses a mouseover effect to move the movieclip with respect to how much the mouse has moved and still uses easing.
I have found files that make the movieclip move according to the mouse position on the stage, but i need it to move in according to how far it just moved.
feel free to email me with any questions.
thanks in advance,
chris
email me
Changing Mouse Cursor On Mouse Over/out Without Drag Movie?
Hello,
I have a movie clip/button that activates some actions but I don't want the mouse pointer show the link icon (hand) and instead show the normal arrow icon. Is this possible with a fast mouse.smth actionscript or is a complex startdrag/stopdrag of movieclips the only way out? Thanks in advance.
Mouse Hittest Too Slow? Mouse Passes Over Wall
Hi everyone,
I'm having a problem with a new game i'm working on.
I have the following code to attach a movieclip to the mouse:
Code:
startDrag(_root.dot, true)
Mouse.hide();
Ok, and i have a wall movieclip with the following:
Code:
if (_root.dot.hitTest(_root.wall)){
trace("hit!")
}
This works fine, as long as you move the mouse slowly -- if you zip it over the wall, it seems that the hittest doesnt have time to register the hit? Or that the "_root.ball" doesnt actually go over the wall, it just is transported to the new mouse location? (im not sure )
Any infomation on how to make the hittest 100% detect the mouse over the wall would be great.
Many thanks.
Regards.
[F8] Follow The Mouse - Stop Mc At Location Of Mouse On Click
I have an mc that follows the mouse a certain distance on the x in both directions and then eases to a stop when the mouse gets a certain distance.
What I need to do is to have the mc stop on button click at the x position it is at on click. Then, when another button is clicked the animation continues from it's stopped location to the new mouse location. All with easing of course.
Here is the code for the mouse tracking:
Code:
onClipEvent (load) {
speed = 3;
}
onClipEvent (load) {
stageWidth = 700;
imageWidth = 615;
}
onClipEvent (enterFrame) {
destx = (stageWidth-imageWidth)*(_root._xmouse/stageWidth)
_x += (destx-_x )/speed;
}
Any help would be greatly appreciated.
Getting An Object To Point Towards Mouse - Rotation - Mouse Follower
Hi guys, I'm kinda getting lost in AS3 and was hoping if someone here can help out.
Picture an arrow in the middle hanging from the top and at the bottom two buttons, Left and Right. When the user enters the frame with mouse, I want the arrow to point towards the mouse maybe with some ease if necessary. Obviously the user will either choose Left or Right so it will look like the arrow is pointing to the button. But I want the arrow object to follow the mouse in realtime and thats why i want to get it to follow the mouse and rotate accordingy, rather than making an animation such as play this when mouse is on button Left (OnRollOver).
So I'm looking for a good script to do that . Any help is appreciated.
TRIG - MC Follow Mouse Rotate Around Mouse Point
I have read and i think i 'fully' understand (unless it gets more complicated or what not) the trig tutorial, on this site.
no offence i cant remeber who's tut.
i can make a movieclip circle another movie clip,static or moving.
but now, i have a movie clip that follows the mouse pointer when the up key is toggled.
and i want this movieclip to rotate around the mouse point,when the left key is either pressed or toggled, and reverse this movement for the right key.
i have tried a few things for this i can not get it to rotate, it just seems to jitter randomly.
i have tried rotating a completely static MC around mose point which also failed..
any help thanks?
this is the code that makes the clip face the mouse, and move to its position.
its a function called from another function.
its followed from a tut but i do understand it. This is not what im having troublewith,this works.
Code:
myRadians = Math.atan2(_root._ymouse-MYCLIP._y, _root._xmouse-MYCLIP._x);
myDegrees = Math.round((myRadians*180/Math.PI))+90;
MYCLIP._rotation = myDegrees;
_root.yMove = Math.round(_root.yChange/20);
_root.xMove = Math.round(_root.xChange/20);
MYCLIP._y += _root.yMove;
MYCLIP._x += _root.xMove;
_root.yChange = Math.round(_root._ymouse-MYCLIP._y);
_root.xChange = Math.round(_root._xmouse-MYCLIP._x);
}
to make it clear what i want, a MC that will circle the mouse point, when key is down or toggled, this movieclip also needs to be capable of moving towards mouse point on key down or toggle.
Cheers.
Scene Transitions Now Effecting My On Mouse Over, On Mouse Out Button?
This is quite a complicated problem to explain.
Basically I had some buttons with a on mouse out, and on mouse over effects.
I wanted each button to load a different scene of the movie.
For some reason the on mouse over and mouse out button effects work until I link them to load a scene in the movie.
If you download the following file you can see this.
http://www.editorskeys.com/site.file
(rename the file to .zip)
The only button I have linked to load a movie is the Drinks button. It loads the drinks scene, no problem, however the mouse over effects don't seem to work anymore.
I have included the .fla file so if someone could maybe have a quick look at it, it is probably just a small bit of coding I have done wrong!
I would really appreciate anyones help, thankyou!
p.s if anyone manages to do it can you e-mail it to adam.w@editorskeys.com
Swarm To Mouse W/ Elasticity And Move Randomly W/ No Mouse
I started another thread where i had gotten help and combined the snow tutorial and the programatic mask tutorial to create particles that reveal an in-focus image over a blurred one. I just need help making the particles swarm around the mouse when it is present and have the particles just float around when not.
Presently the random motion is just fine and looks like this (i just inverted the this._x and this._y so that they would go with the mouse direction not away from):
ActionScript Code:
onClipEvent (enterFrame) { // horizontal movement rad += (k/180)*Math.PI; xmovement = _root._xmouse; this._x -= (Math.cos(rad)+(xmovement-(width/2))/50)*-1; // vertical movement ymovement = _root._ymouse; this._y -= (Math.cos(rad)+(ymovement-(width/2))/50)*-1;}
"width" and "height" are variables that refer to the size of the movie.
All the mouse trail FLAs i could find just sort of stuck in the corner if you moused off the flash movie. I would like to make it so the particles return back to their little merry random paths after you have moused off the movie.
Any tips or examples you could point me to would be great. Thanks!
Customized Mouse & Arrow Mouse Appears On Right Click
Hi everyone,
I've created a custom cursor for my mouse and I've also created a new ContextMenu for my right click menu options. My mouse works fine, but when I right click and make a selection my custom cursor along with the standard arrow mouse appears as well. Then throughout the rest of the movie, both mouses appear. How do I permanently get rid of the standard arrow mouse and just have my custom mouse be used especially when right clicking?
For my mouse I did use: Mouse.hide();
I've done research on this topic but none seemed to address the right click part. Any help would be greatly appreciated!!
Thanks!
Changing AS So Mouse Follow Is Switched To Mouse Repel?
So I'm using the .fla attached as a basis for an image scroller (thanks TheCanadian!) and I was just wondering what the process would be to invert it so the "follow" MC is being repelled by the mouse, rather than attracted.
Here's the code for quick reference...
"follow" is the MC following the mouse and "bounds" is the area in which "follow" can move freely.
Code:
follow.onEnterFrame = function() {
this._x += (Math.max(bounds._x + this._width / 2, Math.min(_xmouse, bounds._x + bounds._width - this._width / 2)) - this._x) / 5;
this._y += (Math.max(bounds._y + this._height / 2, Math.min(_ymouse, bounds._y + bounds._height - this._height / 2)) - this._y) / 5;
};
Thanks!
Mouse.hide(); Does Not Work - Mouse Cursor Is Still Shown
why mouse cursor does not hide ?
the mc cursor to replace mouse cursor is shown together with it;
what´s wrong?
thanks
Quote:
onLoad = function () {
Mouse.hide();
cursor.swapDepths(200);
};
onEnterFrame = function () {
cursor._x = _xmouse;
cursor._y = _ymouse;
};
onUnload = function () {
Mouse.show();
};
Does Disabling Mouse Input Disable Mouse Listeners?
My flash site has various "pages" (MovieClips) and each of these pages has various dynamically generated movieclips with listeners for mouse events, etc. I switch between them in the manner of "active.alpha = 1, rest.alpha = 0" and disabling mouse input on inactive clips.
My question is, does _mc.mouseEnabled = false and _mc.mouseChildren = false also stop listeners for mouse events running on those movieclips or do you have to manually remove each event listener to stop it from running (and unnecessarily using resources).
Also if a movieclip's alpha is set to 0 does Flash still use resources for "drawing" it on stage or is it effectively removed from the drawing process (even if the movieclip contains running animations)?
The thing is my application is running very slow and I'm guessing it's because even when I hide a page flash is still calculating how to draw it and detecting mouse events on all its children.
Thanks for any answers, cheers.
Scene Transitions Now Effecting My On Mouse Over, On Mouse Out Button?
This is quite a complicated problem to explain.
Basically I had some buttons with a on mouse out, and on mouse over effects.
I wanted each button to load a different scene of the movie.
For some reason the on mouse over and mouse out button effects work until I link them to load a scene in the movie.
If you download the following file you can see this.
http://www.editorskeys.com/site.file
(rename the file to .zip)
The only button I have linked to load a movie is the Drinks button. It loads the drinks scene, no problem, however the mouse over effects don't seem to work anymore.
I have included the .fla file so if someone could maybe have a quick look at it, it is probably just a small bit of coding I have done wrong!
I would really appreciate anyones help, thankyou!
p.s if anyone manages to do it can you e-mail it to adam.w@editorskeys.com
Swarm To Mouse W/ Elasticity And Move Randomly W/ No Mouse
I started another thread where i had gotten help and combined the snow tutorial and the programatic mask tutorial to create particles that reveal an in-focus image over a blurred one. I just need help making the particles swarm around the mouse when it is present and have the particles just float around when not.
Presently the random motion is just fine and looks like this (i just inverted the this._x and this._y so that they would go with the mouse direction not away from):
ActionScript Code:
onClipEvent (enterFrame) { // horizontal movement rad += (k/180)*Math.PI; xmovement = _root._xmouse; this._x -= (Math.cos(rad)+(xmovement-(width/2))/50)*-1; // vertical movement ymovement = _root._ymouse; this._y -= (Math.cos(rad)+(ymovement-(width/2))/50)*-1;}
"width" and "height" are variables that refer to the size of the movie.
All the mouse trail FLAs i could find just sort of stuck in the corner if you moused off the flash movie. I would like to make it so the particles return back to their little merry random paths after you have moused off the movie.
Any tips or examples you could point me to would be great. Thanks!
Play & Reset FLV On Mouse Over And Mouse Out W/ Poster Frame
Hi everyone -
It's been a while since I've posted here but I'm glad to see the boards are still strong.
I'm working off of a tutorial I found on Monkeyflash called "Adding a Poster Frame to Flash Video". This tut allows me to select my desired still to show before the user click play and once the video resets.
Would I'd like for this to do is to play on Mouse Over. On Mouse Out, the video should stop and reset so that the poster frame appears once again, until the user Rolls Over once again to initiate playback from the start.
Here is what I have so far. The problem with the AS below is that once I mouse out it stops playing but I can no longer play the video on mouse over. Not only that, the video seems to stop only when I mouse out on top of the playback controls.
Code:
import fl.video.VideoEvent;
myPoster.addEventListener(MouseEvent.MOUSE_OVER, playMovie);
function showPosterFrame(event:Event):void {
myPoster.visible = true;
}
myVideo.addEventListener(MouseEvent.MOUSE_OUT, stopMovie);
function hidePosterFrame(event:Event):void {
myPoster.visible = false;
}
function playMovie(event:MouseEvent):void {
myVideo.play();
}
function stopMovie(event:MouseEvent):void {
myVideo.stop();
}
myVideo.addEventListener(VideoEvent.PLAYING_STATE_ ENTERED, hidePosterFrame);
myVideo.addEventListener(VideoEvent.COMPLETE, showPosterFrame);
Mouse. Hide, Mouse.show-on New Position
On button release i hide mouse because mc start to play
and on the end of that mc i show mouse agin.
Plese tell me how to move mouse in new position on screen with mouse.show() function
tenx,
m.
Mouse Drag Wirth Invisible Mouse?
I'm kind of new with the actions,
but I can make a movie clip drag to the mouse--with the startDrag action.
what i cant do is make the mouse-arrow disappear.
could you write the actionscript for that??
thanx
Mouse Follow With Delay When Mouse Over In Certain Area - HELP
Hi actionscript-gods!!!
I got a navigation bar and want a followmouse-object slide along on top of it with a little delay (delay not built in yet) as i move around my mouse in the navigation area. (in adition the object fades out when you don't move the mouse - but that part works and is not important here) My problem is that the object simply won't follow the mouse!!! I hope someone can help me...
Code explanations:
followmouse object = fader
container movie for fader = fadercontainer
Code for first image in _root:
var timeOut;
var maxTime = 2000;
function fadeUp () {
with (fadercontainer.fader) {
if (true == mouseMoved) {
if (_alpha<101) {
_alpha += 10;
} else {
mouseMoved = false;
timeOut = getTimer()+maxTime;
}
}
}
}
Code for fader:
onClipEvent (load) {
_alpha = 0;
function fadeDown () {
if (_alpha>0) {
_alpha -= 10;
}
}
}
onClipEvent (enterFrame) {
if (true == mouseMoved) {
_root.fadeUp(this);
setProperty ("_root.fadercontainer", _x, "_root._xmouse");
} else {
if (getTimer()>_root.timeOut) {
fadeDown();
}
}
}
onClipEvent (mouseMove) {
if (_root._ymouse>66 && _root._ymouse<110 && _root._xmouse>172 && _root._xmouse<689) {
mouseMoved = true;
}
}
Thanx in advance,
Ralf
|