Touch event works outside the buttons

Hello

I'm developng a touch phone application and type. Now on a single screen of the application, there are 3 buttons. Is the screenshot below:

Here if I touch three-button, it works. But if I touch outside the buttons, we hear in the bar at the top or in the bottom bar, then touch event also works. Suppose that in the bottom, add more button is focused. So if I touch on the lower bar, then also touch button works correctly. To resolve this problem, I wrote the code below:

try {
            int touchXPos = event.getX(1);
            int touchYPos = event.getY(1);
            int addBtnXPos = btnAddMore.getLeft();
            int saveBtnXPos = btnSave.getLeft();
            int helpBtnXpos = btnHelp.getLeft();

            int vfmTitleTouch = m_vfmTitle.getHeight();

if ((touchXPos >= addBtnXPos + 40) && (touchXPos <= (addBtnXPos + btnAddMore.getWidth() + 40)) && (touchYPos <= screenHeight -10) && (touchYPos >= (screenHeight -10 - btnAddMore.getHeight()))  /*&& (touchYPos < (screenHeight-gmYPos)) */)
            {
                Logger.out("touchEvent", "------------------------------1");
                showPopUp();
                return true;
            }

            else if ((touchXPos >= saveBtnXPos + 40) && (touchXPos <= (saveBtnXPos + 40 + btnSave.getWidth())) && (touchYPos <= screenHeight -10) && (touchYPos >= (screenHeight -10 - btnSave.getHeight()))/* && (touchYPos < (screenHeight-gmYPos))*/ )
            {
                Logger.out("touchEvent", "------------------------------2");
                saveToDb();
                return true;
            }

            else if ((touchXPos >= helpBtnXpos) && (touchXPos <= (helpBtnXpos + btnHelp.getWidth())) && (touchYPos <= (btnHelp.getTop() + btnHelp.getHeight())) && (touchYPos >= btnHelp.getTop())/* && (touchYPos < (screenHeight-gmYPos))*/ )
            {
                Logger.out("touchEvent", "------------------------------3");
                UiApplication.getUiApplication().pushScreen(new HelpScreen());
                return true;
            }
            else if ((touchYPos <= screenHeight - hfmBtn.getHeight()) && (touchYPos >= (vfmTitleTouch)))
            {
                Logger.out("touchEvent", "------------------------------4");
//              Logger.out("touchEvent", "touchY::::" +touchYPos  + "Vfm Title::::" +vfmTitleTouch  + "  "+"GM Y Pos"+  gmYPos);
                return true;
            }
            else
            {
                Logger.out("touchEvent", "------------------------------5");
                return false;
            }
        }
        catch (Exception e)
        {
        }

        return super.touchEvent(event);
    }

But it does not work... Can someone help me?

And touch event should work in the middle of the screen as for the boxes also...

Thank you...

I tried this way... But it does not work. The same problem. Touch outside of the button, it works to the functionality of the button.

Tags: BlackBerry Developers

