MACROMEDIA FLASH 8-FLASH User Manual Page 19

  • Download
  • Add to my manuals
  • Print
  • Page
    / 22
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 18
Additional Lingo APIs 19
-- "oak,ash,elm,beech"
put flashtrees[0]
-- "oak"
// JavaScript syntax
trees = list("oak", "ash", "elm", "beech");
flashtrees = convert(symbol("flashObjectArray"), trees);
trace (flashtrees.tostring()); // oak,ash,elm,beech
trace(flashtrees[1]); // ash
--Lingo syntax
bikes = newObject("Array", "trek", "giant", "schwinn", "colnago")
lingobikes = convert(#list, bikes)
put lingobikes
-- ["trek", "giant", "schwinn", "colnago"]
put lingobikes[1]
-- "trek"
// JavaScript syntax
bikes = newObject("Array", "trek", "giant", "schwinn", "colnago");
lingobikes = convert(symbol("list"), bikes);
trace(lingobikes.toString()); // <["trek", "giant", "schwinn", "colnago"]>
trace(lingobikes[1]); // trek
When setting an array property of a component sprite or member, lists are now properly
converted to Flash arrays. For example, if sprite 1 is a List component, you can use the
following code to assign the
labels property:
--Lingo syntax
sprite(1).labels = ["uno", "dos", "tres", "quatro", "cinco"]
// JavaScript syntax
sprite(1).labels = list("alpha", "beta", "gamma", "delta", "epsilon");
Additional Lingo APIs
Macromedia added two additional Flash sprite APIs in Director 10.1: propDirectAccess
and
createVariable().
``
NOTE
The only other new Flash sprite API is the convert() function (this API is also a top-level
function), which is covered in the section “About ActionScript image effects”
on page 14.
Page view 18
1 2 ... 14 15 16 17 18 19 20 21 22

Comments to this Manuals

No comments