How to use MouseEvent and KeyboardEvent on the same function?

It's maybe a stupid question, but I'll ask her.

I did a login (textfield and a button).

mybutton.addEventListener(MouseEvent.CLICK, loginCheck); It's my button

function loginCheck(event:MouseEvent):void {}
My code for the function here

}

In order to make the connection by using the Enter key, I tried to add:

myText.addEventListener (KeyboardEvent.KEY_DOWN, keyEnter);
function keyEnter(event:KeyboardEvent): void
{
If (event.keyCode is Keyboard.ENTER)
{
loginCheck();
}
}

But of course it won't work because loginCheck is a function of MouseEvent.

How can I make it work?

It does not appear that you will use one of the properties of type event mouse or keyboard in loginCheck, right? Then, you can simply set the type of the parameter in loginCheck() to the event instead and add the event argument in keyEnter() when calling loginCheck() from here-> loginCheck (event).

rmybutton.addEventListene (MouseEvent.CLICK, loginCheck, false, 0, true); It's my button

function loginCheck(event:Event):void {}
logic of connection here

}

myText.addEventListener (KeyboardEvent.KEY_DOWN, keyEnter, false, 0, true);
function keyEnter(event:KeyboardEvent): void
{
If (event.keyCode is Keyboard.ENTER)
{
loginCheck (event);
}
}

TS

Tags: Adobe Animate

