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?
242 Views Asked by Reign_of_Light At
1
There are 1 best solutions below
Related Questions in ACTIONSCRIPT-3
- How to create an ActionScript 3.0 in Flash to display Current Date, Time and Day of Week
- textinput.needsSoftKeyboard does not work (air for android)
- AS3 Get currentFrame of current MovieClip
- call Win32 API in flex to set Window Display Affinity
- Air Native Extensions: Released Air App w/Windows Native Extension works fine on develpment PC but not on other computers
- TestFlight API and stats with as3
- Error while using removeChild() and accessing members of array
- Flash erase image with mask - gotoandplay next frame
- Adding a listener to a VerticalScrollBar in flex
- AS3 array to clean up long code?
- AS3 - How can objects that appear randomly never touch each other?
- import a sound externally or from the library? AS3
- Nesting Asynchronous Promises in ActionScript
- AS3 - How can multiple objects that appear randomly NEVER touch each other?
- ActionScript + Ruby
Related Questions in EVENTS
- OpenLayer 3: Map pointer up event can not be triggered when the map created on overlay
- Angular scroll directive
- Setting multiple events in one ext.net button
- Detect if Application was suspended in OnNavigatedFrom for Windows Phone 8
- When in click a radio button, it scroll to the top. How to prenvent that?
- Event subscribed but null in child class (after threads initialize)
- How to get results each sec from "perf stat -d sleep 1000"
- How to register event for TextBox end editing
- Stop the installshield installation if a file is not found in vb.net
- How to capture the next event based on a condition
- Flask server to notify webclient when changes occur
- Google analytics event tracking, retrieve results
- What is the correct way to code event handlers for serializable model objects?
- Android version of NSNotificationCenter (event binding)
- Center JoptionPaneMessageDialog in parent element of the source element that generated the event
Related Questions in EVENT-DISPATCHING
- Exception occurred during event dispatching:java.lang.ClassCastException in a JRE 1.4 Environment
- AWT-EventQueue-1 on JList
- Flex Event Dispatching
- Raising noncustom events in ActionScript 3
- I want to use Symfony EventDispatcher in Zend Framework 1.11
- handling swing exceptions in scala application
- Fix an unresponsive GUI due to JTextArea?
- Append to JTextArea
- New JFrame with new thread
- Dispatching event for specific component only in java
- Is it possible to listen the event triggered by another class?
- javascript add Single Event Lister for multiple events like ajax function callbacks succss, fail etc
- C++ Event Dispatcher - callback casting problem
- Attaching a property to an event in Flex/AS3
- Swing Worker Modal Dialog Won't Close
Related Questions in ENTERFRAMEEVENT
- AS3: Delay Enter Frame Animation
- in AS3, removeEventListener(Event.ENTER_FRAME) is not working
- How do I run code inside an event function for an ENTER_FRAME listener that does not run once every frame?
- AS3 - stop onEnterFrame Function from constantly running
- Enter Frame does not detect hitTestObject precisely when tweenling
- Is there an equivalent of EnterFrame event in Expression Blend/WPF, If not how do we get around it?
- A loop in enterframe?
- Screen Scrolling not working for Right and Bottom edges AS3
- check keyboard state without using KeyboardEvent in AS3
- Why EnterFrame occurs before refreshing the screen in Flash
- How can I specify ENTER_FRAME so that the object enters on every 4th frame?
- AS3 Make a Movieclip vanish when left alone for a certain duration
- ENTER FRAME stops working without error
- Which Is More Efficient, Embeddeing an FLV or Compiling an FLV to a SWF and Loading it Dynamically?
- Movie Clip Object adding Multiple Times with Enter_Frame Event
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 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