Skip to main content
Participating Frequently
April 6, 2010
Answered

Error #2004 when displaying tooltip in popup on FP 10.1

  • April 6, 2010
  • 1 reply
  • 4177 views

I'm posting a bug we're seeing here in hopes of someone seeing this will know what may be causing it, know how to fix it (presumably someone from Adobe), or have some better ideas on recreating in a simple test case.

Here is the bug:

https://bugs.adobe.com/jira/browse/SDK-25826

In our application, when using FP 10.1,  we receive the following exception when Flex tries to display a tooltip from a component that is within a popup.

ArgumentError: Error #2004: One of the parameters is invalid.
at Error$/throwError()
at flash.text.engine::TextBlock/recreateTextLine()
at Function/
http://adobe.com/AS3/2006/builtin::apply()
at _wf_app_web_mx_managers_SystemManager/callInContext()

at flashx.textLayout.container::TextContainerManager/recreateTextLine()[/dir/src/flashx/textLayout/container/TextContainerManager.as:931]
at flashx.textLayout.container::TextContainerManager/callInContext()[/dir/src/flashx/textLayout/container/TextContainerManager.as:866]
at flashx.textLayout.compose::SimpleCompose/createTextLine()[/dir/src/flashx/textLayout/compose/SimpleCompose.as:234]
at flashx.textLayout.compose::SimpleCompose/composeNextLine()[/dir/src/flashx/textLayout/compose/SimpleCompose.as:186]
at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()[/dir/src/flashx/textLayout/compose/BaseCompose.as:349]
at flashx.textLayout.compose::SimpleCompose/composeParagraphElement()[/dir/src/flashx/textLayout/compose/SimpleCompose.as:165]
at flashx.textLayout.compose::BaseCompose/composeBlockElement()[/dir/src/flashx/textLayout/compose/BaseCompose.as:221]
at flashx.textLayout.compose::BaseCompose/composeInternal()[/dir/src/flashx/textLayout/compose/BaseCompose.as:326]
at flashx.textLayout.compose::BaseCompose/composeTextFlow()[/dir/src/flashx/textLayout/compose/BaseCompose.as:292]
at flashx.textLayout.compose::SimpleCompose/composeTextFlow()[/dir/src/flashx/textLayout/compose/SimpleCompose.as:113]
at FactoryDisplayComposer/
http://ns.adobe.com/textLayout/internal/2008::callTheComposer()[/dir/src/flashx/textLayout/factory/TextLineFactoryBase.as:422]
at flashx.textLayout.compose::StandardFlowComposer/internalCompose()[/dir/src/flashx/textLayout/compose/StandardFlowComposer.as:759]
at flashx.textLayout.compose::StandardFlowComposer/compose()[/dir/src/flashx/textLayout/compose/StandardFlowComposer.as:822]
at flashx.textLayout.factory::TextFlowTextLineFactory/createTextLines()[/dir/src/flashx/textLayout/factory/TextFlowTextLineFactory.as:128]
at flashx.textLayout.container::TextContainerManager/compose()[/dir/src/flashx/textLayout/container/TextContainerManager.as:1252]
at flashx.textLayout.container::TextContainerManager/updateContainer()[/dir/src/flashx/textLayout/container/TextContainerManager.as:1292]
at mx.core::FTETextField/composeHTMLText()[/sdk/4.0.0/frameworks/projects/spark/src/mx/core/FTETextField.as:3089]
at mx.core::FTETextField/validateNow()[/sdk/4.0.0/frameworks/projects/spark/src/mx/core/FTETextField.as:2530]
at mx.core::FTETextField/get width()[/sdk/4.0.0/frameworks/projects/spark/src/mx/core/FTETextField.as:572]
at mx.controls::ToolTip/measure()[/sdk/4.0.0/frameworks/projects/framework/src/mx/controls/ToolTip.as:364]
at mx.core::UIComponent/measureSizes()[/sdk/4.0.0/frameworks/projects/framework/src/mx/core/UIComponent.as:8042]
at mx.core::UIComponent/validateSize()[/sdk/4.0.0/frameworks/projects/framework/src/mx/core/UIComponent.as:7966]
at mx.managers::LayoutManager/validateClient()[/sdk/4.0.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:889]
at mx.core::UIComponent/validateNow()[/sdk/4.0.0/frameworks/projects/framework/src/mx/core/UIComponent.as:7631]
at mx.managers::ToolTipManagerImpl/sizeTip()[/sdk/4.0.0/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as:987]
at mx.managers::ToolTipManagerImpl/
http://www.adobe.com/2006/flex/mx/internal::initializeTip()[/sdk/4.0.0/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as:958]
at mx.managers::ToolTipManagerImpl/
http://www.adobe.com/2006/flex/mx/internal::showTimer_timerHandler()[/sdk/4.0.0/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as:1539]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

