Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:41:53+00:00 2026-06-14T00:41:53+00:00

I have a touch problem. I have some word sprites, and I bind the

  • 0

I have a touch problem. I have some word sprites, and I bind the touch event (below) to them.
After I touch one of them a few times consecutively and them want to drag, firstly the touch event does not respond, but if I wait a second then I can drag. In the LogCat I get this:

12-28 17:23:58.979: V/AndEngine(23295): org.andengine.util.adt.pool.PoolUpdateHandler$1 was exhausted, with 1 item not yet recycled. Allocated 1 more.

How do I fix this problem?

Here is the touch event code:

public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY)
{
    switch(pSceneTouchEvent.getAction()) {
        case TouchEvent.ACTION_DOWN:
            this.mGrabbed = true;
            break;

        case TouchEvent.ACTION_MOVE:
            if(this.mGrabbed)
                this.setPosition(pSceneTouchEvent.getX() - 18, pSceneTouchEvent.getY() - 15);
            break;

        case TouchEvent.ACTION_UP:
            if(this.mGrabbed)
            {
                this.mGrabbed = false;
                boolean found = false;
                float x1,x2,y1,y2;
                if(this.getY() < 350)
                {
                    for(int i = 0; i < positions_list.size(); i++)
                    {
                        if((word_object_list.get(a).getName().equals(positions_list.get(i).getName())) && positions_list.get(i).isFree())
                        {
                            x1 = word_object_list.get(a).getSprite().getX();
                            y1 = word_object_list.get(a).getSprite().getY();
                            x2 = positions_list.get(i).getxPosition();
                            y2 = positions_list.get(i).getyPosition();
                            x1 = Math.abs(x2-x1);
                            y1 = Math.abs(y2-y1);
                            x1 = (float) Math.pow(x1,2);
                            y1 = (float) Math.pow(y1, 2);
                            x1 = x1+y1;
                            x1 = (float) Math.sqrt(x1);
                            if(x1 < 20)
                            {
                                // Set hint's visibility false
                                if(i == 0 && sprite_word_hint_1 != null)
                                    sprite_word_hint_1.setVisible(false);
                                if(i == random_hint_position && sprite_word_hint_2 != null)
                                    sprite_word_hint_2.setVisible(false);

                                word_object_list.get(a).getSprite().setVisible(false);
                                sprite_word_true_list.get(i).setVisible(true);
                                sprite_candy_list.get(finish_state).setVisible(true);
                                finish_state ++;

                                if(finish_state == question.getWord().length())
                                {
                                    // Create new scene
                                    Game_Screen.this.getEngine().registerUpdateHandler(new TimerHandler(6.5f, new ITimerCallback() {
                                        public void onTimePassed(TimerHandler pTimerHandler) {
                                            // TODO Auto-generated method stub

                                            Game_Screen.this.getEngine().setScene(load_new_scene());
                                            remove_textures();
                                        }
                                    }));

                                    // Increase point
                                    Game_Screen.this.getEngine().registerUpdateHandler(new TimerHandler(4.3f, new ITimerCallback() {
                                        public void onTimePassed(TimerHandler pTimerHandler) {
                                            // TODO Auto-generated method stub
                                            int point = variables.getDatabase().get_point(variables.getCategory_level())+question.getWord().length();
                                            elapsedText.setText(""+point);
                                            variables.getDatabase().set_answered(question);
                                            variables.getDatabase().update_user(question, question.getWord().length(), hint_used);
                                        }
                                    }));

                                    // Cover animation
                                    sprite_cover.setRotationCenter(sprite_cover.getRotationCenterX()+20, sprite_cover.getRotationCenterY());
                                    sprite_cover.registerEntityModifier(new SequenceEntityModifier(
                                            new DelayModifier(1),
                                            new RotationModifier(1.5f, 0, 90),
                                            new DelayModifier(1.7f),
                                            new RotationModifier(1, 90, -0)
                                        )
                                    );
                                    // Candy animation
                                    for(int j = 0; j < sprite_candy_list.size(); j++)
                                    {
                                        sprite_candy_list.get(j).registerEntityModifier(new SequenceEntityModifier(
                                                new DelayModifier(2.7f),
                                                new CubicBezierCurveMoveModifier( 1.5f,  sprite_candy_list.get(j).getX(), sprite_candy_list.get(j).getY(),  165, 240, 166, 241, 275, 400, EaseQuadIn.getInstance()),
                                                new DelayModifier(0.2f),
                                                new AlphaModifier(1, 1, 0)
                                                )
                                        );
                                    }
                                }
                                positions_list.get(i).setFree(false);
                                found = true;
                                break;
                            }
                        }
                    }
                }
                if(!found)
                {
                    word_object_list.get(a).getSprite().registerEntityModifier(new MoveModifier(1, word_object_list.get(a).getSprite().getX(), word_object_list.get(a).getPositionX(), word_object_list.get(a).getSprite().getY(), word_object_list.get(a).getPositionY(),EaseQuadIn.getInstance()));
                }
            }
            break;

    }
    return true;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:41:54+00:00Added an answer on June 14, 2026 at 12:41 am

    I found the answer. When I touch the sprite multiple times, every time it registers an entity modifier and the stack is growing, I should wait until it is empty. Then I added the

    this.clearEntityModifiers();
    

    function call to the beginning of the touch event, and it works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written the code shown below. my problem is that I can't touch
I have some problem with a touchend event on iOS: var target; window.addEvent('domready', function(){
I have a problem with an list-component on the sencha touch 2 framework. My
I have an strange problem with sencha touch. Changing the value in the select
Have spend quite some time to learn Sencha touch, just like an evaluation about
I have some problems with OnTouchListener . I want that everytime when user touch
I have a problem and I hope one of you can suggest a better
I'm using the LUA middleclass library now after some problems and I have a
I have folowing problem. I got 2 views in my project,one is created programmicaly
Really been struggling with this one for some time now, i have many text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.