Say I have a parent- and a child-object. At some point a variable (boolean) in the child changes and the parent needs to notice. Now, is it performance-wise cheaper to let the child dispatch an event once the variable has changed, or to have the parent check this childs variable every frame in an already existing enterFrameEventHandler?
dispatchEvent or checking variable every frame? What's better in a simple parent-child-relationship?
243 Views Asked by Reign_of_Light At
1
There are 1 best solutions below
Related Questions in ACTIONSCRIPT-3
- [Actionscript]How to display the information inside an array of objects
- How to set a colour variable in JS
- When using INSERT OR REPLACE INTO in SQL is there any way to tell if a record was inserted as new or replaced in SQL for AS3?
- How to inject a bean in a view with Crux
- AS3 - Unable to resize Image width and height
- How do I move Pac-Man smoothly in AS3?
- Export Release Build is not working in Adobe Flash Builder, It does nothing on Finish button
- 1009 Error for a Character Skin Symbol in AS3
- Issue setting domain memory
- Implicit coercion of a value with static type Object to a possibly unrelated type Number
- Defer implementation of interface functions to child class
- Simple top 3 scores from an array to textfield
- Need ActionScript 3 coding for input boxes that will determine amount of color fill in a movieclip
- AS3 Caling MC on Parent Timeline from Child
- 2 error problems for simple music players
Related Questions in EVENTS
- Stop propagation of javasript/leaflet click event that starts in one element and ends in another
- Detecting click inside and outside of the listening component in Angular
- How to use mocha unit test chokidar watch events
- writing event_management in unity
- Where to put event handler method of an inherited class in C++ Builder?
- Event_date reference in CTE
- WinForms, event unable to subscribe from a custom class
- How to intercept a request made by a form submit in JavaScript?
- Communicating from Parent to Child in Blazor
- How to Customize Sitecore Copy operation
- grand parent is handling custom event emitted instead of parent in Angular 17
- jquery not capturing all input value changes
- Is there a way to force the focus on a determined window tab?
- How to watch user browsing activity from a background service?
- Trigger Once in React native
Related Questions in EVENT-DISPATCHING
- Where should I locate an Event Listener? Basics of OOP
- Create a symfony console command and DI (autowiring) of service in the command
- is there any java code for queue based on due date priority dispatching rule (EDD)? and how?
- C++ Event Dispatcher - callback casting problem
- TYPO3 EventDispatcherInterface
- Reliable Webhook dispatching system
- Javascript - Dispatch event to all objects in a set
- javascript add Single Event Lister for multiple events like ajax function callbacks succss, fail etc
- Dispatching drag-end event
- Dispatch event from custom objects in JavaScript
- When should I switch from Symfony EventDispatcher to RabbitMQ (any *MQ library)?
- JavaFX - StackPane with Pane as EventDispatcher
- How can I trigger click event of LinearLayout when I click on a EditText in it?
- can the three.js EventDispatcher be used to communicate between classes?
- How to set event handlers in a compact form in Symfony?
Related Questions in ENTERFRAMEEVENT
- Making a DragDrop class on as3
- AS3 - How to stop player when touching object using hitTestObject?
- How to stop a Movie Clip from Moving Diagonal?
- Movie Clip Object adding Multiple Times with Enter_Frame Event
- Can't make MovieClip in function dissapear
- ENTER_FRAME Event not working correctly with MouseEvent As3
- Can the ENTER_FRAME event be missed or received delayed by the listener?
- Is ENTER_FRAME dispatched at the end of vertical blanking signal or at the start of window?
- AS3 - Movie Clip animations (undesirably) bob up and down. [Playable SWF included]
- AS3 - Friction(?) causing Movie Clip to jump, temporarily alter path (playable SWF included)
- AS3 Make a Movieclip vanish when left alone for a certain duration
- How do I run code inside an event function for an ENTER_FRAME listener that does not run once every frame?
- AS3 Countdown Timer experiences extreme framerate loss over time
- in AS3, removeEventListener(Event.ENTER_FRAME) is not working
- Screen Scrolling not working for Right and Bottom edges AS3
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It is right. Event over loop check. But event better would be a callback. The event generation is heavy. If your variable or whatever changes quite often, then you would create a new Event instance every time a change happens.
Rob Penner wrode the library signals because of this problem:
https://github.com/robertpenner/as3-signals