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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:16:30+00:00 2026-06-03T07:16:30+00:00

When a event gets dispatched on a nested child with bubbling set to true,

  • 0

When a event gets dispatched on a nested child with bubbling set to true, does the Event object itself get cloned for every display object that the event hits while ‘bubbling’ across the display stack? For example, does the Event.ENTER_FRAME event object get cloned for every display object that’s on the scene?

On a broad level, I’m trying to determine when Event.clone() occurs and where it can be a performance issues with too many event objects slowing down garbage collection.

Thanks!

  • 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-03T07:16:31+00:00Added an answer on June 3, 2026 at 7:16 am

    Simple answer, yes the event always gets cloned. See the documentation to confirm.

    My original answer was wrong. The event does not always get cloned. As @weltraumpirat pointed out, the documentation says this only happens when you manually redispatch the event. It’s impossible to know how many classes (if any) that Adobe has written do this, but it is possible that some do. Still my answer “always gets cloned” was wrong.

    However, that doesn’t mean that events are not the issue with your performance. They only get cloned if you re-dispatch an existing event, but if not, they still get dispatched as a new instance, which is exactly what the clone method is doing anyway.

    Finally, we can see in the Tamarin source code, specifically in globals.as, the implementation of the dispatchEvent method:

    public function dispatchEvent(event:Event):Boolean  {
        if (event.target && event.target!=null) {
            return dispatchEventFunction (event.clone());
        } else {
            return dispatchEventFunction (event);
        }
    }
    

    As you can see, the cloning happens here based on whether certain event properties are populated. I have not yet found the code where the target property gets populated, but at any rate there you have it. The clone method is only called where an existing event is re-dispatched (at least from what we can see). I stand corrected. 🙂

    As a side note, I think this is a major flaw in the flash player. Adobe should have made this a special case in the VM where internally, it’s just a pointer that get’s passed around instead of cloning every single time the event is needed somewhere, especially given that the base-design of the AVM2 is an event-driven system.

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

Sidebar

Related Questions

I have a MVVM application in WPF. I have an event that gets dispatched
How does a motion event gets associated with a certain view? is It the
I've set the paste event to sanitize the textarea value. It already does everything
I am trying to add calendar events with my Android applicatiom. Event gets saved
I've got a method that gets called on an event, which presents me with
I have a div positioning working which gets fired by the scroll-event. What happens
In a method that gets called frequently, like a painting event, is it more
Is there an event in WinForms that get's fired when a window is dragged?
What event is fired when Google Maps repaint itself? For example when you zoom
It seems WindowEvent.WINDOW_SHOWN never gets dispatched on any of the nodes in the scene

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.