Interval race condition - AS3 bug??

I have included the output and the two code segments that
trigger the output. I do not understand how this could happen.
Trace shows that clearInterval(19) occurs yet Wakeup seems to
trigger spontaneously still trying to clearInterval(19). This
occurs when user strums keypad triggering multiple calls to
KeyDownFunc. You can execute this code yourself by selecting
Lesson1 on page 1 of ItOnlyTakes1.org. It takes a few strumming
tries to trigger it but the following code demonstrates what is
happening within. Need help. (Interesting to note that 16 was never
cleared.)
Following code triggers the generation of a new display which
requires a user answer to be caught in KeyDownFunc. sleepID is a
global variable.
private function WakeUp():void {
clearInterval(sleepID);
trace("Wakeup calling: Cleared " + sleepID);
NewNumber();
Internal part of KeyDownFunc that calls WakeUp to trigger new
problem. The sleep interval is the time needed for the user to view
the correct answer was given BEFORE triggering a new WakeUP and
thus a new number
if (answer.length == subquanAnswer.length) {
if (answer == subquanAnswer && answerSign ==
subquanAnswerSign ) {
soundOutChannel = answerSound.play();
sleepID = setInterval(WakeUp, 1000);
trace("Call Wakeup: answer is " + answer + " " +
subquanAnswer + " New sleepID: " + sleepID);
gradeText.text=" CORRECT";
gradeText.setTextFormat(correctanswerformat);
} else {
gradeText.text=" INCORRECT";
gradeText.setTextFormat(incorrectanswerformat);
Output showing problem:
introListener calling
Call Wakeup: answer is 7 7 New sleepID: 2
Wakeup calling: Cleared 2
Call Wakeup: answer is 7 7 New sleepID: 4
Wakeup calling: Cleared 4
Call Wakeup: answer is 7 7 New sleepID: 6
Wakeup calling: Cleared 6
Call Wakeup: answer is 4 4 New sleepID: 8
Wakeup calling: Cleared 8
Call Wakeup: answer is 4 4 New sleepID: 10
Wakeup calling: Cleared 10
Call Wakeup: answer is 9 9 New sleepID: 12
Wakeup calling: Cleared 12
Call Wakeup: answer is 9 9 New sleepID: 14
Wakeup calling: Cleared 14
Call Wakeup: answer is 4 4 New sleepID: 16
Call Wakeup: answer is 4 4 New sleepID: 17
Wakeup calling: Cleared 17
Call Wakeup: answer is 6 6 New sleepID: 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19
Wakeup calling: Cleared 19

To all,
I understand the insistence to clear before setting, but I
have not figured out how to get clearing and setting into the same
function. I am currently using a flag to avoid the race condition
that my code, not AS3, has created. This is what I am rethinking.
My current flow is like this.
1) generate a NewNumber()
2) check keys until correct number entered using KeyEvent.
Then set an interval to wait until the student has had time to
consider the correctness of this answer and to play the audio
feedback.
3) Interval timeout triggers WakeUp which clears the interval
then generates a NewNumber.
Only problem was, kids kept entering keys AFTER they had
answered correctly which, before my using a flag, was triggering
new setIntervals and the problem above.
I do not see how I can have my KeyEvent handler clear the
interval or how I can have my WakeUp functions set the interval.
They are two distinct functions.
If I do not clear the interval in WakeUp a long delay in
answering will trigger another NewNumber.
If I set it in WakeUp then I don't give the student enough
time to answer.
If I do not set it in keydown then I don't know how to ensure
they have time to see and hear the feedback
I can't clear it in KeyDownFunc because the kid may not push
a key and allow WakeUP to create a NewNumber()
I hope my brain isn't frying.
I do appreciate the continued effort in helping me and help
on this forum has improved my coding almost as much as if I had
someone watching over my shoulder. LOL, that would be
instantaneous.

