Skip to main content
Inspiring
November 16, 2010
Answered

Error #1009 in advanceToComposeStartPosition()

  • November 16, 2010
  • 3 replies
  • 815 views

Hello!

I get this error when I try to updateAllControllers:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.compose::BaseCompose/advanceToComposeStartPosition()
at flashx.textLayout.compose::BaseCompose/composeTextFlow()
at flashx.textLayout.compose::ComposeState/composeTextFlow()
at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()
at flashx.textLayout.compose::StandardFlowComposer/internalCompose()
at flashx.textLayout.compose::StandardFlowComposer/updateToController()
at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()

Does anybody know in what direction I need to seek to correct this problem?

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer rdermer

Thanks!  FWIW the crash only appears in player 10.0.  No problem in player 10.1.

Richard

3 replies

Inspiring
November 16, 2010

Can you create an example that demonstrates the problem?

Thanks,

Richard

Inspiring
November 17, 2010

I wasn't able to get the exact same error in a small test, but managed to get a similar error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.compose::FlowComposerBase/addLine()
at flashx.textLayout.compose::ComposeState/endLine()
at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()
at flashx.textLayout.compose::BaseCompose/composeParagraphElement()
at flashx.textLayout.compose::ComposeState/composeParagraphElement()
at flashx.textLayout.compose::BaseCompose/composeBlockElement()
at flashx.textLayout.compose::BaseCompose/composeInternal()
at flashx.textLayout.compose::ComposeState/composeInternal()
at flashx.textLayout.compose::BaseCompose/composeTextFlow()
at flashx.textLayout.compose::ComposeState/composeTextFlow()
at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()
at flashx.textLayout.compose::StandardFlowComposer/internalCompose()
at flashx.textLayout.compose::StandardFlowComposer/updateToController()
at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()
at Test2()

with this test (I think it has something to do with linked containers and 'empty' control characters):

package {
import flash.display.Sprite;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.elements.ParagraphElement;
    import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.container.ScrollPolicy;

public class Test2 extends Sprite
{
  public function Test2() {
   var tekstLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
   var cs:Sprite = new Sprite();
  
   addChild(cs);

   var textFlow:TextFlow = new TextFlow();
   textFlow.format = tekstLayoutFormat;

   var tekstveldController = new ContainerController(cs, 400, 400);
   tekstveldController.verticalScrollPolicy = ScrollPolicy.OFF;
   tekstveldController.horizontalScrollPolicy = ScrollPolicy.OFF;

   textFlow.flowComposer.addController(tekstveldController);
   textFlow.flowComposer.updateAllControllers();
  
   var paragraphElement = new ParagraphElement();
   var spanElement = new SpanElement();
   spanElement.text = decodeURI("%18");
   spanElement.fontSize = 10;
   paragraphElement.addChild(spanElement);
  
   var paragraphElement2 = new ParagraphElement();
   var spanElement2 = new SpanElement();
   spanElement2.text = decodeURI("%18");
   spanElement2.fontSize = 10;
   paragraphElement2.addChild(spanElement2);
  
   textFlow.addChild(paragraphElement);
   textFlow.flowComposer.updateAllControllers();

   textFlow.addChild(paragraphElement2);

   textFlow.flowComposer.updateAllControllers();
  }
}
}

rdermerCorrect answer
Inspiring
November 17, 2010

Thanks!  FWIW the crash only appears in player 10.0.  No problem in player 10.1.

Richard