Our application is very modular and we embed fonts, but I've tried various approaches in a test application and haven't been able to reproduce this exception.

Here's the stack/variables seen when debugging, http://screencast.com/t/MGU1MDEzNGIt. **To get here it requires commenting out the try/catch in StandardFlowComposer.internalCompose()** If I had to guess, it seems that recreateTextLine doesn't like getting the same textLine twice in the argsArray.

Anyone have thoughts?

Thanks for looking,
Bryon

This topic has been closed for replies.
Correct answer JabbyPandaUA

   I was getting the same RTE, the same pattern in Flex debugging session with passing same line twice in the argsArray to recreateTextLine method.

   I've come up with relatively simple test case that consists only of 2 files, I've just attached the Flash Builder project FXP file to the related Flex bug issue in JIRA: https://bugs.adobe.com/jira/browse/SDK-25826

   This bug is reproduced for any tooltip displayed in Flash Player 10.1 that

  •    tries to display 2 or more lines of text;
  •    is using  FTE to display text (mx.core.UIFTETextField class);
  •    sets htmlText instead of text property for the textField to display error message.

------------------------

Some possible background for this RTE I've learned during my research:

  1. Line 245, SimpleCompose.as

workingLine.initialize(_curParaElement, outerTargetWidth, 
                        lineOffset, lineStart + _curParaStart, 
                        textLine.rawTextLength, textLine);

   where textLine.rawTextLength does not return a correct value in Flash Player 10.1.

  2 . Line 154, TextFlowLine.as class  > textLength property is  assigned to  textLine.rawTextLength

_textLength = numChars;

  3. Line 362, BaseCompose.as class >  _curElementOffset  is assigned to textLine.textLength value.

_curElementOffset += curLine.textLength;

  4.  Line 436 in BaseCompose.as  > we compare element.textLength and _curElementOffset values > this comparison returns FALSE

if (_curElementOffset >= _curElement.textLength)

  5. Line 173, SimpleCompose.as > becase startCompose is not equal to 0, prevLine is not null > 2 same lines  "prevLine" and "curLine" are passed to createTextLine method and finally to recreateTextLine method.

var startCompose:int = _curElementStart + _curElementOffset - _curParaStart; var prevLine:TextLine = startCompose != 0 ? workingLine.getTextLine() : null;

1 reply

April 7, 2010

Getting the same line twice in the argsArray is definitely not a good thing. Do you have any idea how that comes about?

Rich suggested trying TextLineRecycler.textLineRecyclerEnabled = false to see whether the problem reproduces without the line recycler.

blmarksAuthor
Participating Frequently
April 7, 2010

I don't know what is causing this issue.  There is obviously something unique about what we're doing or how the projects or set up, but I haven't been able to put my thumb on it yet.

I did try Rich's suggestion of turing off textLine recycling and that did in fact stop the error from occurring.  Definitely not something we'd want to do long-term, but in the interim, it looks like it would get us around the issue.  Hopefully we can come up with a reproducible test case here soon.

Thanks

JabbyPandaUA
JabbyPandaUACorrect answer
Inspiring
June 22, 2010

   I was getting the same RTE, the same pattern in Flex debugging session with passing same line twice in the argsArray to recreateTextLine method.

   I've come up with relatively simple test case that consists only of 2 files, I've just attached the Flash Builder project FXP file to the related Flex bug issue in JIRA: https://bugs.adobe.com/jira/browse/SDK-25826

   This bug is reproduced for any tooltip displayed in Flash Player 10.1 that

  •    tries to display 2 or more lines of text;
  •    is using  FTE to display text (mx.core.UIFTETextField class);
  •    sets htmlText instead of text property for the textField to display error message.

------------------------

Some possible background for this RTE I've learned during my research:

  1. Line 245, SimpleCompose.as

workingLine.initialize(_curParaElement, outerTargetWidth, 
                        lineOffset, lineStart + _curParaStart, 
                        textLine.rawTextLength, textLine);

   where textLine.rawTextLength does not return a correct value in Flash Player 10.1.

  2 . Line 154, TextFlowLine.as class  > textLength property is  assigned to  textLine.rawTextLength

_textLength = numChars;

  3. Line 362, BaseCompose.as class >  _curElementOffset  is assigned to textLine.textLength value.

_curElementOffset += curLine.textLength;

  4.  Line 436 in BaseCompose.as  > we compare element.textLength and _curElementOffset values > this comparison returns FALSE

if (_curElementOffset >= _curElement.textLength)

  5. Line 173, SimpleCompose.as > becase startCompose is not equal to 0, prevLine is not null > 2 same lines  "prevLine" and "curLine" are passed to createTextLine method and finally to recreateTextLine method.

var startCompose:int = _curElementStart + _curElementOffset - _curParaStart; var prevLine:TextLine = startCompose != 0 ? workingLine.getTextLine() : null;