Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-26708

Null Object Reference in UIMovieClip

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK 4.1 (Release)
    • Fix Version/s: None
    • Component/s: Flash Integration
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      This issue is very closely related to bug# SDK-24015. But instead of erroring on removeFocusListeners, it now errors on addFocusListeners. I monkey patched my distribution to include the same fix as the removeFocusListeners one which basically means wrapping the two statements that are in the try block inside of an if(stage). Below is a suggested fix for the issue.

      private function addFocusEventListeners():void
      {
      // If we get a security error because we're not allowed to add event listeners to the stage,
      // then just add them to the systemManager instead because we could be an untrusted app.

      try
      {
      if (stage)

      { stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 1, true); stage.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, false, 0, true); }

      }
      catch (err:SecurityError)

      { systemManager.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 1, true); systemManager.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, false, 0, true); }

      focusListenersAdded = true;
      }

      Steps to reproduce:
      1.I have an app that has a UIMovieClip asset on the screen which has focus. I switch to another program, and switch back at which point I get the error.

      Actual Results:
      Error: because stage is null.

      Expected Results:
      no error.

      Workaround (if any):
      see proposed fix above.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adobejira Adobe JIRA
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: