anoniem Geplaatst: 11 juni 2004 Delen Geplaatst: 11 juni 2004 mensen, Waarschijnlijk een hele basic vraag maar ik kan het niet vinden. Ik wil een variabele gebruiken die ik in een functie aanmaak. [code:1:eacf808af2]function showText(nr) { //blaat return nr; } // hoe kan ik nu nr opvragen ?[/code:1:eacf808af2] alvast bedankt -marcel Quote Link naar reactie
anoniem Geplaatst: 12 juni 2004 Auteur Delen Geplaatst: 12 juni 2004 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) Quote Link naar reactie
anoniem Geplaatst: 12 juni 2004 Auteur Delen Geplaatst: 12 juni 2004 Probeer eens [code:1:9fe7f0adce]trace( showText(6) ); [/code:1:9fe7f0adce] :) Quote Link naar reactie
Aanbevolen berichten
Om een reactie te plaatsen, moet je eerst inloggen