Problem of mouse event (OVER and CLICK)

Hello world.

I ' n new AS3 and it was DIFFICULT to understand some simple things, I used to solve easily on AS1 and AS2...

I have a BUTTON called BOTAO82 which, once having a MOUSE event, should show a simple TEXT on a specific area of the screen (something explaining where this button takes you to).
This button will be two events: MOUSE_OVER and MOUSE_CLICK.
The CATCH, I understand... Ok.
The problem is no LONGER. How to DISPLAY the related TEXT when the mouse is over this button?

Here is what I put on the STAGE as code:

=============
botao82.addEventListener (MouseEvent.MOUSE_OVER, botao82over);
botao82.addEventListener (MouseEvent.CLICK, botao82click);

function botao82over(event: MouseEvent)
{
do not know what to do here...
}
function botao82click(event: MouseEvent)
{
gotoAndPlay ("video82");
}
===============

Any ideas, please?

PS. : The first thing I tried was putting the TEXT to display IN the configuration BUTTON, who ended up in the TEXT BOX, a button itself! Gee whiz... terrible!

Thank you all! ;)

So, just so that we have everything (breakdowns) SETTLED in our minds... that's the FINAL working code:

------
txt82. Visible = false;

botao82.addEventListener (MouseEvent.MOUSE_OVER, botao82over);
botao82.addEventListener (MouseEvent.MOUSE_OUT, botao82out);
botao82.addEventListener (MouseEvent.CLICK, botao82click);
function botao82over(event: MouseEvent)
{
txt82. Visible = true;
}
function botao82out(event: MouseEvent)
{
txt82. Visible = false;
}
function botao82click(event: MouseEvent)
{
gotoAndPlay ("video82");
}

where txt82 and botao82 are MOVIECLIPS with these exact instance NAMES.

And here! That's all!
Don't forget to mark the
«automatically declare stage instances»
the settings for AS3!

Tags: Adobe Animate