Similar Questions

  • How to use headphones and speakers at the same time

    I want to use headphones at the same time that I use the speakers.

    I am hard of hearing and need the LOUD volume. When others are watching a film, projected on HDTV, they won't let me turn the volume up to where I need it, which is why, headphones and speakers at the same time.

    I use Windows 7, I want to stick with Windows 7, so I want a Windows 7 solution.

    If there is no solution for Windows 7 and there is a solution using Windows 10, then and then only, I will be upgrading to Windows 10.

    Using headphones and speakers was possible under Windows XP. I think that a kid at Microsoft, with a regular audience, thought this feature was redundant and removed. Large.

    Macs will play through the headphones and speakers, so maybe it's time to buy a Mac!

    Hi Bob,

    Thanks for posting your query on the Microsoft Community.

    With the description, I understand that you want to use headphones and speakers at the same time on your Windows 7 computer. I will certainly help you get this fixed number.

    I suggest you check the suggestions contained in below mentioned thread and check if this is useful:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/headphones-speakers-at-the-same-time/7ed31bcf-3762-430D-9c9f-e6967d670d0e

    Hope this information is useful. Please come back to write to us if you need more help, we will be happy to help you.

  • How to use Notepad and utube at the same time on an ipad?

    Is there a way to mulitask with two apps on the iPad, I want to take notes while watching a utube video?

    only on the most recent iPads that supports multitasking side by side

  • How to export images and they look the same on all devices (iPhone, mac, desktop computer book)

    Hello

    I have adobe lightroom cc 2016 and I'm having the hardest time export photos, especially those where I use adjustment brushes and have look the same on all devices, my man book retna I will edit to look how I want, but for example when I look at the same image on the desktop mac dessu I can see all the adjustment brushes I used to darken

    on the 2 pictures below

    the first is what I see, its all uniformly dark and when I look on another device, according to me, which is depicted in the second photo

    (I have more exposed the second to show what I mean)

    I do not know what device who's going to be watching this post, but I hope you can help!

    Thank you! don't know what to do

    IMG_1204.jpgIMG_1204-2.jpg

    To ensure maximum viewing compatibility make sure you set the colorspace of the export in sRGB as below:

  • How to play music and narration at the same time on windows movie maker?

    I'm working on a project and successfully, I could put my videos for a song. to get all the points for the project I need to explain what is happening in videos. I have now that I need to tell and I was able to do it too. I don't know how to play the narration without stopping the music, I need narration and music at the same time. I know this is possible because I found...

    You can add music and narration Audio / Music track in Windows Movie Maker. The two can play at the same time in your published movie. You can then adjust the audio levels to determine which audio will play louder than the other in your movie.

    Please write again (:)

    I'm working on a project and successfully, I could put my videos for a song. to get all the points for the project I need to explain what is happening in videos. I have now that I need to tell and I was able to do it too. I don't know how to play the narration without stopping the music, I need narration and music at the same time. I know this is possible because I found...

    You can add music and narration Audio / Music track in Windows Movie Maker. The two can play at the same time in your published movie. You can then adjust the audio levels to determine which audio will play louder than the other in your movie.

    Please write again (:)

    =================================
    Simple solution... Publish (save) your project in the
    film format .wmv to a folder on your hard drive.

    Re-import the file .wmv (as a new project) and now
    audio / music will be clear and you can add
    the narration.

    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How to use several different sections of the same clip in the timeline?

    Hey, I used this tutorial as a reference for editing. I have my own equipment I want change, which includes several takes different. Is it possible to use several different sections of the same clip in the timeline? You know, like the good part of a certain record keeping. I appreciate any assistance. Thank you

    Post edited by: Kevin Monahan

    Reason: changed the title of best research opportunities

    I prefer to put the clip in the Source monitor Panel, then set the points and exit. From there you can simply drag the section of the element in the sequence.

    Or, you can make a subelement, the section will have a distinct element in the bins in the project Panel. You should always keep the original material, but now you can have real subitems to work if you prefer.

  • Can I use cs and cc at the same time?

    Can I use both cs and cc at the same time after upgrade to Adobe Creative cloud?

    Yes. I have CC and installed CS and both work. However, I don't see why I should use cs.

    Concerning

    Kasper

  • How to use substr and instr, where the line of input Multi text

    Hi all

    with

    data in the form of)

    Select ' Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234..' double val

    Union of all the

    Select 'Bill Johnson.Apartment 3 b. Sterling.VA.20166.3 Plaza Falke' of the double

    )

    Select

    regexp_substr (shipping_instructions, "[^ #] +' 1, 1") name

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 2") address

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 3") city

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 4") State

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 5") zip

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 6") County

    FROM (select REGEXP_REPLACE (val, ' \.)) () [^.])', ' #\1 ") data shipping_instructions)

    (1)'Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234..'

    (2)'Bill Johnson.Apartment 3 b. Sterling.VA.20166.3 Falke Plaza. »

    "Mary America. 1234 Southridge Park Dr. Samna Lorie. MO.31234..'

    NAME ADDRESS CITY ZIP County SATE

    ---------                  --------                                ------------           ------           -------    -- -----

    Married America 1234 Southridge Park Dr.    Samna Lorie MO 31234  NULL VALUE

    "Bill Johnson. Apartment 3B. Sterling. VA. 20166. Falke Plaza 3... "

    NAME ADDRESS CITY ZIP County SATE

    ----------------      -----------------        -------       -----        ---         --------

    Bill Johnson apartment 3B Sterling, WILL 20166 3 Falke Plaza.

    Problem

    ---------

    (1) if the value, if the County (if null) value then it shows the ZIP with dot's (.) value, in the 31234 above..,.

    How to solve this problem?

    (2) another possible to fix the code, I want to use substr and InStr.

    (3) who is the best approach?

    Conditions:

    --------------

    (1) shipping_instructions column has the value with "Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234... »

    This means it combined all the similar name, address, city, State, zip

    (2) we insreted in the table separately.

    =========================

    / * Use Substr and Instr * /.

    =========================

    I used substr and instr, but I'm getting the money results (no point in the address).

    "America Mary. 1234 Southridge Park Dr. Samna Lorie.MO.31234..'


    NAME ADDRESS CITY ZIP County SATE

    ---------                  --------                                ------------           ------           -------    -- -----

    Mary America 1234 Southridge Park Dr. Samna Lorie MO 31234  NULL VALUE

    But I need the results (no point in the address)

    NAME ADDRESS CITY ZIP County SATE

    ---------                  --------                                ------------           ------           -------    -- -----

    Mary America 1234 Southridge Park Dr.    Samna Lorie MO 31234  NULL VALUE

    Hello

    994122 wrote:

    Hello

    (1) how do to do this, use the substr and instr functions?

    Thank you

    You can't do all the work with SUBSTR and INSTR; you need regular expressions to obtain a string delimited by a #.

    Once you have such a string, then you can use SUBSTR and INSTR (instead of REGEXP_SUBSTR) to get the separate secondary strings:

    WITH got_delimited_string AS

    (

    SELECT REGEXP_REPLACE (val

    , '\. ([^ .]| $)'

    , '#\1'

    ) AS delimited_string

    FROM the data

    )

    got_pos AS

    (

    SELECT delimited_string

    , INSTR (delimited_string, "#", 1, 1) AS pos_1

    , INSTR (delimited_string, "#", 1, 2), pos_2

    , INSTR (delimited_string, "#", 1, 3) AS pos_3

    , INSTR (delimited_string, "#", 1, 4) AS pos_4

    , INSTR (delimited_string, "#", 1, 5) AS pos_5

    , INSTR (delimited_string, "#", 1, 6) AS pos_6

    OF got_delimited_string

    )

    SELECT SUBSTR (delimited_string, 1, pos_1 - 1) AS the name

    SUBSTR (delimited_string, pos_1 + 1, pos_2 - (pos_1 + 1)) AS address

    SUBSTR (delimited_string, pos_2 + 1, pos_3 - (pos_2 + 1)) AS city

    SUBSTR (delimited_string, pos_3 + 1, pos_4 - (pos_3 + 1)) AS State

    REPLACE (SUBSTR (delimited_string, pos_4 + 1, pos_5 - (pos_4 + 1))

    , '.'

    )                                                           AS zip

    SUBSTR (delimited_string, pos_5 + 1, pos_6 - (pos_5 + 1)) AS the County

    OF got_pos

    ORDER BY delimited_string

    ;

  • How to use layers and colors of the index to even

    I work a lot in pixel art. I use indexed images. I need to be able to work in layers while working with indexed colors.

    How to use the index while working with layers?

    You can't do it in Photoshop.

  • How to use reports and Jasper in the Apex to print PDF

    I again and here knowledge how to use jasper reports to print PDF files

    Please see Dietmar excellent tool. I'm just a happy camper.

    http://www.Opal-consulting.de/Apex/f?p=20090928:4:542360562486677:no:

  • Use certificate and form to the same application of ADF basic authentication

    Hello

    We have an application that needs to use time based authentication CLIENT-CERT and FORM.

    I have configured a domain with Client certificate requested and applied, generated a client certificate, created an Asserter custom identity with a Login Module and successfully recorded in our application using the CLIENT-CERT. , our customer wants to use the FORMS authentication at the same time with the CLIENT-CERT authentication type.

    The idea only I had was to use a servlet proxy deployed on another instance of WebLogic (10.3.6) that uses the CLIENT-CERT authentication that will forward requests to the main ADF application using classic FORM based authentication. The problem with this approach is that the proxy servlet is accessible using HTTPS and the communication between himself and the application of the ADF is made by using HTTP, so the client browser is redirected to HTTP on first access. For example, if I used Apache to proxy requests that would have been easily solved using RequestHeader set true WL-Proxy-SSL.

    You have any other suggestions on how to achieve this?


    Thank you in advance,


    Ionut Cristian Paraschiv

    Multichannel Solution Architect

    Advahoo Business Solutions

    I found a work around for this problem:

    -l'application uses FORMS authentication in function

    -l'application is deployed on a server managed with Client Cert has requested and applied (only clients with certificates will connect over HTTPS)

    -the login page has only one input for the password text

    -in the bean of login, in the doLogin() method page, we can get the certified client and get the username with a custom class of UserNameMapper

    Object certChain = request.getAttribute ("javax.servlet.request.X509Certificate");

    Certificate CERT [] = certChain (certificate []);

    X509Certificate cert = (X509Certificate) CERT [0];

    ... to get the user name

    Ionut Cristian Paraschiv

    Multichannel Solution Architect

    Advahoo Business Solutions

  • How to use a script to validate the same field with different addresses in different pages?

    I have a script that is applied to a field 'email '.

    The script asks to check the address, if it is not well written.

    But this field is present in many pages for different guests filling in this information.

    How can I adapt this script? (without changing the name of each field of each page and therefore to change the value in the script to a page that ...)

    function confirm_email_OnValidate (element)

    {

    Event.RC = confirm_email_Validate (Element, event.value);

    }

    function confirm_email_Validate (Element, newvalue)

    {

    If (newvalue.length < = 0)

    Returns true;

    Model = newvalue.replace (/ [a-zA-Z0-9] + ((\.| _ | \-) [a-zA-Z0-9] +) * @([a-zA-Z0-9] +(\.| \-))+[a-za-Z]{2,}/, «»);)

    If (Dummy.length! = 0)

    {

    InputError (element, 'Check this address');

    Returns false;

    }

    Returns true;

    }

    function confirm_email_Format (element)

    {

    Returns true;

    }

    You can use the eMailValidate built-in function to simplify this. For example, you can use the custom following validation script:

    if (event.value && !eMailValidate(event.value)) {
        app.alert("Check this address");
        event.rc = false;
    }
    

    It provides a validation better than the regular expression that you have demonstrated.

    Without knowing how you use the parameter of the element and the operation of the function InputError, it is difficult to offer something more.

  • Use wireless and USB at the same time on an OfficeJetPro 8500

    I have a HP OfficeJetPro 8500 Wireless I want to use both wireless to other computers by using the USB connection to the office which is in the same room and the House. Is it possible to do both at the same time? The manual suggests that you connect using wireless or connect USB but says nothing about aid from both. Thank you

    Hello

    Yes, you can do both.

    Install the USB with your desktop computer at the office.

    Install wireless on other wireless devices.  Your other devices should find the OJ Pro 8500 Wireless and connect.  You should be asked the SSID and password on these devices.

    It will depend also on the number of wireless devices can manage your router, so make sure that your router is capable.

  • Using PC and Mac under the same belonging to the creative cloud

    I use a PC and a Mac interchangeably at different locations. Under the same membership in the creative cloud, the software can be downloaded to a PC and a Mac? Also, graphics files created using a PC to update using a mac and vice versa? Thank you.

    Yes and Yes.

    You can install on both using the cc desktop application, https://creative.adobe.com/products/creative-cloud

  • Using insert and delete at the same time

    Good afternoon

    I want to do an insert on the table A in table B, while at the same time do a delete on table a.

    and I want to do with the procedures.

    Here is the script I came up with.

    INSERT the table_a (select * from table_b where status = was ') REMOVE from table_b where status = has '

    but I get an error ORA-00933.

    Got any ideas on how I can do this?

    Thank you

    try to:

    BEGIN

    Insert into table_b (select * from table_a where status = has ');

    remove from table_a where status = ';

    END;

    In addition, to create a procedure and see if you can only call this:

    some_procedure

    in some cases, for example (type ODBC connection)

    {call some_procedure ;}

    MK

Maybe you are looking for