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 7999737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:35:20+00:00 2026-06-04T15:35:20+00:00

I really have tried my hardest on this little problem, its been 2 weeks

  • 0

I really have tried my hardest on this little problem, its been 2 weeks of long evenings and I know one of you more experienced AS3 developer would fix in a minute or two, well I hope.

So I have a very simple game with drag able objects that you let go of with MOUSEUP an animation plays then hits the subject and makes another animation (splat or something). With the hitTest only on one frame from inside the movie clip. (this works fine)

I am having problems removing said eventListener, I tried removing it at the end of the animation, so on the last from on the animation there would be AS saying removeEventListener from stage, but this didn’t work, so I tried removeEventListener after dynamically added the animation to the stage, still no joy.

I hoped it was something simple like- this.removeEventListener or currentTarget, but alas no.

I really can’t think of anything else,

for the love of AS please help.
An explanation would also be amazing I understand how people don’t have time so really any input would be greatly appreciated.

Below is my AS, if anyone wants to see the FLA, I can send it on, I am cool with sharing.

NB its probably quite evident I am a novice so please help me on my way….

import flash.display.MovieClip;

import flash.events.*;

var test:dart = new dart();
addChild(test);
circle.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void
{
    circle.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void
{
    circle.stopDrag();
    addEventListener(Event.ENTER_FRAME, checkIfHitTest);
    function checkIfHitTest(Event)
    {

        if (circle.hitTestObject(square))
        {
            trace("true, the circle and square are colliding");
            var s:blood_splat = new blood_splat();
            addChild(s);
            s.x = mouseX;
            s.y = mouseY;
            **removeEventListener(Event.ENTER_FRAME,checkIfHitTest);**

        }
        else
        {
            trace("false, the circle and square are not colliding");
            var s:blood_splat = new blood_splat();
            addChild(s);
            s.x = mouseX;
            s.y = mouseY;
            s.alpha = 0.1;
            **removeEventListener(Event.ENTER_FRAME,checkIfHitTest);**
        }
    }

}
  • 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-04T15:35:22+00:00Added an answer on June 4, 2026 at 3:35 pm

    just do:

    Event.currentTarget.removeEventListener(Event.type, checkIfHitTest)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error and I really dont know why. I have tried
I really have tried researching this problem, but I'm now getting so close to
Have tried to find solutions for this and can't really come up with anything.
This should be really simple, but I have tried many solutions posted on the
ive got a really weird problem. i have no clue why its not working.
This is really starting to piss me off. I feel like I have tried
I know there have been a few threads on this before, but I have
I really have not tried this, I am just curious what are the attributes
Cant get this script to work with my menu really have tried everything any
Sorry if this is really easy. But I have tried many ways to add

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.