Similar Questions

  • Problem of mouse event (NEW)

    Sorry guys...
    The last problem has been solved, Yes... but not presented another!

    Do not forget the code:
    ------
    txt82. Visible = false;

    botao82.addEventListener (MouseEvent.MOUSE_OVER, botao82over);
    botao82.addEventListener (MouseEvent.MOUSE_OUT, botao82out);
    botao82.addEventListener (MouseEvent.CLICK, botao82click);
    function botao82over(event: MouseEvent)
    {
    txt82. Visible = true;
    }
    function botao82out(event: MouseEvent)
    {
    txt82. Visible = false;
    }
    function botao82click(event: MouseEvent)
    {
    gotoAndPlay ("video82");
    }
    ------

    When I wanted a text to view or hide depending on the mouse event?
    Ok...
    Now, when I CLICK, I'll go "video82" allright, but I will ALSO take a mistake!
    "Cannot access a property or method of a null object reference" - on botao82out

    which means that: when I click and upward for "video82", the mouseout/mouseouthandler() is also called to make the text disappear, but the function is not available any more because we moved upward at a different time.
    No opportunities?

    Erik.

    Hi Haran,

    bota82 IS the movieclip, which must be like that because of the designation of its instance, called in the code.

    Anyway, guys, I found the solution! YEP! Increases enormously the code, but... Well well... it works!

    I had the button layer extended over time.
    The problem is that when I clicked and went to the armature video82, for example, all the buttons show always also clickable.
    How do I solve this?
    More magic! Developing magical disappearance!
    at the beginning of the code I certify that the buttons are visible:

    botao82. Visible = true;
    and so on with them...

    then, just before the click function, I turned them all OFF! : D

    function botao82click(event: MouseEvent)
    {
    botao82. Visible = false;
    botao83. Visible = false;
    botao84. Visible = false;
    botao85. Visible = false;
    botao86. Visible = false;
    botao87. Visible = false;
    botao88. Visible = false;
    botao89. Visible = false;
    botao90. Visible = false;
    gotoAndPlay ("video82");
    }

    Phew! It worked!

    Know what? I think more clearly when I discuss the issue with my comrades here in the forum! Thank you all.

    I hope this helps others in the future!
    Erik.

  • Z230: Problems of mouse HP over the weekend.

    We have several thin lines HPZ230 in our environment, and over the weekend, some of them decided to not recognize the HP USB mouse wired that came with the system. I tried disconnecting and reconnecting, restarting, even a restoration of the system on one of them to a week ago, however, none of this solves the problem. The only solution I have at the moment is to plug any other mouse brand in the PC that solves the problem for the other mice of the brand. I tried to return the updates of Windows who applied over the weekend, and again, this does not resolve the issue. I tried to reinstall the USB drivers as well with no luck on the HP mouse. The keyboards work fine, it's only a mouse problem.

    Just had the same problem on a Dell PC with one of the same HP attached, mouse and it seems to affect Windows 8.1 and Windows 10. The mouse is misidentified as a HP USB - C for DisplayPort adapter. You can right click on the mouse in Device Manager, click on 'Update driver', then click on "Browse my computer for driver software", then "Let me pick from a list of drivers for devices on my computer. You will be offered an additional choice (I forgot the formulation that I am not the PC a plus, but it's a very bland USB device). What to choose and say hello to your mouse pointer.

  • my desktop mouse puts highlight and click on everything

    My mouse seems to have a mind of your own. He puts highlight and click on everything except what I want. I uninstalled then reinstalled the mouse and I have run the Microsoft Windows malicious software removal tool and neither worked. I've had this mouse for a few months and have never had any problems with her or one of those before it.

    Looks like a bad mouse, to be honest.

    I an I can connect now and get these results.  Actually - I can leave it hooked up next (as) another mouse and as long as I only use the mouse - I don't get any problems/issues.  As soon as I use it - problems start.  Stop using it, stop problems.

    Swap mouse.  If that fixes it - there you go.

    It really does sound like malware at all; However, if you really want to watch:

    Download, install, and run a full scan of the system with these two elements (free version):

    Delete everything they find.

  • I can't go in the drop down menus to work, I roll over and click on, nothing happens. Clicking on some of the miniature pictures to change the magnified view, the captain does not change. So annoying! I can't use FF like that. I am newly updated, 10.0.1.

    This site (http://video.pbs.org/) drop downs 'Programs' and 'Subjects' do not work when you click on it.
    This page (http://www.modcloth.com/shop/dresses/ain-t-over-until-it-s-clover-dress) when you click on the thumbnails of the green dress, the larger picture view does NOT change.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • Problem of mouse position with rescue CD distributions

    I am running WS7.1.4 on Fedora 15. Everything works fine on various guests that I'm running off of virtual disks.

    Now, I want to resize a partition on a hard drive in XP, so I downloaded Knoppix to do the job. When I boot it upward, the mouse moves normally, but the pointer is on the right and down where is the real mouse and it will use only part of the screen. I also tried System Rescue CD and get the same mouse problems. It is only by using a classic USB mouse.

    I have watched a few of problems of mouse-related messages and didn't find anything clear on this issue.

    I would like to use the latest GParted Live, but you will have the same mouse so problem to solve, you can try the following:

    Temporarily the value of the Type of the guest OS Linux and then try.

    If this does not work then temporarily remove the virtual computer USB controller and that will definitely fix the problem with the mouse.  Don't forget to add the USB controller if you use this method.

    There are also changes of configuration setting .vmx that can be done beyond that temporarily affecting the Type of guest OS Linux, but they are necessary only if this does not work and or you must have the USB controller to access a USB at the same time in the Virtual Machine.

  • My Firefox interface is messed up. When I hover over or click a button, it becomes all the pixlated, blocks move and lines appear around the buttons.

    When I hover over or click a button in the toolbar it is messed up. Blocks, or more like pixels, appear on the buttons. They are white and they move. Few black lines appear too around the buttons. I tried to uninstall and re - download Firefox, a complete reset, etc. Nothing has worked so far. To see the pictures of the problem to use this URL (it will take you to Imgur): http://imgur.com/a/LXHQg

    Hi, try updating your graphic driver - this should be the correct link for your system: http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y & DwnldID = 22375

  • Menu bar and 'new tab' button are white when firefox is open, each button becomes visible when the mouse passes over it. How can I fix it?

    The individual buttons reappear as the mouse moves over them. (file, edit, view, etc.)

    If hardware acceleration is the cause of the problems then this means that Firefox is unable to use the GPU to your chart view card in order to unload the main processor and perform actions more quickly.

    You may not notice any difference is most cases.
    The only solution is to check if there is an update of the driver for your graphics card.

  • the exact position of the mouse click xy graph while he plotted graph with mouse events

    Hello

    IAM using Graph xy for multi locations

    IAM traced graphic with mouse movement and events using the example attached (draw the graph with mouse events)

    but in sub vi Values.vi scale there are two constants 66 and 30 when I change my plot (I also change the scales), then the mouse position and chart position (cursor) value are not well aligned, but when I change the constants mentioned above I get the alignment perfect between the cursor and the last point in the path.

    as I went to another parcel (with scalability again) the same alignment problem resurfaced.

    I need to replace these two constants with something dynamic

    Please help

    concerning

    Mazhar

    solution to my problem is

  • The mouse pointer stuck in mode full screen, but works for bearings and clicking on boxes

    Using win7 x 64, when I get full screen of a game (wow) mode, I lose the use of mouse pointer (its icon is stuck, but I can't gess it runs from bearings and clicking any key).

    Also, if I use another game with win7 x 64 (Flight Simulator) everything works. So, without blaming win7 in itself, I suspect a problem of compatibility between the client of the game and also the video card driver.

    Since everything is updated, my only hope is that you can suggest something, the mouse settings, settings, anything which might help as a workaround. Thank you, ricardo

    Found the workaround from another thread in battle.net, and I reported it here:

    http://EU.battle.NET/wow/en/forum/topic/975220040

  • Right click mouse to drag and drop or rename folders and files does not work

    For a few weeks now, I had problems with the right click function to drag - move files and folders, or rename files and folders. This happens when I use windows Explorer or access to the computer and click thruogh for a feature. He can't go to all the folders and files, but many. I can't right click on these folders or files to change the sharing because explore closes and restarts on the desktop with a right-click. Manifest error "appcrash" reason. I have Norton Security suite installed and neither Norton or your fix program detects a problem.

    Please notify.

    awehnert

    Have you installed or removed/uninstalled all hardware or software or drivers since just before the start of this problem (if so, exactly what - name, version, device, whatever)?  Norton take any infection, although it is said that he cleaned their since just before the problem started?  If so, you know the names of these infections?

    Do you know when this problem started?  Try a system restore to a point in time BEFORE the problem started.  Here is the procedure: http://www.howtogeek.com/howto/windows-vista/using-windows-vista-system-restore/.  Don't forget to check the box to show more than 5 days of restore points.  If the first attempt fails, then try an earlier point or two.  NOTE: You will need to re - install any software and updates that you have installed between now and the restore point, but you can use Windows Update for updates.  It's been a while so I'm not sure that you have a fairly old restore point but it is possible - hopefully.

    Are these files and folders in your user profile?  If Yes, your user profile may become corrupted (in fact, if can still be corrupted if the folders are not there).  To fix this use http://windows.microsoft.com/en-AU/windows-vista/Fix-a-corrupted-user-profile.  If that is the only available Administrator Profile (you need to be an administrator to fix this), enable the Hidden Administrator Account (HAA) using http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.windows.vista.administration_accounts_passwords&p=1&tid=d20f9db4-7b2c-48be-a087-7835dc2a9055&mid=d20f9db4-7b2c-48be-a087-7835dc2a9055.  If you don't remember the password, try nothing because that's probably what you (or seller) did during the installation.  Once that is done, don't forget to disable the HAA to save it in case it is necessary once again and for safety reasons (since people often try to hack into systems using this account).  Do NOT use the HAA as your administrator account because if you lose the only administrator on the system account or it is damaged again, then you're watered.

    We will check some of your system files and hard drive for ccorruption that may be the cause:

    Go to start / all programs / accessories / command prompt and right click on command prompt, and then click Run as administrator.

    Type sfc/scannow, go and let it run.  It will scan and try to correct some of your system files.  If all goes well he comes complete with no corruption, it could not repair (if it has these post of corruption here or try to analyze it to find the problem or files using http://support.microsoft.com/kb/928228.  Try to put all the corrupt files here so that we can see if they can be repaired with good copies of the installation disc (unless there are too many).

    While in the command prompt, type chkdsk /f /r and enter and let it run.  She might want to plan itself to start at the next startup.  Okay, then restart so that the program can run. It will scan and attempt to resolve any corruption or bad sectors on your hard drive and remove especially as a potential cause.

    Please checkwith the manufacturer to find out if there is a mouse driver updated (software or firmware) available for your make and model of mouse and your version of Vista.  Download and install to update the driver to the most recent available and see if that solves the drag and drop problem (even though I know that this will not affect the question of the name change).  Once you have the drivers, you can install them via the Manager device as follows: http://www.vistax64.com/tutorials/193584-device-manager-install-driver.html.

    If it doesn't (or if SFC detects corruption it cannot repair), we you will need to do a repair/system upgrade using the Windows Vista Installation disc authentic (you own or that you can borrow from someone).  Here is the procedure: http://www.vistax64.com/tutorials/88236-repair-install-vista.html.  Although this will not affect your data, settings or programs, you should always back up your data before you start just be on the safe side. You can have a lot of updates to re - install (including all you need to remove service packs).  If the version of the system came with SP1 or SP2 preinstalled and the disc is an earlier version, then you will need to make a record of slipstream as follows: http://www.vistax64.com/tutorials/151606-vista-sp1-slipstream-installation-dvd.html.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Solution to the problem of the touchEvent and click

    Hi all

    Finally I found the solution to touchEvent and click on the question discussed here

    http://supportforums.BlackBerry.com/T5/Java-development/problem-with-touchEvent-and-click/TD-p/58671...

    I put my code based on navigationClick and also said a function void touchEvent() as shown below

    protected boolean navigationClick (int status, int time) {}

    code click event

    }

    protected boolean touchEvent (TouchEvent event) {}

    }

    Now I can easily detect a touch event on any area on my screen

    Don't know how it works, but I'm getting the desired output

    Afonso Tyagi

    My code works now

  • Windows 7 mouse problem - my mouse has been lagging and skipping

    My mouse has been trolling and jumping, it happens mainly when there is another process that is (microsoft word, sony vegas, adobe photoshop, youtube video, etc.) and sometimes when nothing is open she does it anyway. I tried to use different mouse (HP 2.4 ghz wireless mouse optical mobile and a logitech wireless optical mouse) and different usb ports. I tried to adjust its processes to high priority. I have updated drivers for my EAH4850 512 MB graphics card and my AMD Phenom quad core Black edition. I tried different surfaces with the same result, tried to change the sensitivity and resolution. updated my catalyst control center and I tried a little overclocking with AMD overdrive. I am running Windows 7 Home Premium, and I never had this problem until last week.

    Hello
     
     
    There is a third party application that is causing the conflict. See the article below for instructions on how to start your computer in a clean boot state.
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: When the diagnosis is complete, don't forget to reset your computer to normal startup. Follow step 7 in the above article.
     
     
    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Problem with the events and Movieclips

    Hi all.

    I got myself in a situation where everything was perfect with zoom events, keyboard events and drag-, click of the mouse.

    The project is:

    A movieclip with image sequence: original background.

    And other clips: also images sequence (png)

    They were all separate specific mouse events and all the zoom and key events.

    Now wen I click on the button with the movieclip to function, only the png image sequence is turning and the main mc is not.

    What should I do to rotate active both regardless of the mcs and main mc also png with these.

    Help, please.

    Thank you in advance.

    use:

    var mcA:Array = [garage_horizon_mc, garage_moss_mc, garage_ocean_mc, gutter_ocean_mc, gutter_horizon_mc, Audrey r_moss_mc, main_mc];

    for (var i: int = 0; i<>

    mcA [i] .addEventListener (MouseEvent.CLICK, garageF);

    }

    function garageF(e:MouseEvent):void {}

    for (var i: int = 0; i<>

    mcA [i] .visible = false;

    }

    var mc:MovieClip = MovieClip (e.currentTarget);

    mc.gotoAndStop (rotationframe);

    MC. Visible = true;

    whateverF (mc);

    }

    function whateverF(rotater_gah:MovieClip):void {}

    rotater_gah.offsetFrame_gah = rotater_gah.currentFrame;

    rotater_gah.offsetX_gah = 0;

    rotater_gah.percent_gah = 0;

    rotater_gah.addEventListener (MouseEvent.MOUSE_DOWN, startDragging_gah);

    rotater_gah.addEventListener (MouseEvent.MOUSE_UP, stopDragging_gah);

    }

    function startDragging_gah(e:MouseEvent):void {}

    e.currentTarget.addEventListener (MouseEvent.MOUSE_MOVE, drag_gah);

    e.currentTarget.offsetX_gah = e.target.mouseX;

    }

    function stopDragging_gah(e:MouseEvent):void {}

    e.currentTarget.removeEventListener (MouseEvent.MOUSE_MOVE, drag_gah);

    e.currentTarget.offsetFrame_gah = rotater_gah.currentFrame;

    }

    function drag_gah(e:MouseEvent):void {}

    e.currentTarget.percent_gah = (e.target.mouseX - e.currentTarget.offsetX_gah)/e.currentTarget.width;)

    var frame_gah:int = Math.round(e.currentTarget.percent_gah*e.currentTarget.totalFrames) + e.currentTarget.offsetFrame_gah + 1;

    While {(frame_gah>e.currentTarget.totalFrames)}

    frame_gah = e.currentTarget.totalFrames;

    }

    While (frame_gah<=0)>

    frame_gah += e.currentTarget.totalFrames;

    }

    e.currentTarget.gotoAndStop (frame_gah);

    }

  • event touchstrat and mouse

    Hi, on the touchstart event and mouse quesation.

    If I want to have the animation on the web and ipad, do I need two separate files.
    One for the mouse event (web)

    and one for the ipad (touchstart)

    Thank you

    Tone

    Thanks for the comments, Elaine!

    TonUden, some people use touchstart paired with click or mousedown to make things work for the two Office/touch and reduce delays on touch devices.

    For example:

    Symbol.bindElementAction (compId, NomSymbole, "${_my_symbol_name}", "mousedown touchstart", function (sym, e) {e.preventDefault ();)                     sym.playSomeAnim ();                     });

    e.preventDefault () works, but in some cases, it can interfere with the scroll on a touch device.

    Without e.preventDefault (), the event fires twice on a touch device. Of course, I found it's true for me.

    Google has implemented a solution:

    https://developers.Google.com/mobile/articles/fast_buttons

    Here are a few others that people use:

    http://StackOverflow.com/questions/7018919/how-to-bind-touchstart-and-click-events-but-not - meet-to-two

    Each of these methods would probably need some adjustments to work within to enliven.

    Personally, I decided to go with a simple 'click' event for now because it works for what I'm doing.

    However, I will test the method of fastbutton Google when I get a chance.

    Mario

Maybe you are looking for