Skip to main content
Inspiring
October 7, 2009
Answered

Get Current Controller index of blinking cursor in textflow.flowcomposer ???

  • October 7, 2009
  • 1 reply
  • 878 views

Hi,

I have 10 controllers in my TextFlow and now i want to get index of controller where my cursor is blinking. i found the following function but here i don't know container having blinking cursor.

textFlow.flowComposer.getControllerIndex(controller);

Thanks

This topic has been closed for replies.
Correct answer robin_briggs

What you need to do is to get the location of the cursor from the interactionManager:

var pos:int = textFlow.interactionManager.absoluteStart;

and pass it to the flowComposer to get the controller:

var controllerIndex:int = textFlow.flowComposer.findControllerIndexAtPosition(pos);


var controller:ContainerController = textFlow.flowComposer.getControllerAt(controllerIndex);

Something like that should get you what you need.

- robin

1 reply

robin_briggsCorrect answer
Adobe Employee
October 9, 2009

What you need to do is to get the location of the cursor from the interactionManager:

var pos:int = textFlow.interactionManager.absoluteStart;

and pass it to the flowComposer to get the controller:

var controllerIndex:int = textFlow.flowComposer.findControllerIndexAtPosition(pos);


var controller:ContainerController = textFlow.flowComposer.getControllerAt(controllerIndex);

Something like that should get you what you need.

- robin

chicflashAuthor
Inspiring
October 9, 2009

Thanks a lot robbin.