Problem in using CutOperation

Hello
I have a problem in the use of 'CutOperation' object directly. When you call the method "EditManager cutTextScrap" cut and operation works, but if I create CutOperation and run using the EditManager doOperation() then it throws exception. Can you please point out what am I doing wrong here.

Copy the following code works:
var selState:SelectionState = new SelectionState (textFlow, 5, 10);
var textScrap:TextScrap = em.cutTextScrap (selState);


This code does not work:
var selState:SelectionState = new SelectionState (textFlow, 5, 10);
var textScrap:TextScrap = new TextScrap (textFlow);
var op: CutOperation = new CutOperation (selState, textScrap);
em.doOperation (op);

Thank you
Ahmed

Try to create the TextScrap SelectionManager rather to use:

var textScrap:TextScrap = em.createTextScrap ();

Then use it when you create the new CutOperation. I've not coded at all, but I think it should work.

Tags: Adobe Open Source

Similar Questions

Maybe you are looking for

  • Don't remember the passwords of Facebook

    I'm rusty and did not share all of the media since eternity and a day. I forgot my password to share a video. How to get a Facebook information these username and password?

  • Which hard drive MacBook Pro 2012

    Hello I have Non - Retana MacBook Pro 2012, it has its default 500 GB hard drive, it is too small and too slow. I have found that I can put a 2 TB in current housing and a second in the SuperDrive slot should I want to. But my Question, above all, th

  • HP Pavilion Notebook - 17-f122: Bluetooth

    I want to know if my system is compatible with Bluetooth? I have upgraded to Windows 10 and in my programs and features, I have the Bluetooth Broadcom drivers, however, in the center of the action, there is no Bluetooth option.  Thanks for your help.

  • Pavilion all-in-one 23-q112: pavilion all-in-one 23-q112

    I just need to know how to remove the rear to improve my memory

  • would not print because of the configuration of the printer... error message

    1 will not work in any program 2 error message... cannot print because of the way in which printer is configured 3. recent changes that I could have done...  I tried a configuration to use a different printer on a home network 4. between the thing I'