Skip to main content
Aug 7, 2011 8:37 AM UTC
Question

is there a way to insert picture behind text in textflow

is there a way to insert picture behind text in textflow

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

Adobe Employee
Aug 8, 2011 5:24 AM UTC
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();
Translate
Aug 8, 2011 2:45 PM UTC

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

Translate
Adobe Employee
Aug 9, 2011 2:58 AM UTC

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

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

Translate