Skip to main content
casper_no
Known Participant
Dec 22, 2010 10:29 AM UTC
Question

Paste with empty clipboard inserts "null"

Flex 4.1

To reproduce :

Place cursor in textFlow, select nothing.

Copy

Paste

The text "null" is inserted instead of the expected "" empty string.

I've created a workaround, we can listen for paste events and manipulate the pasted content.

myTextFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN, handleFlowEvents);

...

private function handleFlowEvents(e:FlowOperationEvent):void {

     if (e.operation is PasteOperation) {

trapPaste(e.operation as PasteOperation);

}

}

private function trapPaste(po:PasteOperation):void {

var pasteTxtflow:TextFlow = po.textScrap.textFlow

pasteTxtflow.interactionManager = new EditManager();

if (pasteTxtflow.mxmlChildren.length == 1 && pasteTxtflow.getFirstLeaf().text == "null" && pasteTxtflow.getFirstLeaf() is SpanElement) {

(pasteTxtflow.getFirstLeaf() as SpanElement).text = "";

return;

}

}

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

5 replies

Adobe Employee
Dec 22, 2010 9:51 PM UTC

I'm not able to reproduce this on the latest TLF 2.0. Can you tell me what version of TLF you are using, and what you are doing to trigger the copy & paste? It looks to me like the PasteOperation does nothing to cvhange the TextFlow if the scrap is null, although it still does send the FlowOperationEvents.

Thanks,

- robin

Translate
Adobe Employee
Dec 22, 2010 10:13 PM UTC

Are you doing this from a browser or an AIR app? Can you also tell me what platform, and what browser version?

Thanks,

- robin

Translate