Skip to main content
Known Participant
October 8, 2009
Question

Space Between Two Span Elements in Same Paragraph

  • October 8, 2009
  • 1 reply
  • 6281 views

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 has been closed for replies.

1 reply

Adobe Employee
October 9, 2009

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

Known Participant
October 9, 2009

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

Adobe Employee
October 12, 2009

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