Ga naar inhoud

[Flash] Functie variabele uitlezen


Aanbevolen berichten

Als het goed is, zit er bij je flashprogramma een helpmenu, hierin staat precies omschreven, hoe dit werkt...... of zo misschien !!!! [b:d4224be829]Defining a function[/b:d4224be829] Functions, like variables, are attached to the movie clip that defines them. When a function is redefined, the new definition replaces the old definition. To define a function, use the function action followed by the name of the function, any arguments to be passed to the function, and the ActionScript statements that indicate what the function does. The following is a function named Circle with the argument radius: [color=green:d4224be829]function Circle(radius) { this.radius = radius; this.area = Math.PI * radius * radius; }[/color:d4224be829] Note: The keyword this, used in a function body, is a reference to the movie clip that the function belongs to. You can also define a function by creating a function literal. A function literal is an unnamed function that is declared in an expression instead of in a statement. You can use a function literal to define a function, return its value, and assign it to a variable in one expression, as in the following: [color=green:d4224be829]area = (function () {return Math.PI * radius *radius;})(5);[/color:d4224be829] Kijk ook eens op www.flashfocus.nl 8)
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

  • Populaire leden

    Er is nog niemand die deze week reputatie heeft ontvangen.

  • Leden

    Geen leden om te tonen

×
×
  • Nieuwe aanmaken...