[ 
https://issues.apache.org/jira/browse/FLEX-34744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312187#comment-14312187
 ] 

Alessandro Palombaro commented on FLEX-34744:
---------------------------------------------

Ok, then this is a behavior change from the previous version of Flex. 
Unfortunately this change means our application won't function correctly 
anymore with Apache Flex 4.14.0 because previously the original span was left 
within the parent. Logically I feel if a span is created by the user (even an 
empty span) than that span should not be considered the 'terminator span' as 
the terminator span should always be generated and/or maintained internally. In 
this instance the original span should remain and the newly added span should 
become the terminator?

I'm not sure how it worked internally before... but prior to 4.14.0 the empty 
span specified by the user was not being removed from the parent.

BTW I'm not saying the new behavior is necessarily wrong... but it is a change 
in the frameworks behavior which has caused us a regression issue. 

> TextFlowElement parent nulled when addChild method used via parent reference
> ----------------------------------------------------------------------------
>
>                 Key: FLEX-34744
>                 URL: https://issues.apache.org/jira/browse/FLEX-34744
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Apache Flex 4.14.0
>            Reporter: Alessandro Palombaro
>            Assignee: Harbs
>
> Example application below. This worked fine in version 4.13.0
> {code:xml}
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
>                xmlns:s="library://ns.adobe.com/flex/spark"
>                applicationComplete="_this_applicationCompleteHandler(event)" 
> frameRate="60"
>                backgroundAlpha="0">
>       <fx:Script>
>               <![CDATA[
>               import flashx.textLayout.elements.FlowElement;
>               import flashx.textLayout.elements.SpanElement;
>               import flashx.textLayout.elements.TextFlow;
>               import mx.events.FlexEvent;
>               import spark.utils.TextFlowUtil;
>               protected function 
> _this_applicationCompleteHandler(event:FlexEvent):void
>               {
>                       var flow:TextFlow = TextFlowUtil.importFromXML(xml);
>                       var span:SpanElement = new SpanElement();
>                       var target:FlowElement = 
> flow.getElementByID("SpanElementId") as SpanElement;
>                       // target.parent is instance of ParagraphElement
>                       trace("EngineTesting._this_applicationCompleteHandler", 
> target.parent);
>                       target.parent.addChild(span);
>                       // target.parent has been set to null when it should 
> still reference the ParagraphElement
>                       trace("EngineTesting._this_applicationCompleteHandler", 
> target.parent);
>                       richText.textFlow = flow;
>               }
>               ]]>
>       </fx:Script>
>       <fx:Declarations>
>               <fx:XML id="xml">
>                       <div>
>                               <p><span id="SpanElementId" uid="5501" 
> width="250" height="180"/></p>
>                               <p>Hello World.</p>
>                       </div>
>               </fx:XML>
>       </fx:Declarations>
>       
>       <s:RichText width="100%" id="richText"/>
>       
> </s:Application>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to