Null object reference when instantiating ContextViewListenerConfig upon Configuring ContextView

walpolea's Avatar

walpolea

15 Jul, 2013 09:51 PM

I'm trying to set up a very simple RL2 application. I have extensively sought out the example pages and 3rd-party application examples and have followed them to the T, yet I continue to get:

34 INFO Context-0-16 Context-0-16 Initializing... 41 DEBUG Context-0-16 [object StageObserverExtension] Creating genuine StageObserver Singleton 42 DEBUG Context-0-16 [object ConfigManager] Now initializing. Instantiating config class [class ContextViewListenerConfig] TypeError: Error #1009: Cannot access a property or method of a null object reference. at robotlegs.bender.extensions.contextView::ContextViewListenerConfig/configure() at robotlegs.bender.framework.impl::ConfigManager/processClass() at robotlegs.bender.framework.impl::ConfigManager/processQueue() at robotlegs.bender.framework.impl::ConfigManager/initialize() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at robotlegs.bender.framework.impl::Lifecycle/dispatchEvent() at robotlegs.bender.framework.impl::LifecycleTransition/dispatch() at MethodInfo-199() at global/robotlegs.bender.framework.impl::safelyCallBack() at MessageRunner/next() at MessageRunner/run() at robotlegs.bender.framework.impl::MessageDispatcher/dispatchMessage() at robotlegs.bender.framework.impl::LifecycleTransition/enter() at robotlegs.bender.framework.impl::Lifecycle/initialize() at robotlegs.bender.framework.impl::Context/initialize() at robotlegs.bender.extensions.contextView::StageSyncExtension/initializeContext() at robotlegs.bender.extensions.contextView::StageSyncExtension/handleContextView() at ObjectHandler/handle() at robotlegs.bender.framework.impl::ObjectProcessor/processObject() at robotlegs.bender.framework.impl::ConfigManager/addConfig() at robotlegs.bender.framework.impl::Context/configure() at MyGame/initContext() at MyGame() 43 INFO Context-0-16 Context-0-16 Initialize complete STARTUP 43 DEBUG Context-0-16 [object StageCrawlerExtension] ViewManager is installed. Checking for managed containers...

MyGame.as (Document Class)
` package {

import robotlegs.bender.bundles.mvcs.MVCSBundle;
import robotlegs.bender.extensions.signalCommandMap.SignalCommandMapExtension;
import com.andrewwalpole.towerwars.config.GameConfig;
import robotlegs.bender.extensions.contextView.ContextView;
import flash.display.Sprite;
import robotlegs.bender.framework.api.IContext;
import robotlegs.bender.framework.impl.Context;

public class MyGame extends Sprite {

    private var _context:IContext;

    public function MyGame() {

        super();
        initContext();
    }

    private function initContext():void {

        _context = new Context();
        _context.afterInitializing( startup );
        _context.install(MVCSBundle, SignalCommandMapExtension );
        _context.configure(GameConfig);
        _context.configure(new ContextView( this ));

    }

    private function startup():void
    {
        trace("STARTUP");
    }
}

} `

You can see I'm trying to use SignalCommandMapExtension, but even when removing it this continues to happen, same with turning GameConfig.as into an empty shell. Any insight would be appreciated.

  1. Support Staff 1 Posted by Shaun Smith on 15 Jul, 2013 10:00 PM

    Shaun Smith's Avatar

    Hi. Are you compiling with the Flash IDE? Are you building using the RL2 source, or the SWC?

  2. 2 Posted by walpolea on 15 Jul, 2013 10:02 PM

    walpolea's Avatar

    I'm using the Flash Pro IDE. The fla is linked up with the SWC. Same result across Flash Pro CS5.5, CS6 and CC.

  3. 3 Posted by walpolea on 15 Jul, 2013 10:05 PM

    walpolea's Avatar

    Thanks!! ... your prodding question led me to the right answer. I just didn't have the right info to search for:

    http://knowledge.robotlegs.org/discussions/questions/1254-robotlegs...

    Publish Settings > Check Publish SWC

  4. Support Staff 4 Posted by Shaun Smith on 15 Jul, 2013 10:08 PM

    Shaun Smith's Avatar

    Excellent! Also, this led to an idea that should help in the future... so, thank you :)

  5. walpolea closed this discussion on 16 Jul, 2013 03:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac