
Translating image data types between Lingo and ActionScript 17
convert()
Usage
-- Lingo syntax
convert(targetDataFormat, sourceDataRef)
sprite(whichSprite).convert(targetDataFormat, sourceDataRef)
// JavaScript syntax
convert(targetDataFormat, sourceDataRef);
sprite(whichSprite).covert(targetDataFormat, sourceDataRef);
Description
Top-level function or Flash sprite method. Translates image, rectangle, and list/array objects
between Lingo (Director) and ActionScript (Flash). Returns a reference to the converted
object. For example, in the following code,
x is a valid reference to an ActionScript Rectangle
value:
x = newObject("flash.geom.Rectangle")
In the following code, y is a a valid reference to a Lingo rect value:
y = convert(#rect, z)
The following table lists the equivalent Lingo and ActionScript objects:
Lingo data type ActionScript data type
image BitmapData
rect Rectangle
list Array
NOTE
The convert() method does not operate on points. To convert an ActionScript Point
object to a Lingo Point object, pass the ActionScript Point object to the Lingo
point()
function. To convert a Lingo
point variable to an ActionScript Point object, use the
newObject() function.
NOTE
These ActionScript data types are also called classes. They are documented in the
ActionScript classes section of the ActionScript 2.0 Language Reference in Flash Help.
Kommentare zu diesen Handbüchern