TypeError: Error #1009: Cannot access a property or method of a null object reference

Hi all,

I am developing a game and i am having some issues with it and this is there error i am recieving

TypeError: Error #1009: Cannot access a property or method of a null object reference.

in file library.engine.score::CFMochiScoreSystem/initialize()

the above code in that function is this

[


private var container:DisplayObjectContainer;
		private var options:Object;
		
		public function CFMochiScoreSystem() {
			super();
			options = null;
		}
					//public function initialize() {
		public function initialize(newOptions:Object = null):void {

			trace("Options is " + newOptions);
			if (newOptions == null)
			{
				options = {positionX: 0, positionY: 0, res: "470x320", clip: MochiServices.clip};
			}
			else
			{
				options = newOptions;
			}
			container = DisplayObjectContainer(options.clip.parent);
			trace("Container is"+container);
		}
		
		public override function set boardIndex(value:uint):void {
			MochiScores.setBoardID(_boards[value]);
		}

What am i doing wrong the following code in the function b4 is this

public function setScoreboard(scoreType:uint):void {
			_scoreSystemType = scoreType;
			
			switch(_scoreSystemType)
			{
				case CFGenericMain.SCORE_MOCHILEADERBOARD_DEFAULT:
					_scoreSystem = new CFMochiScoreSystem();
					CFMochiScoreSystem(_scoreSystem).initialize();
					break;
				case CFGenericMain.SCORE_MOCHILEADERBOARD_CUSTOM:
					_scoreSystem = new MochiLeaderboard();
					MochiLeaderboard(_scoreSystem).initialize();
					break;
			}
}

How can i fix this and what can i do to fix this issue?

The problem is in initialize() and all I can see where it could be is with either MochiServices.clip or options.clip.parent being null.

http://livedocs.adobe.com/flex/201/langref/runtimeErrors.html