• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Insert Custom Components into TextLine

Explorer ,
Apr 06, 2010 Apr 06, 2010

Copy link to clipboard

Copied

Hi,

What is the best way to modify TLF so I can insert custom component into TexLines (others than inline images). For example I want to be able to insert a button and have the same behavior the inline images have.

Thanks in advance.

TOPICS
Text layout framework

Views

1.8K

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
Apr 06, 2010 Apr 06, 2010

Copy link to clipboard

Copied

If you're talking about Flex components like <mx:Button> or <s:Button>, they have to live inside of an appropriate Flex container. A text-displaying component like <s:TextArea> isn't such a container. (I.e., you can't put a Button inside a TextArea.) So I suggest using a TextArea/Button sibling combination like

<s:Group>

    <s:TextArea>

    <s:Button>

</s:Group>

where the TextArea's TextFlow has an inline graphic where you want the Button to appear, and you write ActionScript code to position the Button on top of the inline graphic.

Gordon Smith

Adobe Flex SDK Team

Votes

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
Explorer ,
Apr 06, 2010 Apr 06, 2010

Copy link to clipboard

Copied

Hi Gordon,

Thanks for your response. I think I didn't explain my idea correctly.

In the TLF you can add images, for instance, using InlineGraphicElement components. What I want to do, is be able to create custom component that can be inserted into, for example, a RichText component, in the same way the inline images (InlineGraphicElement) work. I want to extend TLF to support some other custom elements.

Thanks.

Votes

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 ,
Jun 13, 2010 Jun 13, 2010

Copy link to clipboard

Copied

Hello,

Have you had any progress with this issue?

Thanks.

Votes

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 ,
Jun 14, 2010 Jun 14, 2010

Copy link to clipboard

Copied

I'm not quite sure what you're asking. There's no way to embed a Flex component in the text -- as Gordon said, that is not supoported. So there is no way to put a Button, for example, between two characters. You can defined your own DisplayObject that handles events, and use that as an InlineGraphicElement, but it can't be a Flex component.

Hope this helps,

- robin

Votes

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 ,
Jun 16, 2010 Jun 16, 2010

Copy link to clipboard

Copied

Thanks for the reply.

Defining my own DisplayObject works well, but, I was wondering if I could extend FlowLeafElement. Is there a working example for creating new elements for TLF?

Thanks again.

Votes

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 ,
Jun 16, 2010 Jun 16, 2010

Copy link to clipboard

Copied

Creating new FlowElements is not supported, sorry. Unless there's some folks out here who've already tried it, you might be on your own. It would certainly require modifying TLF to get it to work.

- robin

Votes

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
Participant ,
Jun 17, 2010 Jun 17, 2010

Copy link to clipboard

Copied

LATEST

It is possible to embed Flex components inside of an inline graphic element, but it is tricky to get working.  They key is to create a wrapper for your component that extends something like Sprite.  You must parent your component and then perform the Flex component lifecycle initialization and validation that's usually provided by UIComponent (see UIComponent source).   Then supply the wrapper as the source for the IGE.  That's about all the help I can provide, but I can confirm that it is possible, though as Robin and Gordon mentioned, this is not something that is supported by TLF directly.

Good luck,

Brent

Votes

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