Skip to main content
Known Participant
Oct 8, 2009 9:05 AM UTC
Question

Space Between Two Span Elements in Same Paragraph

Hi

     I m creating an application using TextLayout Framework in FlexBuilder3(Sdk3.4).

Code is like

          var paragraphElement:ParagraphElement= new  ParagraphElement();

          var spanElement1:SpanElement= new SpanElement():

          spanElement1.text = "A";

          paragraphElement.addChild(spanElement1);

          var spanElement2:SpanElement= new SpanElement():

          spanElement2.text = "A";

          paragraphElement.addChild(spanElement2);

     OutPut of above code is Like:-  AB.

But i want Space between these two spans is of   margin= 27.

So how can i create space between these two spans. if anybody know please reply.

Thanks

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

3 replies

Adobe Employee
Oct 9, 2009 6:29 AM UTC

You could add tracking values to the second span to push it away. So if you have this:

<span>A</span><span>B</span>

You could add 27 pixels of space by doing this:

<span>A</span><span trackingLeft="27">B</span>

- robin

Translate
Known Participant
Oct 9, 2009 6:58 AM UTC

Hi Robin

      Thanks for replying, I already tried it with trackingleft , it is Quite useful if i have Only single character in the Span Element.

But if i have a complete word Like

                                        <spanElement>A</spanElement><spanElement trackingLeft="27">Robin</spanElement>

Then the output is like A   R  o  b  i  n

i.e. Tracking left is on all characters.

U can try this on above code by replacing B by Robin.

If any Solution please let me know

Translate
Adobe Employee
Oct 12, 2009 8:53 PM UTC

In order to get this to work, you'll have to break off the first character in the second span into its own span.

- robin

Translate