Similar Questions

  • Hi, I am not able to execute the procedure using dblink in PLSql block. Although he works outside the end of the beginning. Please suggest solution

    Hello

    I'm not able to execute the procedure using dblink in PLSql block.

    Although he works outside the end of the beginning.

    Please suggest solution

    Hello

    Thanks everone for your contributions,

    As well as the permissions, I used to run inside the PL sql block, which was not necessary, we can simply call the procedure using dblink.

    Thanks guys,.

  • Will be CC allowed to work outside the country of origin?

    I am a photographer who often works outside the country.  If I'm forced to use this creative cloud licenses, it will be a problem, try to activate again if I am out of the country, in that it was initially activated?  In addition, he reactivate if I'm in a country that is not supported by creative cloud?

    I use a number of other licenses based cloud services and this has been a real problem for me.

    Hi there, what we have heard you should be able to travel with your membership creative cloud without problems.

  • Is it possible to call a sub procedure event from outside the process?

    Hi all

    I was wandering if it is possible to activate a sub-process of event (started by an event message that is implemented by a 'set interface') by calling interface that seems exposed as a service?

    Or the sub-process of event can be triggered only by an activity that is executed in the same process, where is the event sub-process?

    Hi Clarec,

    If you expose your subprocess of event with an event of boot Message and you have to use a correlation set in the main part of the process, you can call it from outside the process by using the correlation key.

    Dan

  • AS3 stops working if the button text is changed

    I have a text button work perfectly positioned within a clip and called from the main time line.

    So I decided to add a color changing effect on the up state of the button. Originally, button had a static text for the Up, Dow, on, periods of success. As soon as I changed the text in an mc, I get an error code:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    to acolyte24A_fla::mainsite_mc_2/frame30() [acolyte24A_fla.mainsite_mc_2::frame30:4]

    This is line 4 of 30 frame:

    HowTo_maininfo_mc. HowTo_jtv4u_link_btn.addEventListener (MouseEvent.CLICK, onClick_openJTV);

    "HowTo_jtv4u_link_btn" is the button in question. It worked fine until I changed the State noted in a MC.

    What is the appropriate steps to change a button in this way?

    Obviously, something you do by adding a movieclip is breaking the button somehow... but what something is is not clear.  What you could try to do... instead of using a SimpleButton control, create the button as a movieclip.

    Looking at the code you showed above, you seem to try to tell the button go to frames specific... you don't do that when you use a symbol of SimpleButton... they do so on their own without the need of any coding on your part.  The code you showed would be easier to apply to a movieclip used as a button.  Maybe it is involved with the error you get... try to treat the button as a movieclip.

  • Aspire 5738z motherboard works outside the laptop breaks but not?

    Hope this is the right part of these forums...

    Someone at - he heard of this before. (STUPIDLY), I decided that my fan needed a good, clean, and in a moment of madness I removed the heatsink and cleaned, I have had no paste to renew with at the time but thought it would be ok.

    Acer Aspire 5738Z dedicated ATI Graphics Intel Core 2 Duo

    I missed the fan plug when I re assembled the laptop and of course, it wouldn't start. So after back by getting the cleaners and stick and PLUG the fan, I tried to start again... Nothing to do apart from the fan works and stops, then comes back on - the power light lights up - the processor lights up for a second - and the cd tried to run.

    I did all the usual like removing the Ram etc Hold button power and did so on... still no joy

    So I stripped the motherboard into the case and everything took off, I have replaced the following only

    HARD DRIVE

    1 x 2 GB Ram

    Monitor

    Battery

    And success, that it starts without a problem

    I tried then restarts and they were very good, so I put everything together and nothing only happened?...

    So I stripped it again and this time I plugged everything

    HARD DRIVE

    2 x 2 GB Ram

    CD/DVD

    Monitor

    Battery

    WiFi

    USB mouse

    USB keyboard

    Began and once again without any problem she started and restarted a time without end. So I removed all and placed in the base of the case and then reconnected everything and got the same good boot. I then placed the upper part of the base on so he was running and it was fine, then I rebuilt around the laptop running until the unit was together again... Always slept running. Although my mousepad not working keyboard

    OK, the moment of truth... Restart... or rather not - back to the beginning with no boot

    Does anyone have any idea as to the cause - I wonder if the keyboard or mouse may be at fault, but as far as I know, it could be more sinister.

    Any help would be fantastic - but please no suggestions to remove the ram and pressing the power button down as my finger no headache trying this lol

    It seems to me the connection of the USB unit on the side of right which is at fault. I have rebuilt the laptop but removed the USB cable and it works fine... Looks so much like problem solved for the moment in any case

  • My mouse works but the button to click on an element. It is moblemouse3500 of Microsoft

    I have a moble mouse Microsoft 3500 it works except when I try and click on something. Ive downloaded the right soft ware, but this still does not work.

    Hi RichardHoofard,

    -How long have you had this problem?

    Follow the steps listed in the article mentioned below to solve the problem:

    The problems with the mouse button or scroll the parameters

    If the steps mentioned in the article above does not solve the problem, Uninstall and reinstall the IntelliPoint software from the link below:

    Microsoft mouse and keyboard hardware - software to download

  • Actions will not work on the buttons

    recently updated for flash 8 from flash mx 2004, and I can't do other buttons load a URL, or reply to all.
    We'll find the site I work on here.. I add
    {We (Release)}
    getURL ("url", "window")
    }
    as always, still nothing.
    Help, please.

    I got it, I didn't know that you had to place the action in each keyframe. I feel stupid.

  • Equium A100 - 02K seems to work outside the screen

    Hello

    Laptop starts and seems to run off the screen. If the screen opens more than about 50 degrees, then there is no display. If the screen is open less than 50 degrees, it works fine.
    Any ideas?

    Thank you

    > If the screen is open less than 50 degrees, it works fine.

    Could be a connection problem. Maybe the cable or the FL inverter is loose.
    It of difficult to say and, therefore, the laptop must be verified by a Toshiba technician who is responsible for your country

  • Under XP, my monitor said work outside the scope of the analysis and to change the setting of the pc

    Black, computer work, monitors do not have a wireless. cable monitor only and put in place.

    I'm sure this means that your computer is set to a resolution that your monitor cannot display.
    When you start your computer, you should be able to hit F8 and select an option to run the computer in 800 x 600, which of course, your monitor should be able to support, and then you can replace it for a better resolution.

  • my world event working on the Simulator, but not on the device

    Hi guys,.

    I'm using BB bold 9000. I have attached directly to the device and debugging. I'm getting "background switch detected for myapp (261) that does NOT have the tunnels open - defocus is NOT called" on the device debugging. but it works fine on the Simulator (my ultimate task is slaughtering an application from another application) any idea?

    Thank you

    Thank you guys, it's worked.

  • Satellite A660 - touch pad / stop and other buttons do not work

    Dear people on this forum,

    Recently, about 3 weeks ago, I turned on my computer and I cleaned out the dust because it was overheating.

    about 2 weeks before, I noticed that my touchpad is not working and the buttons at the top of the page do not work, there is no light (multimedia audio buttons wireless) I can't activate/deactivate or either, I don't know how. I don't know if the problem because I cleaned my laptop and has not logged a few threads back but I included this detail because I do not use these buttons if I haven't noticed if they were on. but he said: 2 days ago, I don't know how my wireless exploded Ant when I press fn + f8 (wireless) wireless communication switch is turned off, which is one of the buttons is not working (upstairs next to / switch even with my touch pad)

    I tried the following:

    Windows Update
    turn off the computer, remove all cables and battery and wait for about 30 minutes. Then then hold down the button for 30 seconds
    Reinstall the support flash cards, hw Setup utility / value pack
    and finally a Toshiba out of the recovery of the box using the recovery of 2 cd product

    I don't know what to do next. It's either:

    try something else
    or is there a wire is connected both touchpad and the buttons at the top and I have to open my laptop and connect them.

    Please answer as to my next step to get my wireless.

    Your dear member of the forums, kaujis

    Post edited by: kaujis

    Please don t get me wrong, but I don t know how to help you now. Disassembly of the laptop is to only authorized persons and if you do it on your own there is always a risk that something may be hurt or may be damaged.

    OK, I must also say that I also removed my machine too but I got lucky and everything is OK as before.
    I put t know how A660 looks inside, but the principle is still the same and I can't imagine you have whatever it is damaged.
    You know very well that we cannot say much about your problem. What you need to do now is the final test of functionality and install original recovery image that you got with your laptop. Test the functionality with the factory settings. If the problem is still there, I m afraid you must open for new laptop and check if everything is connected correctly.

    Last option is to contact the service and ask for help.

  • The button works only once?

    The problem:

    Play the animation, and after clicking the button once it no longer works. The button takes you to the frame labeled "shake". I want to continue to make you "shake" whenever he's in a hurry, but it's not.

    The installation program

    I have a button inside a clip - actually its 2 inside. The first MC crosses and stops on the stop(); framework and that you click on the button that sends the playback head to the section titled "shake" which plays the next MC with the same button inside. I put the button action on its own layer on the first image. The length of this sequence of buttons from the first keyframe of the action is the length of time to the other MC 2.

    The Code

    mcButton.shakeButton.addEventListener (MouseEvent.CLICK, onClick);

    function onClick(event:MouseEvent):void {}

    gotoAndPlay ("shake");

    }

    What I found

    I searched the forum/web and in all cases that I met the problem above the toggle button is not the length of the visible button or other event listeners are in conflict with it. I don't know if one of them is my question. For 1 length of the frame of my button is so much time to the MC, which is the total length of the main timeline. If TI where a conflicting event listener to turn off that button should not play at all, because the event even listeners play before it than those who play after him. If I'm scratching my head for a direction.

    Are the 2 above known issues I found the problem that I have or do you know if it's something else?

    Thanks in advance!

    The second mc is nowhere in sight when this code runs within the Framework 1.  If the code for frame 1 is supposed to aim at the second mc to assign an event listener, it cannot.  Either the mc must be moved when the code is or the code should run when the mc is.  If you get no error messages, I have to wonder why.

    Functions and variables can be shared spread along a timeline in how you allocate this layer, but the code that runs, like play(), stop() etc, addEventListener() when you enter a frame, it happens that within this framework and does not extend to other images.

    What you can do, is have the second mc start frame 1 and make it invisible in this framework and then more later to frame 33 visible Tower.  Otherwise, you must have the event listener for the second mc code down into the fabric of 33.

  • How the MovieClip not to block the touch events

    Hey guys,.

    I'm trying to do something that should be simple.  I have a listener to button a button, this button has a MovieClip that is located on the top, so my button below will not receive the click event of the mouse.  How can I keep the MovieClip above the button but allow the mouse click event move to the button?

    Thank you

    Assuming you named the MovieClip "myMovieClip".

    To write

    myMovieClip.mouseChildren = false;

    myMovieClip.mouseEnabled = false;

    The ClickEvent must spend in the MovieClip safe and sound.

  • update to hold outside the custom control

    Hello

    I do a custom control similar to the slider.

    When I tap on the native cursor and go out with the finger, the cursor still have the focus and therefore the handle to continue to move.

    I'd like to get this behavior with my custom control, but when I move the finger outside it, it loses focus.

    No idea how to do this?

    Thanks in advance

    resolved using TouchBehavior.

    Adding it to the root of the custom control container, it will be receive touch events also when the finger is out of the bounduaries:

    m_rootContainer->addTouchBehavior(     TouchBehavior::create()           .addTouchReaction(TouchType::Move,                                       PropagationPhase::Bubbling,                                       TouchResponse::StartTracking));
    

Maybe you are looking for