13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Using the Text Layout Framework<br />

For more information, see SelectionManager, EditManager, and UndoManager in the ActionScript 3.0 Refer<strong>en</strong>ce for<br />

the Adobe Flash Platform.<br />

Ev<strong>en</strong>t handling with TLF<br />

Flash Player 10 and later, Adobe AIR 1.5 and later<br />

TextFlow objects dispatch ev<strong>en</strong>ts in many circumstances, including:<br />

Wh<strong>en</strong> the text or layout changes<br />

Before an operation begins and after an operation completes<br />

Wh<strong>en</strong> the status of a FlowElem<strong>en</strong>t object changes<br />

Wh<strong>en</strong> a compose operation completes<br />

For more information, see flashx.textLayout.ev<strong>en</strong>ts in the ActionScript 3.0 Refer<strong>en</strong>ce for the Adobe Flash Platform.<br />

More Help topics<br />

TLF FlowElem<strong>en</strong>t and LinkElem<strong>en</strong>t Ev<strong>en</strong>ts and Ev<strong>en</strong>tMirrors<br />

Positioning images within text<br />

To position the InlineGraphicElem<strong>en</strong>t within the text, you use the following properties:<br />

float property of the InlineGraphicElem<strong>en</strong>t class<br />

clearFloats property of the FlowElem<strong>en</strong>t<br />

The float property controls the placem<strong>en</strong>t of the graphic and the text around it. The clearFloats property controls<br />

the placem<strong>en</strong>t of the paragraph elem<strong>en</strong>ts relative to the float.<br />

To control the location of an image within a text elem<strong>en</strong>t, you use the float property. The following example adds an<br />

image to a paragraph and aligns it to the left so the text wraps around the right:<br />

Images in a flow are a good thing. For example, here is a<br />

float. It should show on the left: Don't you agree? Another s<strong>en</strong>t<strong>en</strong>ce here. Another<br />

s<strong>en</strong>t<strong>en</strong>ce here. Another s<strong>en</strong>t<strong>en</strong>ce here. Another s<strong>en</strong>t<strong>en</strong>ce here. Another s<strong>en</strong>t<strong>en</strong>ce here. Another<br />

s<strong>en</strong>t<strong>en</strong>ce here. Another s<strong>en</strong>t<strong>en</strong>ce here. Another s<strong>en</strong>t<strong>en</strong>ce here.<br />

Valid values for the float property are “left”, “right”, “start”, “<strong>en</strong>d”, and “none”. The Float class defines these<br />

constants. The default value is “none”.<br />

The clearFloats property is useful in cases where you want to adjust the starting position of subsequ<strong>en</strong>t paragraphs<br />

that would normally wrap around the image. For example, assume that you have an image that is larger than the first<br />

paragraph. To be sure the second paragraph starts after the image, set the clearFloats property.<br />

The following example uses an image that is taller than the text in the first paragraph. To get the second paragraph to<br />

start after the image in the text block, this example sets the clearFloats property on the second paragraph to “<strong>en</strong>d”.<br />

Last updated 6/6/2012<br />

439

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!