How To Make Mouse Click Trigger Sound
Ok, I have what is probably a simple question. I made this small flash object for my page. http://www.beefchips.com . The section that I am talking about is the piece with the lips kissing the pretty girl. My question is how do I set it up so that the click of my mouse will trigger the kissing noise?
I know it seems that I have it set up that way now but I dont. The way it is set up now is with a big button the size of the pic on the bottom layer of the object. When you click the pic, it triggers the button which fires off the sound. I am thinking that this is not very efficient. Or is it? Is there an action script that will handle this function without the button?
Thanks in advance.
PS, Im not looking for a sitecheck here. This page is just for fun while I am learning how to do some flash. ITS JUST FOR FUN.
FlashKit > Flash Help > Flash Newbies
Posted on: 10-04-2001, 05:21 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Mouse Click Doesn't Trigger, Mouse Down/up Does
I have a sprite that contains a bunch of sprites. Each of those sprites contain a bunch of bitmaps.
My issue is that the MouseEvent.CLICK isn't triggering on the parent sprite. However, MOUSE_DOWN and MOUSE_UP is.
Are there any cases in which this would happen? I'm having a hard time understanding why.
Thanks.
How To Trigger Mouse Right Click Event?
Hi! I have a flash player. Some of my users are not so savvy. They don't know to right click to get the flash context menu.
So I want to display the context menu when they click a nice shiny menu button on the flash player.
How can I do this? Thx!
I thought maybe I could just trigger the mouse right click event in actionscript, when the menu button was clicked. But haven't found a way yet...
Thanks for your help!
Trigger Movie With Mouse Click On Page
I am creating a site using Dreamweaver, Flash and Fireworks. The title or banner of the site is a flash movie. Navigation is by Fireworks buttons with popup menu. I want the short movie in the banner to replay every time someone clicks onto a menu item, but I can't figure out the Javascript necessary for such a function. I just think that it would be neat if the title movie would replay everytime a new page loads on the site. Can anyone help?
How To Make All Button Component Instances Trigger RollOver Sound?
Hello all--
I am using the Button component (the one shipped with CS3) in many places in my AS3 project. I am coding in .as files, not on the timeline.
I have skinned the Button to use the colors I like. Now I wish to "skin" it so that all instances generate a rollOver sound, and I'll be darned if I can figure out how.
I know I can listen for ROLL_OVER events in each Button instance. But I have many many Buttons and it seems kludgy to add that same code to every class I have which tracks a Button. I am hoping there is some way I can make *all* instances of Button respond to rollOver the same way. I am hoping it is like setComponentStyle or changing the skin for the Button; I can do it in one place and it works everywhere.
I guess I can listen on the Stage level for bubble-ups of ROLL_OVER, trap those that come from Button instances, and handle it from there, but stagewide listeners also seem a tad kludgy.
Is there some elegant way to make all my Buttons automagically generate the same rollOver sound?
Many thanks,
Matthew Ford
Urgent How To Make Click Mouse?
hi people ok currently I am doing a basketball game but the problem is my ball would be throw by pressing the up arrow key on the keyboard below is the code:
this.onEnterFrame = function ()
{
if(Key.isDown(Key.UP))
instead of using up arrow key I want to the ball to be release or throw when I click on the mouse so can somebody teach me how to edit the code above to mouse click thanz !!
How Do I Make Changes In Right Click Mouse Menu?
Does some one know if there is any way to put new information or your own inputs in the menu you get when you right click with your mouse button in a flash movie?
I know that you can disable macromedias own menu with a parameter tag in your HTML document, but I want to create my own inputs there.
Please help me…
Mouse Click Sound
Hello, I am trying to create a simple flash game which involves shooting. I have scoured the internet for a couple of days to try to find a way to make a gun sound when the mouse button is clicked, but to no avail. Could someone please point me in the right direction. I am using Flash CS3. Thanks for your time, Dave.
Help. How To Make A Mouse Left Click Button
How do I make a mouse left click button script?
I would like to create a slide show and have the movie go to the next slide by clicking on the mouse.
Can anyone help me. Thanks
Mouse Click Sound Throughout Scene
This is most likely another stupid question- but I can't find the answer in my book.
How can you make a sound event every time the mouse click occurs?
Any and all help appreciated- Thanks!
Sound Attached To Any Click Of The Mouse
Hi everybody,
I have a movie that already contains many buttons and movieclips behaving as buttons.
Now i would like to use a sound (click) from the library that would play when the user clicks any button or movieclip as well.
Do I have to go through all the instances, or there is a script to associate the sound to a "click" event?
If that is possible, would is work at all levels and loaded movies?
Thank you very much for your help.
Sound To A Click Or Mouse Down Action
I am trying to attach a sound to a Mouse Click or Mouse Down Action. I was hoping that someone could help me. If there are any tutorials that you could point me to that would be appreciated too. Thanks..
Roger
Make The Mouse Unable To Click Underneath Drawing API
hello
i have a situation where i have multiple movieclips with onRoll, onRelease and onRollOut functions underneath a square drawn using the drawing API
the problem i have is that i'm still able to interact with these movieclips even though they are beneath the square
for example, put this in the first frame of an empty fla file
code: this.createEmptyMovieClip("button", 1);
this.createEmptyMovieClip("canvas", 2)
createRectangle (this.button, (Stage.width-100)/2, (Stage.height-100)/2, 100, 100, 1, 10, 0x000000, 0xFFFFFF, 100)
this.button.onRelease = function()
{
createRectangle (this._parent.canvas, (Stage.width-300)/2, (Stage.height-300)/2, 300, 300, 1, 10, 0x000000, 0x000000, 20)
trace("you clicked me")
}
function createRectangle (mc:MovieClip, left:Number, top:Number, recWidth:Number, recHeight:Number, lineWidth:Number, cornerradius:Number, lineColour:Number, fillColour:Number, fillAlpha:Number)
{
topLeftx = left;
topLefty = top;
topRightx = left + recWidth;
topRighty = top;
bottomRightx = left + recWidth;
bottomRighty = top + recHeight;
bottomLeftx = left;
bottomLefty = top + recHeight;
mc.clear ();
mc.beginFill (fillColour, fillAlpha);
mc.moveTo (topLeftx + cornerradius, topLefty);
//line style
mc.lineStyle (lineWidth, lineColour);
//start drawing
mc.lineTo (topRightx - cornerradius, topRighty);
mc.curveTo (topRightx, top, topRightx, topRighty + cornerradius);
mc.lineTo (topRightx, topRighty + cornerradius);
mc.lineTo (bottomRightx, bottomRighty - cornerradius);
mc.curveTo (bottomRightx, bottomRighty, bottomRightx - cornerradius, bottomRighty);
mc.lineTo (bottomRightx - cornerradius, bottomRighty);
mc.lineTo (bottomLeftx + cornerradius, bottomLefty);
mc.curveTo (bottomLeftx, bottomLefty, bottomLeftx, bottomLefty - cornerradius);
mc.lineTo (bottomLeftx, bottomLefty - cornerradius);
mc.lineTo (topLeftx, topLefty + cornerradius);
mc.curveTo (topLeftx, topLefty, topLeftx + cornerradius, topLefty);
mc.lineTo (topLeftx + cornerradius, topLefty);
mc.endFill ();
}
when you click the button, the square comes up and a message is traced, yet you can still click the button again when the square covers it
so i was wondering, is there a way to make these buttons not interactive without saying this.button._enabled = false ??
thnx
How To Make Playout Movieclip When Mouse Click On The Button.
this is example website :: http://www.template-download.net/previews/t498/
You'll see the button below,
When you click on button it play movieclip and then when you click on another button it going to play roll out movie and then start to play the new movie clip.
I think the principle is ... I have 2 button one is DOG button second is BIRD button. I click on dog button it run dog walk in and stop!
Then I click at bird button dog movieclip play next after thay stop to the end is dog run away and then load bird movie clip is bird come down and stop. and then i click on the dog button again bird flyaway and load god movieclip.
I think I know that mean but I don't know How to do that ?
I can't make the movie clip play out ....
If You Want A Button To Make A Click Sound...
if i want my buttons to make a click sound when you rollover it, do i attach a sound effect (for instance, one of the click sounds from flashkit) to the button somehow? i'd apreciate the actionscript for this or any tips on how i go about doing this. thanks!!!
Global Mouse Click Navigation Sound?
Is there a way to add some code to a flash movie so that whenever you click a link, or movieclip/button a sound is played, without adding an event to every movieclip/button in your movie?
Slowing Down The Mouse Click For Button Sound
hey out there;
I've got 2 movies connected by a button, click button and first movie is replaced by second movie. I've added a sound to the button, but I've notice that the faster you click your mouse the less you hear of the sound. Is there a way to delay implementation of the loadmovie command sitting on the button to give the button sound a chance to play its full length?
Thanks
Hoss
Make Button Not Play Sound On Click, Only On Rollover, With Out Screwing Up Anything
okay, here is my problem, and no one has been able to give me a solution that really works,
I can't figure this out. The home button works perfectly, the other buttons arn't working the same way. I don't want to use stopallsounds, because I am going to be adding in sounds on click and I don't want stopallsounds to be interfering. When I had the other buttons the exact same way as the home button the other buttons would play the sound continuously. I changed them and now the best I can do is that they play once on roll over, but will play once when I click as well, which I of course do not want. I want to get rid of the sound playing on click.
Can anyone help me with this with out either making the animation not play on click, or rearanging resetsubbuttons so that the buttons are reset after or during the animation taking place. Thank you.
Trigger From Click In A Defined Area?
Is it possible to use actionscript to say
if mouse up in x10, y10,x100,y100 do this
sort of like how you define a drag area, I want to register a click in a certain area without having a button there
thanks
mark
Trigger The MouseEvent Click, Without Actually Clicking
I am trying to add some new buttons to a recently finished project. These buttons, however, are intended to do the same thing as other buttons whose functions are already written and working nicely. When these duplicate buttons are clicked, is there a way to trigger the original button's MouseEvent listener?
I was thinking something just needs to fill the asterisks of:
ActionScript Code:
buttonCopy.addEventListener(MouseEvent.CLICK, triggerOriginalButton);
function triggerOriginalButton(evt:MouseEvent):void
{
// *** something to trigger buttonOriginal's event listener ***
}
Any suggestions? If it helps, when buttonOriginal is clicked, it calls a function "onClick()." So I thought I could just call that function but that uses a bunch of info from the MouseEvent parameter (event.target stuff) which would be different if coming from the duplicate button.
Want Enter Key In Inputbox Trigger Button Click
I have a stripped down FLA here: http://www.webmarksonline.com/temp/detectenter.fla
where if you click the button, a label saying "Button clicked" will display. This was accomplished using the following actionscript attached to the button...
on(release) {
display._visible =true;
}
Now I want to make it so that when the enter key is pressed in the edit field, the same thing happens.
On the button actionscript, I have used ...
on (keyPress "<Enter>") {
display._visible = true;
}
But does not work. Why not? Google search says that this should work. I'm on Flash 8, by the way.
OnPress Event Trigger Double-click
I am trying to figure out a work around for another issue I am having with a touch screen app. Can someone point me in the right direction... I need an onPress event to act like or trigger a double-click event.
Click Inside Flash To Trigger Html Function
Hi guys,
Does anyone know how to do this?
I wanna click on a button on a flash banner on an html page and change the default cursor to an image.
Basically i have an image that i wanna use as the cursor. but i want this this happen only when the user clicks on the button inside the banner.
Does anyone know this?
PLease Help
Jag
The Root Sprite Couldn't Trigger Click Event
Hi, all:
I've try the following code but the click event couldn't be triggered.
=======
package {
import flash.events.MouseEvent;
import flash.display.Sprite;
public class Test extends Sprite {
public function Test () {
with(graphics) {
beginFill(0x0);
drawRect(0, 0, 100, 100);
endFill();
}
addEventListener(MouseEvent.CLICK, click);
}
public function click(event:MouseEvent):void {
if (event.target == this) {
trace("this");
} else {
trace("that");
}
}
}
}
=======
if I add a child sprite the click event can be triggered.
=======
package {
import flash.events.MouseEvent;
import flash.display.Sprite;
public class Test extends Sprite {
public function Test () {
var child:Sprite = new Sprite();
with(child.graphics) {
beginFill(0xff);
drawRect(0, 0, 10, 10);
endFill();
}
with(graphics) {
beginFill(0x0);
drawRect(0, 0, 100, 100);
endFill();
}
child.addEventListener(MouseEvent.CLICK, click);
addChild(child);
addEventListener(MouseEvent.CLICK, click);
}
public function click(event:MouseEvent):void {
if (event.target == this) {
trace("this");
} else {
trace("that");
}
}
}
}
=====
So what's the difference of a root Sprite and a child Sprite? Why the root Sprite's click event couldn't be triggered?
Thanks a lot.
Kevin.
Enter Key On Input Field Needs To Trigger Button Click
I have a stripped down FLA here: http://www.webmarksonline.com/temp/detectenter.fla
where if you click the button, a label saying "Button clicked" will display. This was accomplished using the following actionscript attached to the button...
on(release) {
display._visible =true;
}
Now I want to make it so that when the enter key is pressed in the edit field, the same thing happens.
On the button actionscript, I have used ...
on (keyPress "<Enter>") {
display._visible = true;
}
But does not work. Why not? Google search says that this should work. I'm on Flash 8, by the way.
How To Make "click" Sound With Any Key Press?
Hey all!
I'm quite the lurker here in KirupaVille, but I have a question!
I want to have it so that whenever ANY KEY is pressed, a small click sound is played.
I've been messing around with the
Code:
on (keyPress "<key>") {
blah (blah blah);
}
but I can't seem to find a wildcard for the <key>.
I've scoured the forums here and elsewhere. Can't seem to find this little tidbit. It must be a simple solution, right?
Thanks, guys.
-toxoplasmotic
Mouse Over/out/release MC Trigger
Hellouthere,
Hope anybody can helpe me out, i am so close that
i can't see it any more. The problem:
There is a button which should trigger a MC.
There's a 'rollOver' action. (frame 1 in MCname)
There's a 'rollOut' action (frame 2 in MCname)
And there's a 'Press' action (frame3 in MCname)
But as you might understand after pressing the button
it will go to frame 3 in the MC but after leaving the
buttonhitarea (it's a rollout....) it goes back to frame1
or 2????
So what i want is to neglect the 'rollOut' function when
the button is pressed... some body knows how to do
this. If necessary i can send the .FLA.
Thanx in advance
FD
Trigger Mouse Effect
Hi there,
Sorry for my poor and limited ActionScript knowledge
I downloaded a file which has the following functions:
1. Blur Image at first.
2. After few seconds, clear image appears in a circle. It follows the mouse without clicking it.
3. After few seconds, it becomes blur again.
Can anybody tell me how should I do:
If I would like to let the viewers click on mouse themselves in order to see the clear image. Yet, remain the fading effect!
Thanks in advanced
Problem With Mouse Trigger
Hi there,
Please HELP! I downloaded a file which has the following functions:
1. Blur Image at first.
2. After few seconds, clear image appears in a circle. It follows the mouse without clicking it.
3. After few seconds, it becomes blur again.
Can anybody tell me how should I do:
If I would like to let the viewers click on mouse themselves (in Scene2) in order to see the clear image. Yet, remain the fading effect!
Thanks in advanced
File is too big, I posted it at:
www.delvetica.net/flash/000.html >> download link to disk!
Trying To Trigger A Movie With Mouse Over
Good afternoon/evening everyone.
I have a problem, that I cannot solve do to the fact that Im a designer trying to better my action script and Im hitting a wall.
What Im trying to achieve: I have a movie clip on the stage, that has a stop in the first frame. when my mouse hovers over it i want it to go through and play it. when my mouse leaves the movie clip, i want it to goto and play the fade out.
Heres what Ive done, and heres the link where u can find it online: http://www.60watts.org/test/index.html
YOU MAY have to scroll down
onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndPlay("over");
hitState = "over";
}
if (hitState == "over" && !this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("20");
hitState = "off";
}
}
ofcourse, i would have to do a version when the hitState is off. if you goto my link, youll see that bad results.
i appreciate everyones time, and if you have just a little to time to spare and understand why its not working the way id like it to, id really really appreciate it.
k, take care.
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
Mouse Event Won't Trigger...
Hello, this is a simple problem so therefore, chances are, I'm overlooking an insignificant aspect of my code. Please note that the file of interest is ShooterGame.as. I only provided the two additional files since it may be relevant. So, without any further ado, here is the source code:
Crosshair.as
ActionScript Code:
package
shooter.ui
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.ui.Mouse;
public class Crosshair extends MovieClip
{
private var _loader:Loader ;
public function Crosshair( FileName:String )
{
_loader = new Loader() ;
_loader.load( new URLRequest( FileName ) ) ;
Mouse.hide() ;
this.addEventListener( Event.ADDED_TO_STAGE, onStageAdd ) ;
_loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoad ) ;
}
private function onLoad( e:Event ):void
{
this.addChild( _loader ) ;
this.x = 0 ;
this.y = 0 ;
this.enabled = false ;
}
private function onStageAdd( e:Event ):void
{
stage.addEventListener( MouseEvent.MOUSE_MOVE, onMouseMove ) ;
}
private function onMouseMove( e:MouseEvent ):void
{
this.x = e.stageX ;
this.y = e.stageY ;
}
}
}
Monster.as
Code:
package
shooter.entity
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.net.URLRequest;
public class Monster extends MovieClip
{
private var _isLoaded:Boolean = false ;
public function Monster( FileName:String, x:uint, y:uint )
{
var loader:Loader = new Loader() ;
loader.load( new URLRequest( FileName ) );
this.x = x ;
this.y = y ;
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoad ) ;
}
private function onLoad( e:Event ):void
{
this.addChild( e.target.loader ) ;
this._isLoaded = true ;
}
public function get isLoaded():Boolean{ return _isLoaded ; }
}
}
ShooterGame.as
Code:
package
{
import fl.motion.Animator;
import fl.motion.MotionEvent;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import shooter.entity.Monster;
import shooter.ui.Crosshair;
public class ShooterGame extends Sprite
{
private var _cursor:Crosshair;
private var _monster:Monster;
private var _monster_animator:Animator;
private var _xmlAnimation:XML;
public function ShooterGame()
{
_cursor = new Crosshair( "../res/Cursor.swf" ) ;
_monster = new Monster( "../res/Monster.swf", 100, 100 ) ;
var xmlLoader:URLLoader = new URLLoader( new URLRequest( "../res/MonsterAnimation.xml" ) ) ;
xmlLoader.dataFormat = URLLoaderDataFormat.TEXT ;
this.addChild( _cursor ) ;
this.addChild( _monster ) ;
xmlLoader.addEventListener( Event.COMPLETE, onLoad ) ;
_monster.addEventListener( MouseEvent.MOUSE_OVER, onOver ) ;
_monster.addEventListener( MouseEvent.MOUSE_OUT, onOut ) ;
}
private function onLoad( e:Event ):void
{
_xmlAnimation = new XML( e.target.data ) ;
trace( _xmlAnimation ) ;
_monster_animator = new Animator( _xmlAnimation, _monster ) ;
_monster_animator.play() ;
if( _monster_animator.isPlaying )
trace( "Animation is playing." ) ;
else
trace( "Animation is not playing." ) ;
_monster_animator.addEventListener( MotionEvent.MOTION_END, onMotionEnd ) ;
}
private function onOver( e:MouseEvent ):void
{
trace( "onOver Invoked." ) ;
}
private function onOut( e:MouseEvent ):void
{
trace( "onOut Invoked." ) ;
}
private function onMotionEnd( e:MotionEvent ):void
{
trace( "Animation is finished." ) ;
}
}
}
Why doesn't the onOver and onOut events trigger in ShooterGame.as? I posted the two additional files in case they're related to the problem at hand.
Whenever I make an attempt to move the crosshair/cursor directly over the monster image the app temporarily freezes and "skips" over the monster sprite. What would possibly account for this "skipping"?
Note: After reading my post I've noticed that the indentation in the code is very inconsistent and horrible. Although this isn't necessarily my fault, I still feel like I should apologize for this.
Mouse Event Won't Trigger...
Hello, this is a simple problem so therefore, chances are, I'm overlooking an insignificant aspect of my code. So, without any further ado, here is the source code:
Crosshair.as
Code:
package
shooter.ui
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.ui.Mouse;
publicclass Crosshair extends MovieClip
{
privatevar _loader:Loader ;
publicfunction Crosshair( FileName:String )
{
_loader = new Loader() ;
_loader.load( new URLRequest( FileName ) ) ;
Mouse.hide() ;
this.addEventListener( Event.ADDED_TO_STAGE, onStageAdd ) ;
_loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoad ) ;
}
privatefunction onLoad( e:Event ):void
{
this.addChild( _loader ) ;
this.x = 0 ;
this.y = 0 ;
this.enabled = false ;
}
privatefunction onStageAdd( e:Event ):void
{
stage.addEventListener( MouseEvent.MOUSE_MOVE, onMouseMove ) ;
}
privatefunction onMouseMove( e:MouseEvent ):void
{
this.x = e.stageX ;
this.y = e.stageY ;
}
}
}
Monster.as
Code:
package
shooter.entity
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.net.URLRequest;
publicclass Monster extends MovieClip
{
privatevar _isLoaded:Boolean = false ;
publicfunction Monster( FileName:String, x:uint, y:uint )
{
var loader:Loader = new Loader() ;
loader.load( new URLRequest( FileName ) );
this.x = x ;
this.y = y ;
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoad ) ;
}
privatefunction onLoad( e:Event ):void
{
this.addChild( e.target.loader ) ;
this._isLoaded = true ;
}
publicfunctionget isLoaded():Boolean{ return _isLoaded ; }
}
}
ShooterGame.as
Code:
package
{
import fl.motion.Animator;
import fl.motion.MotionEvent;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import shooter.entity.Monster;
import shooter.ui.Crosshair;
publicclass ShooterGame extends Sprite
{
privatevar _cursor:Crosshair;
privatevar _monster:Monster;
privatevar _monster_animator:Animator;
privatevar _xmlAnimation:XML;
publicfunction ShooterGame()
{
_cursor = new Crosshair( "../res/Cursor.swf" ) ;
_monster = new Monster( "../res/Monster.swf", 100, 100 ) ;
var xmlLoader:URLLoader = new URLLoader( new URLRequest( "../res/MonsterAnimation.xml" ) ) ;
xmlLoader.dataFormat = URLLoaderDataFormat.TEXT ;
this.addChild( _cursor ) ;
this.addChild( _monster ) ;
xmlLoader.addEventListener( Event.COMPLETE, onLoad ) ;
_monster.addEventListener( MouseEvent.MOUSE_OVER, onOver ) ;
_monster.addEventListener( MouseEvent.MOUSE_OUT, onOut ) ;
}
privatefunction onLoad( e:Event ):void
{
_xmlAnimation = new XML( e.target.data ) ;
trace( _xmlAnimation ) ;
_monster_animator = new Animator( _xmlAnimation, _monster ) ;
_monster_animator.play() ;
if( _monster_animator.isPlaying )
trace( "Animation is playing." ) ;
else
trace( "Animation is not playing." ) ;
_monster_animator.addEventListener( MotionEvent.MOTION_END, onMotionEnd ) ;
}
privatefunction onOver( e:MouseEvent ):void
{
trace( "onOver Invoked." ) ;
}
privatefunction onOut( e:MouseEvent ):void
{
trace( "onOut Invoked." ) ;
}
privatefunction onMotionEnd( e:MotionEvent ):void
{
trace( "Animation is finished." ) ;
}
}
}
Why doesn't the onOver and onOut events trigger in ShooterGame.as? I posted the two additional files in case they're related to the problem at hand.
Whenever I make an attempt to move the crosshair/cursor directly over the monster image the app temporarily freezes and "skips" over the monster sprite. What would possibly account for this "skipping"?
Note: After reading my post I've noticed that the indentation in the code is very inconsistent and horrible. Although this isn't necessarily my fault, I still feel like I should apologize for this.
Trigger Mouse Release Event
Hi
I have a scrollpane with a large image in it. I can control it with actionscript to roll the content to a specific location. (to show what needs to be shown)
this works, however, if you click and hold the scrollbar and move it, this interferes with the automated scrolling.
I need to find a way to: break the drag action on the scrollbar, or by triggering a release event for the mouse.. or sumthing.
i've tried different approaches sofar, nothing really does anybody have some useful tips? thx!
Trigger An Animation With Mouse Movement.
Hello,
I have a menu at the bottom of my site. I want this menu to appear when the mouse moves and to fade out when there is no movement? Any ideas on how I would go about this?
Regards
Rob
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?
Trigger An Animation With Mouse Movement.
Hello,
I have a menu at the bottom of my site. I want this menu to appear when the mouse moves and to fade out when there is no movement? Any ideas on how I would go about this?
Regards
Rob
Scroll Using Position Of Mouse As Trigger
hey guys,
i have a movieclip thats about 65h 300w. Its masked with a 150w box. Im trying to figure out how i can make it so that when the mouse is on the right side of the clip, it scrolls to the left and vice versa. Also i want to make it ease while doing this.
can anyone help me out with some ideas or perhaps a tutorial?
thanks
Ignoring (passing Up) Mouse Events / Click-through / Click-transparent
Hi, is there a way to make a Sprite transparent to certain (or all)
mouse events?
The display object hierarchy is not defined, or I should say that the
only thing I know for sure is that the Sprite I want to make transparent
to mouse events is a direct child of the stage.
I want the Sprite to ignore mouse events and other interactive objects
behind it to be able to catch them, even if the pointer is directly over
the Sprite. Is there a way to achieve this?
How Can I Trigger An Action Based On A Mouse's Position?
Seemed simple to me, but hasn't been the case, but my be simple for a script whiz:
How can I trigger an action that is dependent on a mouse's position? My scenerio involves a mouse being either IN or OUT of an odd-shaped area. I need an automatic trigger to say "hey, the mouse has left area 'X', so do action 'y'"
*also important, that it can work while the mouse is in html land, not even over the swf
(its a long story, but basically, cant use a simple rollover)
Flash help says:
The following example uses hitTest with the x_mouse and y_mouse properties to determine whether the mouse is over the target's bounding box:
if (hitTest( _root._xmouse, _root._ymouse, false));
huh? is that a typo? should it be:
(anyMovieClip.hitTest( _root._xmouse, _root._ymouse, false));
I don't understand where it refers to any MC.
Help!!?!
--------------------------------------------
If you are really wondering why I cant use a rollover, here is the long story:
I have a menu with main categories, and subcategories.
it is in a typical "Filing Tab" look and feel. So, the user rolls over a tab, to reveal subcategory buttons on the lower part of tab; in other words, bring that category's tab to the front.
So, once the mouse rolls over the main category tab, a MC moves to position where that particual tab is at the front, so now you can roll over the subcategories. if they roll out of the "Tab area", I need a way to instruct the MC to return to whatever tab it came from.
BOTTOM LINE IS, the mouse has left a particular area in the swf, and I need a way for this to be "caught", so I can assign an action.
I placed a "hidden" button on the outer boundaries, and used the MouseOver event, but if the mouse rolls to quickly off the swf into html-land, it doesn't catch the mouseover event, and trigger the return.
[Edited by cmoseman on 01-05-2002 at 08:00 PM]
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!
|