Can I use a global variable to determine the event?

If I want to switch using MouseEvents or TouchEvents, can I use a global variable to switch between the two?

For example,.

var myEvent:String = new String();

myEvent = "MouseEvent.MOUSE_UP."

myEvent = "TouchEvent.TOUCH_TAP";

myObject.addEventListener (myEvent, doFunction);

This does not work, but I was wondering if there was a good way to achieve this so that I can switch between the modes of entry easily during the test across different devices?

do not use quotation marks:

var myEvent:String;

myEvent = MouseEvent.MOUSE_UP;

myEvent = TouchEvent.TOUCH_TAP;

myObject.addEventListener (myEvent, doFunction);

Tags: Adobe Animate

Similar Questions

  • Can I use Ctlref in a structure of the event with a mouse to an event?

    I have a large number of controls on a front panel. I use a structure of the event that triggers the movement of a given motor when you press the corresponding button. However, I would like to avoid creating events for identical most of N, so I relied on the use of a mouse down on the front panel event, then retrieve the reference command using the Ctlref node (with gives 'Reference to the control on which the event occurred', according to manual labview) and analyze an array of references to know which engine is supposed to move. However, it seems that this node is not (contrary to what the manual said).

    I found other ways to do what I need (I thought using a table containing details of my controls and the coords in the structure of the event node), but I wanted to know why I can't find this node (that is displayed for the event "value change" for example). I'm using Labview 2013.

    No luck for you. Mouse down on the Panel does not have the refnum control because it does not work on a control. Mouse down on a control has it, and since you can configure the mouse down events on multiple controls in the same case of event, it also provides a refnum of control so that you can still use the order in question.

    This is probably also the question that Jeff might have seen. When you set up multiple events for the same frame that LabVIEW displays only the terminal event that are present in all of these events. Terminals that do not exist in at least a specific event of the multiple events for this image are more selectable.

  • A flag field can be used in a procedure to determine the success of previous block

    I have a stored procedure with a parameter IN and OUT below. The block
    a structure like below.

    In this procedure, there are several inner blocks with an individual
    exception handler. I need to change this option for a flag field as an additional parameter
    This procedure is such that if one of the execution of the inner block were to fail, the next time you run must pass the control to the block that failed (as in the INNER successfully executed previous blocks must not be performed again).

    How can I achieve this?
    CREATE OR REPLACE PROCEDURE procname(some_in_variable IN datatype1, 
                                                 some_out_variable OUT datatype2)IS    
    
    var1 datatype;
    var2 datatype;
    
    cursor cursorname IS
    ....
    ....
    ....
    
    BEGIN
      IF some_condition then
         RAISE main_exception_encountered
      ELSE
         DECLARE -- BEGIN OF INNER BLOCK 1
         ....
         ....
    
         BEGIN
          ....
          ....
          IF CONDITION THEN
          ....
          ....
          ELSE 
            raise some_excep;
          END IF;
         END;   -- END OF INNER BLOCK 1
    
         DECLARE  -- BEGIN OF INNER BLOCK 2
         ....
         ....
         BEGIN
          SELECT statements here
          ....
          exec some_procedure_name(param1, param2);
         exception
         END;   -- BEGIN OF INNER BLOCK 2
      ....
      ....
      ....
    
    
      EXCEPTION
        when some_excep then.....
    EXCEPTION
      when main_exception_encountered...do something
    END procname; 

    I'd written a status code to a journal table after each block successful. Perhaps a date as well otherwise you'll run this twice a day, or whatever.

    First thing the procedure must do is to read the table and get the last code block successful (for today).

  • Using a Global Variable for the input recorder DisplayRange

    I'm assuming; Since I can't do it; that you cannot change the display range of a graphic recorder by using a variable.  If there is a way I'd love to know how.

    Thank you!

    Determine if you can use a global variable is to click right in the parameter field. If the global variable is available in the context menu, then you can use a variable y.

    You can use a variable of the y-axis from the settings.

    You cannot use a variable for the display range of the x-axis parameter. This is because DASYLab needs to know the amount of memory to be allocated at the beginning of the measure.

  • Global variable to capture the username with Form 6i

    Hello world
    I have a menu created with Forms 6i and the shortcut that I use to call the menu in its target the following: C:\orant\BIN\ifrun60. EXE userid = name of user and password MYFORM. FMX
    When I remove the user name and password of the target of the shortcut he asks me the user name and password so when I typed, I am authorized to enter the application, but I want to be able to store the username on a global variable and set the value on an item when the user selects the program that he or she wants to use , so they're not going to see the other users information.
    Can someone please help me to do this step by step?

    Thanks in advance!

    Try: SOULEYMANE. VARIABLE: = USER;

    The USER is a function that returns the user name, as SYSDATE returns the date.

  • Can I use an I tunes card for the mini game on my I pad?

    Can I use an I tunes card for the mini game on my I pad?

    You should be able, unless you're an Organizer from family to family sharing (an organizer can not use gift cards). Buy the card on your account (this is the account that has downloaded the games on your iPad?): Redeem iTunes and Apple music gifts and codes - Apple Support

    Purchases should automatically use the balance of your account

  • Can I use an air2 iPad to sync the music on my iPod nano?

    Can I use an air2 iPad to sync the music on my iPod nano?

    Is ther a clot that I can use, lightning to USB, this music of sync word for my iPod nano 7th generation.

    N °

    There is no way to synchronize different iDevices between them.

    I'm sorry.

  • Can I use PXI embedded controller connected to the PC under LINUX operating system

    Hi all

    We ara tries to connect to PXI8106 (in 1042 chassis) to PC under LINUX via ethernet (cable cross at the moment), is the version of labview 8.5.

    Can I use PXI embedded controller connected to the PC under LINUX operating system?

    If Yes, where can I find its configuration in the .ini file?

    Thanks in advance.

    Hello bachir_elec,

    I'm sending you two links that I don't provide the information you need.

    Using Linux on an Embedeed PXI controller:

    http://digital.NI.com/public.nsf/allkb/821E0C115A3B4EF286257069004B8352?OpenDocument

    Configuration of your PXI Linux system:

    http://digital.NI.com/public.nsf/allkb/5CEEC941FB7B0488862573F700653B21?OpenDocument

    You can take a look?

  • What key combination can be used to capture a screen to the Clipboard? __

    What key combination can be used to capture a screen to the Clipboard?

    http://en.Wikipedia.org/wiki/screenshot

    In Microsoft Windows, pressing the button print screen capture a screenshot of the whole office and put it on the Clipboard. Pressing the combination Alt - Print Screen captures only the current active window. In most versions of Windows, captured screenshots do not include the mouse pointer.

    Video content in the programs using a hardware overlay video converter is not captured by the method described above. Windows Media Player on Windows XP in its default configuration on supported hardware is affected by this. However, some third-party applications can capture overlay images.

    By default, Windows does not record the screenshot to an image file; the user is required to paste the image into a separate program (such as Microsoft Paint, which is integrated) imaging for the economy. Some programs, however, especially online multiplayer, will automatically save screenshots in a specified folder. From Windows XP (or any version based on Windows NT), it is no longer possible to take screenshots of windows DOS full screen without other software.

    Windows Vista and Windows 7 include a utility called Snipping Tool, first introduced in Windows XP Édition Tablet PC. This is a screen capture tool, which allows you to take screenshots (called snips) of windows, rectangular areas, or a free-form area. Shears tinsmith can then be annotated, saved as an image file or an HTML page or by e-mail. Unfortunately, it does not work with uncompressed, XP versions but represents an XP compatible equivalent.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://en.Wikipedia.org/wiki/Print_screen

    In Microsoft Windows, pressing print screen will capture the entire screen, while pressing the alt key pressed in combination with the screen print will capture the selected window. The captured image can then be pasted into an editing as a word-processing, electronic mail, or graphics softwareprogram. On the keyboards that have a caps lock key, you may have to press lock first. Pressing print screen, with the alt key and the SHIFT key pressed, turns on a mode of high contrast for people with visual impairments.

    See you soon.

    Mick Murphy - Microsoft partner

  • Can I use MSTSC to connect remotely on the internet?

    Can I use MSTSC to connect remotely on the internet (local computer is Vista Ultimate SP2 to a distance Win 2003 Server)? I used MSTSC on my local network and it works well.

    Hi Ibaltsae!

    Thanks for posting. Yes, you can use MSTSC to connect remotely to a computer or server on the internet, the same as if you were using your local network. To connect to the remote computer, use the DNS or public IP that are associated with name.

    I hope this helps! Shawn - Support Engineer - MCP, MCDST
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • When I open a tab/icon on my computer is much too large for my screen and I can't use my computer; 3 boxes in the upper right corner.

    When I open a tab/icon on my computer is much too large for my screen and I can't use my computer; 3 boxes at the top right corner with the-, square and X are too far to the right to do anything. How can I fit on my screen, so I can use my computer?

    Hello

    Please contact Microsoft Community.

    This problem is limited to any icon or it happens with all?

    Did you change to the computer?

    I suggest to refer to the following methods and check to see if it helps:

    Method 1:

    Install the latest display driver and check

    Uninstall the driver from Device Manager display.

    a. close all programs. This will ensure that the programs do not interfere with the update of the driver.
    b. right-click on my computer, and then click Properties. This will bring you from the System Properties menu.

    c. click Device Manager
    d. expand the display column of cards by clicking on them. This will show the graphical current map that is using your computer.
    e. right click on the adapter, then select Properties.
    f. click on the driver tab. This tab displays information about the current driver, as well as options to update, delete, uninstall, and back the driver.
    g. click on uninstall
    h. restart the computer

    You can install the latest display driver for download on the site of computer manufacturing, same driver will reinstall automatically after the restart, if the computer is connected to the Internet.

    Method 2:

    I suggest you try the system restore. Restore the system to a restore point when your computer was working fine

    You can also check the Device Manager to see if the video card has a yellow exclamation on it with an error any:

    http://Windows.Microsoft.com/en-us/Windows7/products/features/device-management

    I hope this helps.

    Kind regards
    Anusha

  • I bought a Xbox 360 for Windows gamepad, as well as a Play and Charge kit. If I want the charge with this kit controller, can I use a USB/power Apple to the charge controller plug?

    I bought a Xbox 360 for Windows gamepad, as well as a Play and Charge kit. If I want the charge with this kit controller, can I use a USB/power Apple to the charge controller plug?

    Hi Arvin,

    The question you posted would be better suited in the Xbox Forums. I would recommend posting your query in the Xbox Forums.

     

    Welcome to the Xbox support

    http://support.Xbox.com/en-us/

    Hope this information helps.

  • Im having problems to connect my helmet at the entrance in front of my laptop, and I can't use my microphone, which says that the "device" is not connected.

    Hi im having problems to connect my helmet at the entrance in front of my laptop, and I can't use my microphone, which says that the "device" is not connected. What should I do? Thank you

    Hello

     
    1. have you checked the problem by plugging the headset to another computer?
    2. it worked before?
    3. What are you talking about ""device"is not connected?
     
     
     
    I suggest you to connect to another computer and check.
    Also check if the device is compatible with Windows 7.
    Reference:
    Windows 7 Compatibility Center
    If it's compatible, perform the methods below
    If it is not compatible, see the following articles:
     
     
     
     
     
     
     
    Method 1: Run the audio Troubleshooter and see if it helps.
     
     
     
    Method 2:
    Run the Fixit described in the article and perform the steps:
    See also:
     
     
     
     
     
    I hope this helps.
  • Exchange server and Surface RT, can I use Mail app to connect to the Exchange Server for email (the same question is for contacts or people and calendar)?

    Hello

    Our company uses an Exchange Server for email, contacts and calendar.

    Can I use Mail app to connect to the Exchange Server for email (the same question is for contacts or people and calendar)?

    Kind regards

    Matej

    You must install the SSL certificate before connect you to the Regional service, the easiest way is to go to "desktop" IE10 open, go to the exchange server web access page, click on the notification of "certificate error" red and view / install the store "certificate authorities roots of trust." Then, make sure that your surface RT complies with the minimum requirements of security then connect to the exchange via the mail application server.

  • Can I use other Adobe ID instead of the Adobe ID, used for the command to install and activate the Photoshop CS6?

    Can I use other Adobe ID instead of the Adobe ID, used for the command to install and activate the Photoshop CS6?

    Thank you

    Only ID authorized to use the software is the ID of the software license.

    Transfer an Adobe product license

Maybe you are looking for