Copy link to clipboard
Copied
Hi Guys,
This issue is specific to TLF 1.1 and does not happen in TLF 1.0.
Have 2 linked container and try typing on the second para of second container, you will see a flicker . Also if you hit "ENTER" in the first para of second container the content will dissapear .
You can try the same here ..
Is this a bug in TLF or am i doing something wrong ?
Thanks
Rafique Gilani
Copy link to clipboard
Copied
Sorry ,
Forgot to post the demo link .. here it is
http://www.rafique-gilani.com/Dump/linkedContainerBug/TextLayoutMultiPageTest.html
Copy link to clipboard
Copied
Hard to say what's going on. My first guess is that after adding a ContainerController you need to add a call to updateAllControllers.
An AS3 example program with source demonstrating the problem would help.
Richard
Copy link to clipboard
Copied
I can reproduce this in our test app. I've logged a bug (Rich - it's 2616329).
Copy link to clipboard
Copied
I guess bug fixing will take some time and this is a show stopper for one of my existing project. Any quick fixes will be really helpfull ?
Regards
Rafique Gilani
Copy link to clipboard
Copied
I've been looking into this -- thanks for reporting this! I have a workaround for you to try. I haven't done extensive testing with it, but it fixes the basic problem. The bug is caused by the new incremental composition. We added new code for composing from the middle of the container, instead of requiring to start at the beginning each time. This bug happens when we are applying the incremental composition logical, but are starting from the start of the second or subsequent container. In this case, it gets confused about where the composed lines should go. The fix is to extend the damaged area slightly, to include the very end of the previous container. You can do this by adding an event listener for DamageEvent to the TextFlow. When you get a damage event, and the damaged area starts at the start of the controller (and its not the first), damage backward by one character.
Here's an example event listener:
private function damageHandler(event:DamageEvent):void
{
if (event.textFlow == activeFlow)
{
var controllerIndex:int = activeFlow.flowComposer.findControllerIndexAtPosition(event.damageAbsoluteStart);
if (controllerIndex > 0)
{
var controller:ContainerController = activeFlow.flowComposer.getControllerAt(controllerIndex);
if (controller.absoluteStart == activeFlow.flowComposer.damageAbsoluteStart)
activeFlow.tlf_internal::damage(controller.absoluteStart - 1, 1, false);
}
}
}
You can attach this event listener to textflow as follows:
activeFlow.addEventListener(DamageEvent.DAMAGE, damageHandler, false,0,true);
Let me know how this works -- my apologies for the bug.
Thanks,
- robin
Copy link to clipboard
Copied
HI Robin
I really appreciate your help.
Just that this fixed only a part of the problem. i.e. typing in the second para of the second container, flicker has gone .What remains is when you hit enter in first para of the second container every thing disappears till i hit a key againThanks and RegardsRafique GilaniCopy link to clipboard
Copied
We've been unable to repro this problem with the workaround, although we do see it in your application that you posted. However, I did find a problem with the code that I posted that was not flagged by the MXML compiler. It should be:
private function damageHandler(event:DamageEvent):void
{
if (event.textFlow == activeFlow)
{
var controllerIndex:int = activeFlow.flowComposer.findControllerIndexAtPosition(event.damageAbsoluteStart);
if (controllerIndex > 0)
{
var controller:ContainerController = activeFlow.flowComposer.getControllerAt(controllerIndex);
if (controller.absoluteStart == activeFlow.flowComposer.damageAbsoluteStart)
activeFlow.tlf_internal::damage(controller.absoluteStart - 1, 1, TextLineValidity.INVALID, false);
}
}
}
Can you try this? TextLineValidity is in the flash.text.engine package. If you still see problems, it would be very helpful to get a small application, if possible, that we can build that shows the problem.
Thanks!
- robin
Copy link to clipboard
Copied
Robin,
Firstly i'd like to thank you for the help.
Have a look at this.. (Source is on)
Start typing till you reach first line of second container, hit enter in there , i.e. first line of second container and you will see what I am talking abt.
Regards
Rafique
Copy link to clipboard
Copied
I see the problem in the compiled application, but I need a way to debug it. Can you isolate the problem and send me a small code sample that demonstrates it? Even if you could just post the damage event handler you are using, that might be enough. I have tried to recreate it here in my own test application but have not succeeded.
Thanks!
- robin
Copy link to clipboard
Copied
Thanks Robin.
I had the same problem and you're workaround did the trick. Is there a new version coming with this bug fixed, TLF 1.2 or similar?
Copy link to clipboard
Copied
It's fixed in our mainline, now available in pre-release form on SourceForge: http://sourceforge.net/adobe/tlf/home/. But unfortunately we don't have a date yet when it will be final.
- robin