Skip to main content
Participant
October 1, 2009
Question

TextFlow and SpriteVisualElement

  • October 1, 2009
  • 1 reply
  • 639 views

Hi,

i  m trying  to  use   the spriteVisualElement for display  a textFlow, it works,  but  when i do  a selection on textFlow  i have  this  error

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

     at flashx.textLayout.edit::SelectionManager$/computeSelectionIndexInContainer()

     at flashx.textLayout.edit::SelectionManager$/http://ns.adobe.com/textLayout/internal/2008::computeSelectionIndex()

     at flashx.textLayout.edit::SelectionManager/selectionPoint()

     at flashx.textLayout.edit::SelectionManager/setNewSelectionPoint()

     at flashx.textLayout.edit::SelectionManager/handleMouseEventForSelection()

     at flashx.textLayout.edit::SelectionManager/mouseMoveHandler()

     at flashx.textLayout.container::ContainerController/mouseMoveHandler()

     at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::rootMouseMoveHandler()

and my code

var  _containerText : SpriteVisualElement = new SpriteVisualElement();     

_parent.addElement( _containerText );

                                                            

_containerText.x = 10;

_containerText.y = 10;

_containerText.width = 100;

_containerText.height = 200;

var controller:ContainerController = new ContainerController( _containerText, width , height ) ;

               


var containerFormat:TextLayoutFormat = new TextLayoutFormat();

containerFormat.paddingTop          = 0;

containerFormat.paddingRight     = 0;

containerFormat.paddingBottom     = 0;

containerFormat.paddingLeft          = 0;

containerFormat.columnCount      = 3;

//     containerFormat.columnWidth          = 10;

containerFormat.columnGap          = 10;

controller.format = containerFormat;

     

// We add the controller to the textFlowComposer

_textFlow.flowComposer.addController( controller );

// make _textFlow editable with undo

_textFlow.interactionManager = new EditManager(new UndoManager());

// compose the new textFlow and give it focus

_textFlow.flowComposer.updateAllControllers();

_textFlow.interactionManager.setFocus();

_textFlow.addEventListener(SelectionEvent.SELECTION_CHANGE, selectionChangeListener);

Regards

Stef

This topic has been closed for replies.

1 reply

Peter_deHaan
Participating Frequently
October 1, 2009

@pfff...,

Can you please file a bug at http://bugs.adobe.com/flex/ against the Flex SDK and attach the failing code, and i can make sure the bug gets sent to the TLF team for investigation.

Thanks,

Peter