Locked

Since Flex SDK 4.6 the TextArea reports incorrect Bounds?

New Here ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

Can some tell me why since upgrading to the Flex SDK 4.6 a TextArea does not return the correct size using getBounds? It seems to have an extra 18pixels added to the top and left. I have written a test script to prove the point. Any help would be appreciated as this is now causing me problems in a live application.

<?xml version="1.0" encoding="utf-8"?>

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                       xmlns:s="library://ns.adobe.com/flex/spark"

                       xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="onCreation()">

    <fx:Script>

        <![CDATA[

            import spark.components.RichEditableText;

           

            public function onCreation() : void {

                var bounds:Rectangle = box.getBounds(this);

                trace(box.width);

                trace(bounds);

            }

        ]]>

    </fx:Script>

    <s:TextArea x="0" y="0" width="200" height="50" top="0" id="box"/>

</s:WindowedApplication>

TOPICS
Developers

Views

1.1K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

Use of the low-level getBounds is not recommended in UIComponents. It will factor in hidden display objects.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2012 Jan 25, 2012

Copy link to clipboard

Copied

So whats recommended? No offense, but that's a pretty glib answer.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 25, 2012 Jan 25, 2012

Copy link to clipboard

Copied

LATEST

I’m not sure what you are trying to accomplish. The width/height are usually the answer.

Alex Harui

Flex SDK Developer

Adobe Systems Inc.<http://www.adobe.com/>

Blog: http://blogs.adobe.com/aharui

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines