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

  • Home
  • SEARCH
  • 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 6089109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:03:45+00:00 2026-05-23T12:03:45+00:00

In the following code, if I click on the ‘button’, all three function will

  • 0

In the following code, if I click on the ‘button’, all three function will be called.
But in all other cases, only stage event are fired.
Why the ‘sprite’ event didn’t got fired?

public class EventFlowTest extends Sprite
{
    private var button:Sprite;

    public function EventFlowTest()
    {
        addEventListener(Event.ADDED_TO_STAGE, init);

    }
    private function init(e:Event = null):void
    {
        stage.addEventListener(MouseEvent.MOUSE_DOWN,stageMouseDown,false);


        graphics.beginFill(0x11);
        graphics.drawCircle(100,100,100);
        addEventListener(MouseEvent.MOUSE_DOWN,spriteMouseDown,false);          


        button=new Sprite();
        addChild(button);

        button.graphics.beginFill(0xF1);
        button.graphics.drawCircle(100,100,10);
        button.addEventListener(MouseEvent.MOUSE_DOWN,buttonMouseDown,false);
    }

    private function spriteMouseDown(e:MouseEvent):void
    {
        trace("sprite");
    }

    private function stageMouseDown(e:MouseEvent):void
    {
        trace("stage");
    }

    private function buttonMouseDown(e:MouseEvent):void
    {
        trace("button");
    }

}
  • 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-05-23T12:03:46+00:00Added an answer on May 23, 2026 at 12:03 pm

    The explanation is “Vector graphics ignored in main class instance” (mouse interactions)
    http://books.google.ru/books?id=gUHX2fcLKxYC&lpg=PA533&ots=cvPZ0qbQv8&dq=Vector%20graphics%20ignored%20in%20main-class%20instance&pg=PA533#v=onepage&q=Vector%20graphics%20ignored%20in%20main-class%20instance&f=false

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

Sidebar

Related Questions

I have following code in button click Response.Write(window.open('Contact.aspx')); The above code is working.but if
I have the following code making a GET request on a URL: $('#searchButton').click(function() {
I have the following code: <script type=text/javascript> $(document).ready(function() { $(#Save).click(function() { $.post(url, { data:
I have the following code in my application: $(.deleteproduct).click(function() { id = this.id; alert(id:
I suppose the following code: jQuery(#mybutton).click(function(){ //do something }); How could I recall to
I have the following code: $(document.body).click(function() { $(.content).each(function(i) { $(this). }); }); How can
I have the following code for a button click on a form: private void
I have the following code which work fine: $('.ui-selectmenu-menu a').click(function() { alert('OK'); }); However,
I have the following code that responds to a button click, changes the view
I have the following code in my document ready: $('a').click(function(e) { e.preventDefault(); var $this

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.