Apache Flex 4.16.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
ISWFContext

Package | flashx.textLayout.compose
Interface | public interface ISWFContext
Implementors | TextContainerManager

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The ISWFContext interface allows a SWF file to share its context with other SWF files that load it. An application that loads a SWF file of type ISWFContext can call methods in the context of the loaded SWF file. The main usage is for calling the FTE TextLine creation methods.

There are two reasons for an application to use this interface to control TextLine creation:

- Reuse an embedded font: if an application wants to use a font embedded in a loaded SWF file, the application can access the font if a TextLine is created in the context of the loaded SWF file.
- Reuse existing TextLine instances: reusing existing TextLine instances can result in faster recompose times. TLF reuses existing TextLine instances internally. TLF reuses a TextLine by calling `TextBlock.recreateTextLine()` instead of `TextBlock.createTextLine()` when TLF recognizes that a TextLine is extant.

Your application may have additional TextLine instances that can be reused. To manually reuse existing TextLine instances:

1. trap calls to `TextBlock.createTextLine()`, then
2. call `TextBlock.recreateTextLine()` with the extant TextLine instance instead of `TextBlock.createTextLine()`.

Please note, however, that the `TextBlock.recreateTextLine()` is available only in Flash Player 10.1 and later.

See also

flash.text.engine.TextBlock.createTextLine()
flash.text.engine.TextBlock.recreateTextLine()

Public Methods

| Method | Defined By
--- | --- | ---
|  | callInContext(fn:Function, thisArg:Object, argArray:Array, returns:Boolean = true):* A way to call a method in a client controlled context. | ISWFContext

Method Detail

callInContext | () | method

`public function callInContext(fn:Function, thisArg:Object, argArray:Array, returns:Boolean = true):*`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

A way to call a method in a client controlled context.

Parameters

| `fn:Function` — The function or method to call
| `thisArg:Object` — The this pointer for the function
| `argArray:Array` — The arguments for the function
| `returns:Boolean` (default = `true`)`` — If true, the function returns a value

Returns

| `*` — Whatever the function returns, if anything.

See also

Function.apply()

Sun Mar 5 2017, 03:42 PM +11:00