Similar Messages

  • [svn:bz-trunk] 21111: Bug: BLZ-578 - [Coverity] potential race condition for class flex.messaging.MessageBroker

    Revision: 21111
    Revision: 21111
    Author:   [email protected]
    Date:     2011-04-21 06:12:37 -0700 (Thu, 21 Apr 2011)
    Log Message:
    Bug: BLZ-578 - potential race condition for class flex.messaging.MessageBroker
    QA: Yes
    Doc: No
    Details: The bug was fixed by change 19598 already, but also adding a minor fix to not call setSystemSettings in initThreadLocal method becuase there are no thread local variables in MessageBroker anymore.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-578
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/MessageBroker.java

  • [svn:bz-trunk] 18839: bug fix BLZ-575 Potential race condition in flex. management.runtime.messaging.endpoints.EndpointControl

    Revision: 18839
    Revision: 18839
    Author:   [email protected]
    Date:     2010-11-29 12:26:32 -0800 (Mon, 29 Nov 2010)
    Log Message:
    bug fix BLZ-575 Potential race condition in flex.management.runtime.messaging.endpoints.EndpointControl
    Change a few counters to Atomic numbers
    Probably solve some PMD bugs too (was complaining about new Integer() and new Long() API)
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-575
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointContro l.java

  • Forms 6 CPU racing (not race condition)

    Hello Everybody,
    I am having a strange problem that I was not able to find anything about in the other posings. Hoping somebody can point me to some helpful info or posings.
    Here is what is going on:
    I have Oracle 8i installed on an Intel P4 testing platform along with Forms 6.0.5. The machine is equiped with enough memory and power that Forms and Oracle 8i should be able to run without any trouble (I have run this setup fine on less powerful machines).
    When I then run a Forms application in the new setup the Forms application starts up normally and appears to be running perfectly.
    However when I look at the Windows Task Manager the Forms application turns out to be racing the processor at 100% of capacity. Even some little tiny forms application with only one Canvas and 2 blocks still causes the CPU to race at 100% capacity - even when I am not running a query! It just sits there and revs the CPU.
    Even stranger when I put the input focus onto any other program (NotePad for instance) the CPU cycles die back to zero again. But when I again put the focus (using ALT-TAB or something) back onto the Forms application the CPU starts revving up again.
    Note that this is NOT a "race condition" because I am still able to use the computer and even the Forms application itself. However it is NOT normal for a little tiny Forms module to be able to take up 100% of CPU cycles even when the module is not doing anything.
    Anybody have any ideas what the problem could be?
    Thanks for any help.
    Chris

    Chris,
    if it doesn't hang the computer as it indicates then maybe the task manager does not show what's really consumed by Forms. Ig Forms 6.0 is the cause then I suggest to upgrade to Forms 6i as this is tested and bug fixed with newer OS and processors.
    Frank

  • [svn:fx-trunk] 12795: Resolving race condition with interdependent Group properies alpha and blendMode .

    Revision: 12795
    Revision: 12795
    Author:   [email protected]
    Date:     2009-12-10 09:56:11 -0800 (Thu, 10 Dec 2009)
    Log Message:
    Resolving race condition with interdependent Group properies alpha and blendMode.
    QE notes: None
    Doc notes: None
    Bugs: SDK-24636
    Reviewer: Deepa
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24636
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as

  • [svn:bz-trunk] 19214: BLZ-578 - [Coverity] potential race condition for class flex.messaging.MessageBroker

    Revision: 19214
    Revision: 19214
    Author:   [email protected]
    Date:     2010-12-09 07:31:35 -0800 (Thu, 09 Dec 2010)
    Log Message:
    BLZ-578 - potential race condition for class flex.messaging.MessageBroker
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: MessageBroker had a thread-local SystemSettings property in addition to regular SystemSettings property. This was due to MessageBroker#getSystemSettings static method that was called only once in the whole code tree. Once I removed the need for this static method, I could get rid of the thread-local SystemSettings property.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-578
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/FlexContext.java
        blazeds/trunk/modules/core/src/flex/messaging/MessageBroker.java
        blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerServlet.java
        blazeds/trunk/modules/core/src/flex/messaging/MessageException.java

  • EMET 5.0 Group Policy Settings Ignored (Probable race condition with Policy application)

    In our deployment, EMET 5 seems to be ignoring group policy settings from immediately after the first group policy refresh post-boot.
    Settings are being applied to the computer correctly, and are appearing in the registry correctly, and on boot, a set of Event ID 50 events are logged containing ConfigAppmitGPO (and similar for the other settings) elements with the correct settings.
    Upon the first group policy refresh, further eventID 50 events are logged, with empty ConfigAppmitGPO elements.
    Investigation with Process Monitor seems to indicate this is a race condition between Group Policy Registry settings being refreshed (which deletes the entries) and the EMET service reading out these settings from the registry (which appears to be triggered
    by Group Policy application or by a notification on the registry keys themselves)
    This is reproducible on Windows 7 and Windows 8.1.
    Is there any way to arrange for settings to be applied correctly at all times, or is this a bug that will need to be fixed in a future update?

    We're experiencing the exact same behavior currently. I was starting to think I was going crazy. Glad to know others are experiencing the same behavior.
    I've found that using the method from pervious versions to read and update settings from Group Policy, using "emet_conf.exe --refresh" still works, and upon every execution, the event log shows the GPO settings being read and applied. While I welcome the
    move to have EMET update from GPO settings without requiring running a separate task, as it stands now in its current condition, it is a step back.
    Scott Ladewig http://www.ladewig.com

  • Race conditions - can you actually lose the data in memory?

    I've seen posts where a race condition can actually destroy the contents of a global memory. I understand about not getting the right information if your read just beats your write, but can it actually lose the data altogether? This would mean you have to semaphore every time you write to a global if you have something polling on it to guarantee the data doesn't get lost. I've never seen this in any example programs - its hard to believe!

    I think the idea is merely that when you write to a global (or any)
    variable the previous contents are overwritten. If you intended to read the
    global before the write but the write ends up happening first then you lose.
    "mikema111" wrote in message
    news:[email protected]..
    > I've seen posts where a race condition can actually destroy the
    > contents of a global memory. I understand about not getting the right
    > information if your read just beats your write, but can it actually
    > lose the data altogether? This would mean you have to semaphore every
    > time you write to a global if you have something polling on it to
    > guarantee the data doesn't get lost. I've never seen this in any
    > example programs - its hard to be
    lieve!

  • How to prevent race conditions in a web application?

    Consider an e-commerce site, where Alice and Bob are both editing the product listings. Alice is improving descriptions, while Bob is updating prices. They start editing the Acme Wonder Widget at the same time. Bob finishes first and saves the product with
    the new price. Alice takes a bit longer to update the description, and when she finishes, she saves the product with her new description. Unfortunately, she also overwrites the price with the old price, which was not intended.
    In my experience, these issues are extremely common in web apps. Some software (e.g. wiki software) does have protection against this - usually the second save fails with "the page was updated while you were editing". But most web sites do not
    have this protection.
    It's worth noting that the controller methods are thread-safe in themselves. Usually they use database transactions, which make them safe in the sense that if Alice and Bob try to save at the precise same moment, it won't cause corruption. The race condition
    arises from Alice or Bob having stale data in their browser.
    How can we prevent such race conditions? In particular, I'd like to know:
    What techniques can be used? e.g. tracking the time of last change. What are the pros and cons of each.
    What is a helpful user experience?
    What frameworks have this protection built in?

    Hi,
    >> Consider an e-commerce site, where Alice and Bob are both editing the product listings. Alice is improving descriptions, while Bob is updating
    prices. They start editing the Acme Wonder Widget at the same time. Bob finishes first and saves the product with the new price. Alice takes a bit longer to update the description, and when she finishes, she saves the product with her new description. Unfortunately,
    she also overwrites the price with the old price, which was not intended.
    This is a classic question that you can find in any developing exam :-)
    there are several options according the behavior that fit your needs, and several points that need to be taken into consideration.
    1.  Using locking in the application side, you can make sure that two people do not open the same product for editing. this is in most cases the best option.
    * I am not talking about
    thread-safe but the implementation is almost the same. The locking can be done using singleton class and have a static boolean element. Every time a user want to edit we check this value as first action. If the value is false then we lock the and
    change it to true -> do what ever we need -> change the value to false -> unlock.
    Behavior: First person that try to edit lock the product and the second get a message that this product is unders editing. In this case you do not open connection to database and your application prevent any problem.
    2. Using "read your writes", as mentioned
    Behavior: this mean that several people can open the same product for editing, and only when they try to send it to server they get a message telling them that they have waist their
    time and someone else already change the product information. At this point they have two option: (1) overwrite what the other person did, (2) start from the beginning.
    This is the way most WIKI websites work.
    3. Using real-time web functionality like SignalR, WebSocket, or any streaming for example. In this case you can send the person that work on the edit a message like "this product have already been edit" and stop give him the extra time to
    think what you want to do. You will need to use one of the above option maybe, but since the user get the information in real time he have time to chose.
    4. Using "Change before Write" or "read before edit": The idea is to have a column that point if the row is in use. the type of this column should be same as the user unique column type. Before the user start you check the value
    of this column. If it is 0 then you change it to the user unique value (for example user_id), If the value was not 0 then you know that someone else is editing the product. In this case the locking is managed in the database. make sure that you work with transactions
    while reading the value and changing it! you can change the default from share lock to X lock as well during this action, if you really want.
    There are several other option, if those do not fits your needs
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Custom Tag in race condition with OC4J v9.0.2.0.0...

    Hello all,
    (I tried deploying my application with OC4J 9.0.3 but none of my existing
    tags worked)
    I developed a OC4J web application implementing my own tag library extension
    and found out that there was occurring a race condition to the fact that two
    users (different sessions) where accessing the same
    tag at the same time. In the offending tag implementation I only have
    instance members and not static which could also cause a
    concurrent access problem.
    I found that OC4J was reusing concurrently the same
    Tag instance when it should not do that!!!
    public class pagesIteratorTag extends BodyTagSupport {
    // only instance class members...
    public void doInitBody() throws JspException {
    System.out.println("pageSetIteratorTag::doInitBody - Tag instance value: " + this.toString() + " for user: " + this.pageContext.getSession().getAttribute("j_username"));
    public int doAfterBody() throws JspException {           
    System.out.println("pageSetIteratorTag::doAfterBody - Tag instance value: " + this.toString() + " for user: " + this.pageContext.getSession().getAttribute("j_username"));
    Note the pagesIteratorTag@2e same instance is used when it should not
    1 because the tag instance should be protected from multiple concurrent
    access even though it can be pooled and reused if it is free.
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Frank
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Frank
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    Session for user Frank throws a null pointer exception because Giovanni's session
    started accessing the variable.
    Can anyone advise please?
    Best Regards,
    Giovanni

    First of all, you said none of your tags worked in 9.0.3. What happened? Did you do any debugging of the problem?
    Comparing the "toString()" output of your tag does not guarantee they are the same instance. That is just the output of "hashcode()", not the "pointer" to the object. The hashcode is generated from the contents of the object, not its "identity".
    I suggest you track the NPE in the debugger and get more information before you assume the container is at fault (which is still an outside possibility). SDK API Javadoc
    Object class:
    The general contract of hashCode is:
    1-. Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
    So, the toString() is properly returning the suffix of the object instance
    number unique for that instance and is then being reused by OC4J even though
    it is being accessed from another session thread, that must not happen and it
    is not compliant with the JSP spec.
    The other history is that when I implemented my custom tags OC4J was JSP 1.1 compliant
    and not 1.2, so after moving to 1.2 the scripting variables can be defined in XML and
    by subclassing TagInfo class, the last option doesn't work with OC4J 9.0.3, not good...
    Thanks for your help,
    I will keep trying to figure out what the problem migth be,
    Best Regards,
    Giovanni

  • 8.1.2 "Could not launch" message: race condition at startup

    (apologies for the cross-post; someone suggested that I post this in the Unix forum, so here it is -- I suppose it would have made sense to do this in the first place, I mustn't have been concentrating :-)
    Hi,
    I've recently upgraded our Sun Ray servers to Adobe Reader 8.1.2, and now every so often when browsing to a pdf document, Firefox says
    "Could not launch Adobe Reader 8.1.2. Please make sure it exists in your PATH [...]"
    This seems to be caused by a race condition at startup. The browser plugin runs "/bin/acroread -version", which simply echoes the version number and exits. When it's working, this happens:
    25436: write(1, " 8 . 1 . 2\n", 6) = 6
    25348/1: read(56, " 8 . 1 . 2\n", 20) = 6
    25436: _exit(0)
    25348/1: close(56) = 0
    i.e. the string is written by the script and immediately read by the browser.
    However, occasionally this happens:
    23119: write(1, " 8 . 1 . 2\n", 6) = 6
    23119: _exit(0)
    23008/1: Received signal #18, SIGCLD, in read() [caught]
    23008/1: siginfo: SIGCLD CLD_EXITED pid=23119 status=0x0000
    23008/1: read(58, 0xFFBFB5C0, 20) Err#4 EINTR
    i.e. the read() call is interrupted by the SIGCLD generated by the exiting /bin/acroread process.
    I've inserted a "sleep 5" after line 11 of the /bin/acroread script to try to alleviate this, but I haven't tested it fully.

    Hello Ian,
    Thanks for reporting this. We will try to address this issue in the next release as you have stated a valid race condition issue (though it's difficult to reproduce).
    Gaurav

  • Array Of Clusters Not Initializing or Possible Race Conditions

    Hi all,
    I've been working on a fairly complex project for work, and I haven't worked with Labview before. Unfortunately nobody in my office really has experience with it so I'm on my own. I've mostly got the project working, and it might be a little cumbersome, but if it works that's fine.
    Essentially it's a temperature control device and I made it so it's expandable, thus the clusters and arrays everywhere.
    My question is this. I've got an array of clusters indicating the status of all the plates in the system. When I start up the VI for the first time they do not initialize. They just stay grey, but when I stop it and start it once, it will work every time. I think this is kind of strange behavior. I've heard of race conditions and while I've tried to make sure t hat's not happening, it might be without me noticing.
    I've tried putting an initialize array block in the first call while loop and that doesn't do anything, and if I remove the initializer from the shift register in the top while loop that stops them being initalized altogether.
    I guess I was hoping someone might have an idea what's causing it, or could possible give my code the once over. The main bulk of it is in the very top of the code, but there are a lot of smaller events taking care of GUI type stuff.
    I've included all source code. It might be a little much but I didn't want to start pulling it apart if I don't know what's happening.
    Thanks in advance.
    Chris.
    Solved!
    Go to Solution.
    Attachments:
    Error During Cycle Controls.zip ‏3107 KB
    Stop Cycle Controls.zip ‏2115 KB
    Stop Cycle Controls.zip ‏4975 KB

    Chris Johnson wrote:
    So just to confirm, I can have one event structure with say 10 events happening? In this case could an event happen simultaneously with another? I thought I read something about each event having it's own event structure and while loop to make sure this works out.
    Each event case must complete before it can handle the next event, but many events will complete so quickly that this is not an issue (such as your "pause chart" button).  In general you should have only one event loop.  If you expect an event to take a long time to process, use a queue to hand that task off to another dedicated-purpose loop, so that the event structure can go back to waiting.  This is one example of the producer-consumer structure often mentioned on this forum: the producer is the loop containing the event structure, and it queues (produces) items to process.  A separate loop dequeues (consumes) those items and handles them appropriately.
    As GerdW mentioned, you have race conditions all over the place.  You'll never know whether the Plate Info Cluster Array is properly updated because it's being written and read simultaneously in so many places.  I'm assuming that is also where you're seeing the issue that inspired the post, and, in fact, one of those race conditions could explain what you're seeing.
    Chris Johnson wrote:
    Also, again, to confirm what I think I already know. When the event completes it outputs whatever data you output from the structure and then you can place it in a shift register. Where does this go until the next event takes place?
    I don't understand what you're asking.  Where does what go until the next event?  If by this you mean the data in the shift register - it stays in the shift register, accessible at the corresponding terminal on the left side of the loop.

  • Race condition?? javax.faces.el.PropertyNotFoundException: Error testing pr

    Hi All,
    I created a SelectOneChoice using data control (via a Session Facade) on a page. It works fine. (say includePage.jspx)
    Then I try to include this page into other pages say mainPage.jspx (after change the tag from view to subview in includePage.jspx). I need to do this include because multiple pages will include this page.
    Now when I try to run mainPage.jspx, I have the following exception:
    javax.faces.el.PropertyNotFoundException: Error testing property 'inputValue' >>>in bean of type nullThe bean in this exception message is referring to something defined in the includePage.jspx page def file, but I am running mainPage.jspx - so I am wondering if this is a sort of race condition, i.e when mainPage.jspx is ruuning, no variables inside includePage.jspx page def can be accessed.
    I searched the forum but did not have much luck. Any suggestions will be greatly appreciated!!!

    Hi,
    any binding used on a subview must be included in the binding of the main page. So your mainPage.jspx must include the binding for the listbox.
    In 10.1.3 there is no option to inherit the binding container content of an included page.
    Frank

  • What is dead locks with oracle and wht is race condition wrt oracle

    what is dead locks with oracle and wht is race condition wrt oracle

    > And do you know what a race condition is all about?
    It is a term used to indicate several processes attempting to use the same resource that is not capable of servicing all these at the same time. This could be due to the resource not being thread safe or implemented as a serialised resource.
    It is often easy to look up definitions on Google. In the Google search field, type "define:race condition".
    The following [url http://www.google.co.za/search?hl=en&q=define%3Arace+condition&btnG=Google+Search&meta=]web definitions page is displayed.

  • Verified AS3 bugs

    I found another serious AS 3 bug so i decided to write up a
    verification script so anyone can verify these bugs and hopefully
    someone over at adobe can squash them, as they are quite annoying
    and require a considerable amount of effort to work around.
    The first bug is a dynamically generated movieclip that has
    various UI components to it will report its height incorrectly but
    will display correctly
    The second bug is when a combobox has its value changed it
    generates a change event but for some reason, its parent
    displayobject does not detect the event.
    My project deals with auto layout of several dynamically
    generated movieclips that contain dozens of comboboxes so these two
    bugs combined are really getting on my nerves.
    The code to reproduce these bugs is below. Just copy and
    paste in a Flash IDE, add the combobox, checkbox and radiobutton
    componets to the FLA's library and launch. I had a screen shot of
    the height i measured with photoshop but doesn't look I can attach
    it. At any rate, flash outputs 174 and i measured 99 for a
    difference of 75.
    -------------------------------Sample Code
    Begin------------------------------------
    //omnidogg - Jan 18,2008
    //Code to illustrate 2 AS3 bugs
    // 1. ComboBox change event does bubble up to parent
    displayobject container
    // 2. Dynamically sized movieclip's height property displays
    correctly but the value returned from a get operation is incorrect
    // just copy and paste into Flash IDE.
    //import needed classes for example
    import fl.controls.CheckBox;
    import fl.controls.ComboBox;
    import fl.controls.RadioButton;
    import fl.controls.RadioButtonGroup;
    //create a empty movie that will be the parent display
    object, set backgroud to green, put around middle of stage
    var mc1:MovieClip = new MovieClip();
    this.stage.addChild(mc1);
    mc1.opaqueBackground = 0x00FF00;
    mc1.x = 50;
    mc1.y = 60;
    //create a combobox and add it to mc1. Add two choices to
    illustrate change event bubbling bug.
    //changing value in combo box generates an event but mc1 does
    not detect it.
    var cb1:ComboBox = new ComboBox();
    mc1.cb1 = mc1.addChild(cb1);
    mc1.cb1.x = 220;
    mc1.cb1.y = 30;
    mc1.cb1.addItem({label:"Choice 1"});
    mc1.cb1.addItem({label:"Choice 2"});
    //add a checkbox to mc1. This component behaves as expected.
    var chkb1:CheckBox = new CheckBox();
    chkb1.name = "chkb1";
    mc1.chkb1 = mc1.addChild(chkb1);
    mc1.chkb1.x = 220;
    mc1.chkb1.y = mc1.cb1.y + mc1.cb1.height + 10;
    mc1.chkb1.label = "Toggle";
    //add two radio buttons in default radiobuttongroup to mc1.
    selecting a new value generates 3 change events. I expected 2, 1
    for each radiobutton.
    //3rd from the radiobutton group? at least something is
    generated which is better than nothing
    var rb1:RadioButton = new RadioButton();
    mc1.rb1 = mc1.addChild(rb1);
    mc1.rb1.x = 180;
    mc1.rb1.y = mc1.chkb1.y + mc1.chkb1.height + 20;
    mc1.rb1.label = "Choice 1";
    var rb2:RadioButton = new RadioButton();
    mc1.rb2 = mc1.addChild(rb2);
    mc1.rb2.x = 260;
    mc1.rb2.y = mc1.chkb1.y + mc1.chkb1.height + 20;
    mc1.rb2.label = "Choice 2";
    //add a event listener to mc1 to detect any change events
    mc1.addEventListener(Event.CHANGE,traceChange);
    //trace the given text when a change event occurs
    function traceChange(event:Event):void
    trace("Change Event Detected");
    //trace height of movie clip with various UI components
    placed in it
    trace(mc1.height); //outputs 174, measurements from photoshop
    indicate 99. I can send a screenshot to anyone interested.
    -------------------------------Sample Code
    End--------------------------------------
    Of course if these have already been found and squashed,
    someone please point to me to the proper resources; seaches of the
    knowledgebase don't turn up any revelant info.
    Thanks

    The incorrect height value you're getting is a timing issue.
    Each these
    components has a TextField somewhere in its heirarchy, which
    is initialized
    at 100x100. The resizing of the TextField doesn't occur until
    after you've
    checked the height of the container MovieClip.
    If you listen for Event.ENTER_FRAME, you'll find that the
    correct value is
    returned once the component is fully rendered. In my test,
    the correct value
    was available on the 2nd ENTER_FRAME.
    Try this:
    this.addEventListener(Event.ADDED, _handler);
    this.addEventListener(Event.ADDED_TO_STAGE, _handler);
    this.addEventListener(Event.RENDER, _handler);
    this.addEventListener(Event.ENTER_FRAME, _efhandler);
    function _handler(event:Event)
    trace(event.type, event.target, mc1.height)
    var efcount:uint=0;
    function _efhandler(event:Event)
    efcount++;
    trace(event.type, event.target, mc1.height)
    if(efcount > 5) // i use 5, but can be fewer
    this.removeEventListener(Event.ENTER_FRAME, _efhandler);

Maybe you are looking for

  • Update Termination Error while modifying PO in ME22n

    Hi All, I am facing one problem,while modifying the PO using ME22n.After modifying the PO when I save it ,Express Document "update was terminated" error comes. Can anybody please guide me on this, why it is happening .It's very urgent. Thanks in adva

  • I cant receive international messages on my e63

    please help me find out what could be the problem with my messaging.i cannot receive international messages on my e63 but i can send international messages. I can receive local and send local plus international but i cant receive international messag

  • Cs6 error on startup: missing msvcp110.dll (Nik/Google plugins)

    I am getting msvcp110.dll is missing on startup of cs6. Photoshop online help was no joy

  • RAISE A HOME-MADE EXCEPTION

    Hi All I have written a RFC. I have a input as a char(25). I would like to raise an exception with <error message> + <input> for instance ERROR IN THE STRING <INPUT STRING> How can I do ? Thanks for your help Jerome

  • Security check before displaying data in SXMB_MONI tcode

    Hi All,    I need help in integrating a security check before displaying the archived data when we execute SXMB_MONI tcode. Only authorized person can view the archived HR related data . My analysis-There is no BADI or user exit to include a code to