Wait for the sprite press / clicked

Hi, I am trying to display graphics when the user touches the sprite first which I reproduce, then another graphic when the user releases the sprite (raises their finger). I don't know how to go on this subject! Please help me!

Thanks in advance

On the Sprite that you draw in, add an event listener for mouse down and mouse upwards.  This will work only on drawn graphs and not areas of the sprite which pulled anything in.

private var sprite: Sprite = new Sprite();

//...

addChild (sprite);

make the drawing

sprite.addEventListener (MouseEvent.MOUSE_DOWN, MouseDown);

//...

private function MouseDown (event: MouseEvent): void

{

this.sprite.addEventListener (MouseEvent.MOUSE_UP, MouseUp);

do something

}

private void MouseUp (event: MouseEvent): void

{

this.sprite.removeEventListener (MouseEvent.MOUSE_UP, MouseUp);

do something

}

Tags: BlackBerry Developers

Similar Questions

  • Start stuck on "Please wait for the Local Session Manager."

    I would say that this problem started a couple of days. Went to start my laptop (Toshiba) and he sat on the "Please wait" message forever.

    Had no problems to start in safe mode. Looked up various ways of addressing the problem.

    Was able to change the resume date and back a few weeks ago. Still no luck. Happened to read something on a printer Epson being perhaps the problem driver (it was installed a day before the date of restoration chosen). Uninstalled the drivers, computer still does not start.

    Tried restarting running. I do not have the CD it came with Vista, but it was an option when you hold F8 during startup (I think?) Couldn't find any problems.

    Ran check on memory. No problem either.

    Changed settings for a verbose startup and ran a Diagnostic startup - all good for this. Then tried selective startup load system services... This is when the error occurs. When starting, it hangs on "Please wait for the Local Session Manager" and does nothing more.

    I looked in the event viewer to see what came that time and a couple mistakes were:

    Event ID 6000: winlogon notification subscriber was unavailable to handle a notification event.

    Event ID 7026: the next (s) start or start failed to load system
    spldr
    Wanarpv6

    It would be very useful for me not having to run my computer in safe mode automatically all the time, although it is useful that I at least have that option. Any help is greatly appreciated.

    Hello

    1. by chance your computer is connected to a domain environment?

    2. as you mentioned in your article that you tried the selective startup, I want to confirm if you have disabled the services left 3rd after hide Microsoft services?

    If you did not disable these services make sure you disable and then check if it works.
    See the article below for more information.
    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.

  • Photoshop has given up waiting for the assessment

    I have an error message at startup "photoshop gave up waiting for the assessment of the display driver. Improvements using graphics hardware have been disabled. "If I click 'ok', Photoshop and then freezes. How can I fix this as it has been nothing more than a waste of money.

    Windows 7 Home Premium

    64 bit

    Hi Chris,

    This error means that your graphics card is not updated or have problems loading.

    Try to update your graphics driver.

    Make sure that you meet the requirements according to your version of Photoshop system requirements | Photoshop

    The problems of GPU, GPU Photoshop Troubleshooting FAQ

    Please post on the Adobe Forums

    Let us know if this helps

    ~ Assani

  • Wait for the entry?

    Hi all

    I need to create a custom entry dialog box and the problem I encountered is that I can't figure out how to make my request to wait for the user to complete the entries in the framework. When you use a JDialog or JOptionPane application will stop running and wait for the dialog box to close. My question is how to do something similar without using a JOptionPane or JDialog. I just can't figure out how to get the same effect by using a JFrame or other component. I know I could just use a JDialog or JOptionPane to get input from the user, but I'm just curious to know how I can stop running and wait for the entry as the JOptionPane allows you to do, but without using a JOptionPane or JDialog.

    Thank you for your help :)
    Nathan D.

    -----
    : Edit:
    I forgot to mention that the reason main I avoids JDialogs is I need the entry dialog box to be internal not external application I use mode exclusive fullscreen. And a JOptionPane does not allow me to add the other components too it such as JLabels and other GUI. I just need a way to get input from a component or internal window and wait for the entry as a JOptionPane or JDialog.
    -----

    A NBS are:

    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    
    
    
    public class Main extends JFrame implements ActionListener {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            new Main();
        }
    
    
        JButton go = new JButton("Show custom input dialog");
    
        public Main() {
            setSize(300,150);
            setLocationRelativeTo(null);
            setLayout(new FlowLayout());
            go.addActionListener(this);
            add(go);
            setVisible(true);
        }
    
        public void actionPerformed(ActionEvent e) {
            InputDialog d = new InputDialog();
    
            /*
             * Here is the problem it is necessary that I create a
             * custom input dialog to allow further modifications however
             * i'm not sure how to wait for the user to enter text and press
             * continue in that input dialog. Unlike JOptionPane the code executes
             * before the user presses continue. My question is how do I wait for the user
             * to press continue in the InputDialog before I call d.getString(); without making the main
             * application unresponsive.
             */
    
            String returnValue = d.getString();
            System.out.println("return value "+returnValue); //will be null or empty because application doesn't wait for input.
        }
    
    
        class InputDialog extends JFrame implements ActionListener {
            JTextField f = new JTextField();
            JButton go = new JButton("Continue");
    
            public InputDialog() {
                setTitle("Custom Input Dialog");
                setSize(300,150);
                setLocationRelativeTo(null);
                setLayout(new FlowLayout());
                f.setPreferredSize(new Dimension(100,25));
                go.addActionListener(this);
                add(f);
                add(go);
                setVisible(true);
            }
    
            public void actionPerformed(ActionEvent e) {
    
            }
    
            public String getString() {
                return f.getText();
            }
        }
    }
    Published by: neptune692 on January 3, 2011 13:25

    neptune692 wrote:
    .. a JOptionPane does not allow me to add the other components too it such as JLabels and other GUI. ..

    Of course, it does!

    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    
    public class DumbNameMain extends JFrame implements ActionListener {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            new DumbNameMain();
        }
    
        JButton go = new JButton("Show custom input dialog");
    
        public DumbNameMain() {
            setSize(300,150);
            setLocationRelativeTo(null);
            setLayout(new FlowLayout());
            go.addActionListener(this);
            add(go);
            setVisible(true);
        }
    
        public void actionPerformed(ActionEvent e) {
            JTextField f = new JTextField(10);
            JButton go = new JButton("Continue");
            JPanel p = new JPanel(new FlowLayout());
            p.add(f);
            p.add(go);
            JOptionPane.showMessageDialog( this, p );
    
            String returnValue = f.getText();
            System.out.println("return value "+returnValue);
        }
    }
    
  • Ive been waiting for 20 minutes waiting for the consultant to apple. Must be a lot of problems apple these days

    Ive been waiting for 20 minutes waiting for the consultant to apple. Must be a lot of problems apple these days

    A twenty minute wait is not at all unusual.

  • Looking for a Boolean function similar to or, but do not wait for the second entry in case he gets a 'real' a single entry

    my program works in 2 processes in parallel inside a while loop and should stop when one of them ends.

    How can I do? Uses the function 'Or' wire loop the stop condition will not do the job, waiting for the two processes to give their comments before running.

    What I really need is a function that waits until she gets a 'true' through one of its entry and then executes without waiting than the other.

    Y at - it such an option?

    If not, does anyone have an idea how to achieve what I have described here?

    Thanks in advance!

    What you need is a "not synchronous or", i.e. "do something if Item 1 becomes real GOLD point 2 becomes true.  One way that comes to mind to do is with a design of producer/consumer model (event), where the consumer is a State Machine with a shutdown state.  Get 1 point to trigger an event (perhaps using a user event or property Value Change (follow the signs)) when it turns out true, and have it send to the consumer the Stop State.  Download point 2, to do the same thing.  Now one of them becoming true will cause the shutdown state be registered (without taking care of doing the other element), in other words, that becomes a real, (consumer) loop stops.

    Bob Schor

  • Delay (30000 milliseconds) waiting for the SNMP service to communicate.

    When I start the SNMP service in Windows Server 2003 Enterprise 64-bit (SP2), the event ID 7009 (Timeout (30000 milliseconds) waiting for the SNMP service to communicate.), kindly help me to solve this problem.

    Hello

    Note that your computer is under domain, you must contact the TechNet forum, where we are the support technicians who are well equipped with knowledge on the issues of domain, do please visit the link provided below.

    http://social.technet.Microsoft.com/forums/en-us/winserverfiles/threads

  • remote desktop hang at 'Please wait for the system event notification' during logoff

    When I disconnect a remote connection, sometimes the GET logoff screen stuck at "Please wait for the system event notification" next time I try to open a session.
    This can also happen if that I disconnect the user, but the user seems to weigh on this same screen as well.

    There is a particular difficulty for this?  I can connect as long as administrator to another account, I can't kill connection attached somehow to be registered in the next time?

    Thank you

    Hello

    I suggest you to take a look at the answer in this thread and check if it helps.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-security/Sens-could-not-connect-to-the-system-event/4e5a04e9-88f8-4017-9416-2ca67c5ce7c5

    Hope this helps,

  • When I turn my laptop I have wait for the screen to come, or I have to wait for it to connect to the internet, what I do for this

    I have a computer gateway laptop and when I turn it on, I have to either wait for the screen to appear or for my laptop to connect to internet, I tried several different things, and none of them seem to work.before id turn on my laptop and within seconds it would connect, now it seems that it takes forever to connect. Thank you

    Hello

    1. any hardware or software changes made recently before the problem?

    I suggest that you follow all the steps in this article to resolve the problem.

    Optimize Windows Vista for better performance
    http://Windows.Microsoft.com/en-us/Windows-Vista/optimize-Windows-Vista-for-better-performance

  • Please wait for the customer to political group - stop questions

    Hello

    I have problems with the closing of a machine. When the machine is connected to the corporate network, everything works fine. However, if the computer is connected to the VPN (1 hour or more) it is always suspended when it stops. First step in the shutdown process is:

    Please wait for the system event Notification service.

    This change after 3 minutes exactly. Next step:

    Please wait for Group Policy client windows 7

    is never exceeded (even after a few hours). Machine never off.

    Under newspapers there are always these 4 events when the machine stops in vain:

    1. 6005: the winlogon notification subscriber takes a long time to handle the notification event (Logoff).
    2. 4627: the event COM + a system expired attempt to fire the method of logging on the event {D5978650-5B9F-11D1-8DD2-00AA004ABD5E} class for the Publisher and the Subscriber.  The Subscriber has not responded within 180 seconds. The full name of the subscription is "ISensLogon2". The HRESULT is 80010002
    3. 6006: the winlogon notification subscriber took 180 second (s) to handle the notification event (Logoff).
    4. 6005: the winlogon notification subscriber takes a long time to handle the notification event (Logoff).

    Sense has expired after 3 minutes while there is no event 6006 for GPClient and machine is stuck there for centuries (Please wait for the customer to group policy). I noticed in the system logs that before the machine hangs during the shutdown process there are these errors and warnings:

    • 5783: the session configuration for the Windows NT or Windows 2000 Domain Controller \\server for the domain X is not admissible.  The current CPP of Netlogon call on \\machine to \\server was canceled.
    • 1014: name resolution for the name of the server has expired after none of the configured DNS servers answered.
    • 131: NtpClient could not set a domain peer to use as a source of time due to the DNS resolution error on ". NtpClient will try again in 3473457 minutes and double the reattempt interval thereafter. The error was: the requested name is valid, but no data of the requested type was found. (0x80072AFC).

    There is more than 1014 events for different servers and some 131. 5783 is always alone.

    I did a group policy log, because I thought that I will be able to see where the machine stuck. Below you can see the part of the newspaper GPSVC when the machine stops in vain:

    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xe58
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancellation pending appeals
    GPSVC (2d4.1cfc) 21:31:24:327 Client_CompleteNotificationCall: failed with 0x71a
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancelled waiting for calls
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (438.1a04) 21:31:24:327 waiting for user group wire political end.
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xe10
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancellation pending appeals
    GPSVC (218.C88) 21:31:24:327 Client_CompleteNotificationCall: failed with 0 x 525
    GPSVC (2d4.1cfc) 21:31:24:327 Client_CompleteNotificationCall: failed with 0x71a
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: cancelled waiting for calls
    GPSVC (2d4.9C8) 21:31:24:327 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xdcc
    GPSVC (218.1054) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0x20cc
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.9C8) 21:31:24:327 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::UnregisterNotification: incoming with the event 0xd90
    GPSVC (218.1054) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:327 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (2d4.1cfc) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (218.D48) 21:31:24:342 Client_CompleteNotificationCall: failed with 0 x 525
    GPSVC (218.D48) 21:31:24:342 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (218.1c04) 21:31:24:327 Client_CompleteNotificationCall: failed with 0 x 525
    GPSVC (218.1c04) 21:31:24:342 CGPNotify::OnNotificationTriggered: Completenotification failed with 1317
    GPSVC (218.1054) 21:31:24:342 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: entering with the event 0 x 2100
    GPSVC (218.1054) 21:31:24:342 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: entering with the event 0 x 1264
    GPSVC (218.1054) 21:31:24:342 CGPNotify::AbortAsyncRegistration: No asynchronous recording is in progress
    GPSVC (218.1054) 21:31:24:342 CGPNotify::UnregisterNotification: dating dwStatus = 0 x 0

    I excluded 1 GP machine and left on the VPN for a few hours, several times. He always stopped correctly.

    However I tried with the VPN disconnection before turning off the machine, I even turned off WiFi but machine still hanging. If I tried to get GP results it takes ages before stopping the machine and he's stuck in the step "to get the user name. Gpupdate/force will never update policy (it stops at policy update...). I tired with the installation of different patches that has not solved the problem.

    I think that there is that DNS issues while the machine is on VPN which led the GP cannot be applied. When the machine tries to close it is always somehow connected. There is no problem with the connection, no GP application script when the user disconnects, not roaming profiles.

    Does anyone have the same problems? All machines are Dell with Juniper NC (VPN).

    Thank you

    Hello

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

    TechNet forum: For Windows 7 

    Hope this information helps.

  • Make a phone call by program - the wait for the user to input?

    Hello

    I use the following code to place a phone call from my application:

    Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, new PhoneArguments(PhoneArguments.ARG_CALL, phoneNumber));
    

    and it seems to work, at least in the Simulator.  However, when this line running the Simulator dials the number immediately.  Peux-I rather the phone displays the number and wait that the user press 'call '?

    I know that I can warn the user with Dialog.ask (...), and if it's the only thing to do I will do.  I'm just curious to know if I can get the phone to do so.

    arkadyz wrote: instead can have the phone displays the number and wait that the user press 'call '?

    No, this is not currently supported.  You can use a dialog box inside your own application as you describe.

  • BlackBerry Q10 in waiting for the new Q10 hit sprint but what will happen to my email?

    Currently, I am waiting for the new Q10 hit sprint.  but I hear that I have will no longer be able to use my email with the new blackberry blackberry.net.  I currently use it as my email address.  1 it's true they won't E-mail blackberry and if so what steps do I need to take to make a smooth transition?

    1. Yes, the blackberry.net email is no longer available... and quite honestly, in my opinion, it's a good thing. Blackberry.net email is not available elsewhere ON your BlackBerry, you can view it on the handheld device itself and no backup otherwise. Get a free gmail, yahoo or Outlook.com account.

    2. read this: Article ID: KB33260 (hosted) BlackBerry e-mail address reference for BlackBerry OS 10

    Then, create and start using another free email account now. When you finally go to the thread at BlackBerry10, you will have your solution in place for shipping the blackberry.net email account.

  • waiting for the task to the end host window.

    My computer startrd to show, when I restart or shutdown windows 7, I get a message saying that windows is waiting for the task host window to end what it means...?

    Hi Sanaaalsadouni,

    Thanks for posting your question in the Microsoft Community forums.

    The TASKHOST is a generic process, which acts as a host for the processes that are running DLL instead of exe files. Up TASKHOST checks the part Services of the registry to construct a list of services focused on the DLLS it needs to load, then load them.

    I suggest you try the procedure described in the article and see if it helps.

    Why my computer won't turn on or off quickly?
    http://Windows.Microsoft.com/en-us/Windows7/why-wont-my-computer-turn-on-or-off-quickly

    See the article for more information.

    See details about your computer's performance using Task Manager
    http://Windows.Microsoft.com/en-us/Windows7/see-details-about-your-computers-performance-using-Task-Manager

    Hope this information helps you. If you need additional help or information on Windows, I'll be happy to help you.

  • new SSD HP Pavilion HPE win 7 home Premium Error: Driver_Power_State_Failure Bluescreen from 30 to 45 minutes waiting for the stop down.

    Hello all, there

    I recently installed a new SSD in a HP Pavilion HPE with windows 7 Home premium. After this event I get bluescreen Driver_Power_State_Failure after about 30-45 minutes waiting for the computer to stop. I have a minidump file if this will be useful and I would be very grateful if someone could help me solve this problem :D

    Minidump: http://www.mediafire.com/?hy7so6n9af5f73v

    I hope this helps and all support is most appreciated!

    The tihub3.sys seems to be in question:

    BUCKET_ID: X64_0x9F_3_POWER_DOWN_IMAGE_tihub3.sys

    The tihub3.sys, which is dated January 14, 2011, is a Texas Instruments USB 3.0 driver so try to update this driver by installing the next update:

    http://h10025.www1.HP.com/ewfrf/WC/softwareDownloadIndex?softwareitem=CP-108667-1&CC=UK&DLC=en&LC=en&os=4063&Product=5144370&sw_lang=

  • A timeout occurred while waiting for the host controller EHCI interrupt on answer Async ahead Bell.

    Whenever I put my adapter wireless netgear n150 under heavy load (download of World of Warcraft for example), it will go down to connection and until I restart the computer the adapter usb port is useless.  I dug into the event viewer and found that a timeout occurred while waiting for the EHCI host controller interrupt on the asynchronous response advance doorbell, source usbehci.  This seems to have been a problem with windows 8 I found other threads referencing but I can say that they are pre-release and some actually work solutions have been validated.  I already assured that all drivers, firmware and chipsets are up-to-date and compatible.  ANYONE please help?

    Quick fix I found:

    -try falling back to WiFi G rather than use N
    In my case, it works... is no longer a fall. But not the same bandwidth...

Maybe you are looking for