3 Replies Latest reply on Jan 31, 2011 11:52 PM by Ramon Donnell

    exception in Label.as truncateText


      I've got a moderately complex layout with a DropDownList that is throwing an exception when I select an item.


      ReferenceError: Error #1069: Property -1 not found on __AS3__.vec.Vector.<flash.display::DisplayObject> and there is no default value.

      at spark.components::Label/truncateText()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\c omponents\Label.as:1246]

      at spark.components::Label/http://www.adobe.com/2006/flex/mx/internal::composeTextLines()[E:\dev\4.0.0\frameworks\pro jects\spark\src\spark\components\Label.as:485]

      at spark.components.supportClasses::TextBase/measure()[E:\dev\4.0.0\frameworks\projects\spar k\src\spark\components\supportClasses\TextBase.as:533]

      at mx.core::UIComponent/measureSizes()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\UIComponent.as:8042]

      at mx.core::UIComponent/validateSize()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\cor e\UIComponent.as:7966]

      at mx.managers::LayoutManager/validateSize()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\managers\LayoutManager.as:617]

      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:733]

      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]

      It appears to be totally a Flex text layout bug.

        • 1. Re: exception in Label.as truncateText
          Flex harUI Adobe Employee

          As long as the input is valid, please file a bug with a simple test case.

          • 2. Re: exception in Label.as truncateText
            Tomasz Stocki

            I've got the same error when too long string is used in DropDownList label.


            (using Flex SDK 4.0.0 build 14159, Flash Player ver WIN 10,0,45,2 instaled)


            I used ComboBox instead and waiting for adobe to fix...


            It was really hard find, but in my case it was localization issue:


            I found this in reference:  "Using Flex 4, Creating resource bundles at run time":


            "If you programmatically create your own bundles for a new locale but do not create any framework bundles for that locale prior to compiling the application, you will get run-time exceptions when the framework components try to access framework bundles for the new locale. For example, suppose you programmatically create bundles for the fr_FR locale but do not compile with the fr_FR framework bundles. If you then set the localeChain property to ["fr_FR"], you will get run-time  exceptions when the framework components try to access framework resources for the fr_FR locale. As a result, if you plan on creating bundles for the fr_FR locale at run time, you should compile the application with the fr_FR framework bundles. You can then set the localeChain property to ["fr_FR"]

            without getting run-time  errors."


            So, once again:


            I had the same error connected with DropDownList component (any other: Buttons, ComboBox, Panels etc. was working fine, only when I added DropDownList got this error).


            Now its working, after fix localization in my app.


            Message was edited by: Tomasz Stocki

            • 3. Re: exception in Label.as truncateText
              Ramon Donnell

              I had exactly the same error trying to build potomac application. The solution was the locale resource bundles were not being build into the application.

              This error occurred for me when the resource for the truncated label is not added as a library, ie the "...".