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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:08:56+00:00 2026-06-09T10:08:56+00:00

In the Scroller.as class line 2139 I’m getting the following error: TypeError: Error #1009:

  • 0

In the Scroller.as class line 2139 I’m getting the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at spark.components::Scroller/focusInHandler()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:2139]
    at flash.display::Stage/set focus()

From Scroller.as

/**
 *  @private 
 *  Listens for any focusIn events from descendants 
 */ 
override protected function focusInHandler(event:FocusEvent):void
{
    super.focusInHandler(event);

    // When we gain focus, make sure the focused element is visible
    if (viewport && ensureElementIsVisibleForSoftKeyboard)
    {
        var elt:IVisualElement = focusManager.getFocus() as IVisualElement; 
        lastFocusedElement = elt;
    }
}

Since this is framework code what option do I have to prevent it?

Context
I have created a pop up TitleWindow, added a Module in it and displayed it. The Module has a few States, in each State is a Group, one Group has a List, that List has an ItemRenderer, that ItemRenderer has a Checkbox.

The Module also has a Menu. When the Menu is opened the menu pop up lists the states the Module has available. When an item is selected from the menu pop up I change to another state.

When the state is changed and the last item is the checkbox then the error is generated. At least that’s what I think is happening. I deduced this because in the Scroller class the handler is handling an event. On that event is the current target. That current target is the checkbox.

Update – Steps to reproduce

// inside the Application.mxml
// define variables
public var popup:Group;
public var titleWindow:TitleWindow;


// shows pop up
public function showInspector():void {

    // inside show inspector method
    // create new inspector container
    popup = new InspectorContainer(); // a group implements="mx.managers.IFocusManagerContainer"
    titleWindow = new TitleWindow();
    titleWindow.addElement(popup);

    // display pop up title window
    PopUpManager.addPopUp(titleWindow, this, false);
}

<fx:Declarations>
    <modules:InspectorContainer/>
</fx:Declarations>
  1. Show pop up. The pop up is a Title Window with InspectorContainer (a group) as the first element.

  2. In pop up change from home state (default state) to online state (this happens when the user clicks a button). The online state has a List. The List has an itemrenderer. The itemrenderer has a checkbox. Select the checkbox. So far so good.

  3. The pop up (InspectorContainer) has a mx:MenuBar instance. When you click on an item in the menubar the menubar displays a menu items.

  4. Click an item in the menu list. The itemClick menuHandler is called. In this function the pop up changes state.

This is when the error occurs.

  • 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-09T10:09:00+00:00Added an answer on June 9, 2026 at 10:09 am

    Here’s the full code:

    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                xmlns:s="library://ns.adobe.com/flex/spark" 
                xmlns:mx="library://ns.adobe.com/flex/mx" 
                autoDrawBackground="true"
                width="100%"
                implements="mx.managers.IFocusManagerContainer">
    
        <fx:Script>
        <![CDATA[
            public function get defaultButton():IFlexDisplayObject {
                return null;
            }
    
            public function set defaultButton(value:IFlexDisplayObject):void {
                // do nothing
            }
    
            override public function get systemManager():ISystemManager {
                return null;
            }
        ]]>
        </fx:Script>
    
        <!-- other stuff -->
    
        <s:CheckBox id="enabledCheckbox" />
    
    </s:ItemRenderer>
    

    The solution was to implement the IFocusManagerContainer or basically the function it needed. In my case I had to override the systemManager getter in the container of the target object (component) of the focus event in the Scroller focusInHandler handler.

    I figured it out this way. The error occurs in the Scroller focusInHandler. The target property of the focus event (event.target) is the Checkbox (the last item to have focus). The container of the Checkbox is my ItemRenderer. This is where I implemented the IFocusManagerContainer interface. I mention this because there are 5 or more parent levels along this path.

    In the ItemRenderer I added:

    override public function get systemManager():ISystemManager {
        return null;
    }
    

    This method is a method you have to implement when you implement the mx.managers.IFocusManagerContainer interface.

    That interface also required me to define the defaultButton getter and setter but it was not necessary to solve this error. In tests I removed the interface, removed the defaultButton members and left the systemManager getter and with just that it still solved the problem.

    Also, thanks to noobsarepeople2 for help.

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

Sidebar

Related Questions

Im using a jquery scroller for my photography website which i cannot get it
Supposed the html code is: <div class=scroller> <ul class=header-contact> <li id=header-section1 class=sectionslide><p>We offer FREE
ie. we have page with many lines of text <div class=textline id=line1>text line or
I am using scroller class for auto scroll of the text in edittext but
I'm using the following class along with Mootools to create custom scrolling areas on
I have an infinite scroller for a product page which works well. For SEO
I need a jQuery scroller to scroll my divs with auto scrolling facility. I
I'm using the smooth div scroller as seen in this site: http://www.smoothdivscroll.com/ . For
I have put together an image scroller using jquery, like this function rotateImages(whichHolder, start)
I've seen Giva labs' marquee scroller and SerialScroll but can't figure out how to

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.