MACROMEDIA FLASH 8-FLASH Bedienungsanleitung Seite 21

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 22
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 20
Additional Lingo APIs 21
// JavaScript syntax
spriteObjRef.createVariable(varNameSymbol, varValue);
Description
Flash sprite command; creates an ActionScript variable in the Flash sprite. This command is
related to the
getVariable() and setVariable() Flash sprite functions.
Parameters
varNameSymbol Required. Specifies the name of the variable to create. This is passed in as a
Lingo symbol; the string representation for the symbol is used as the variable name.
varValue Required. Specifies the initial value for the new variable.
Example
The following statement creates a variable called bill and gives it the value 5:
-- Lingo syntax
sprite(1).createVariable(#bill, 5)
put sprite(1).bill
-- 5
// Javascript syntax
sprite(1).createVariable(symbol("bill"), 5);
trace(sprite(1).bill);
// 5
This example first creates an ActionScript array, and then creates the variable lisa to store the
array within the Flash sprite.
-- Lingo syntax
temp = sprite(1).newObject("Array", "one", "two", 3, 4)
sprite(1).createVariable(#lisa, temp)
put sprite(1).lisa[1]
-- "two"
// Javascript syntax
temp = sprite(1).newObject("Array", "one", "two", 3, 4);
sprite(1).createVariable(symbol("lisa"), temp);
trace(sprite(1).lisa[1]);
// two
NOTE
This function was added in Director version 10.1.
Seitenansicht 20
1 2 ... 16 17 18 19 20 21 22

Kommentare zu diesen Handbüchern

Keine Kommentare