Skip to main content
August 7, 2011
Question

is there a way to insert picture behind text in textflow

  • August 7, 2011
  • 1 reply
  • 1204 views

is there a way to insert picture behind text in textflow

This topic has been closed for replies.

1 reply

Adobe Employee
August 8, 2011
If you want to add a picture as the background,
set the picture as the background of the sprite, or locate some child sprite onto the main sprite to show the picture. Textlines created by TLF are all transparent by default.

If you mean append picture as inline graphic at the end of the textflow,

Option 1,
insertInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState =  null):InlineGraphicElement

insertInlineGraphic("http://river-prod.corp.adobe.com:81/Vellum/standalone/langref/images/logoION.jpg",50, 50, null, new SelectionState(textFlow, textFlow.textLength - 1, textFlow.textLength - 1));

Option 2,
var ilg:InlineGraphicElement = new InlineGraphicElement();
textFlow.getLastLeaf().getParagraph.addchild(ilg);
textFlow.flowComposer.updateAllControllers();
August 8, 2011

depend in yor solution

i wrot this

byt it give me error "-1061: Call to a possibly undefined method addChild through a reference with static type Function.
-Access of undefined property addChild"

<fx:Script>
        <![CDATA[
            import flashx.textLayout.elements.InlineGraphicElement;
            import flashx.textLayout.elements.ParagraphElement;
            import flashx.textLayout.elements.SpanElement;
            protected function togglebutton1_clickHandler(event:MouseEvent):void
            {
                var ilg:InlineGraphicElement = new InlineGraphicElement();
                ilg.source ="alarm.jpg" ;
                mytextflow.textFlow.getLastLeaf().getParagraph.addChild(ilg);
                mytextflow.textFlow.flowComposer.updateAllControllers();

            } 
        ]]>
    </fx:Script>
   
      <s:ToggleButton  x="21" y="10"     click="togglebutton1_clickHandler(event)"/>
    <s:RichEditableText id="mytextflow" x="111" y="43" width="363" height="285"  />            

</s:Application>

i want the image in background

Adobe Employee
August 9, 2011

mytextflow.textFlow.getLastLeaf().getParagraph.addChild(ilg)

I found that I missed the brackets after getParagraph ...