0

In TextArea with id="TextView" the loaded html-text length is 1080 lines. This process takes 3-4 seconds and would be desirable to indicate this to the user.

TextView.textFlow = TextFlowUtil.importFromString(data.readUTFBytes(data.bytesAvailable), WhiteSpaceCollapse.PRESERVE);

I think the delay in TextFlowUtil is in the process of converting a large number of tags (e.g., <span>). What events can help? Are there any progress or completion events to hook? Thanks in advance!

James Tomasino
  • 3,520
  • 1
  • 20
  • 38

1 Answers1

0

I don't know of any progress events, but I would just show a spiny wheel:

import flashx.textLayout.events.FlowOperationEvent;

whatever.addEventListner( FlowOperationEvent.FLOW_OPERATION_BEGIN, begin);
whatever.addEventListner( FlowOperationEvent.FLOW_OPERATION_END, end);

funciton begin(evt:FlowOperationEvent){
  //Show spinny wheel
}
funciton end(evt:FlowOperationEvent){
  //hide spinny wheel
}
ToddBFisher
  • 11,370
  • 8
  • 38
  • 54
  • i'm trying something like this: TextView.textFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN, BeginFlowText); TextView.textFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_END, EndFlowText); but don't enter in event... – ezepovartur Nov 18 '11 at 16:52
  • it seems that under FLOW_OPERATIONS meaning: InsertTextOperation, PasteOperation, DeleteTextOperation, CutOperation etc. – ezepovartur Nov 18 '11 at 17:38
  • Maybe try just TextView.addEventListener()... without the textFlow in the middle. Another thought, have you tried simply showing a spinny wheel, then calling your importFromString(), then hiding the spinny wheel on the next line of code? There's a chance it may be that simple. – ToddBFisher Nov 19 '11 at 05:50
  • I tried it in different ways... moreover, as I wrote above, FlowOperationEvent not apply to operations importFromString ()! anyway, thanks that helped:) – ezepovartur Nov 19 '11 at 09:01