hm… can you actually call a function before it’s declared? **
:sure:
ahmed, hasn’t anyone taught you about stacks?
When Flash compiles the code, it pushes everything onto a stack according to importance. Functions are up there. You can bury prototypes deep within the deepest depths of movieclips within movieclips and you would still be able to call the prototype from the first frame of the main stage.
Once the prototypes and functions are defined, Flash moves down the stack (functions, events, loops, etc).
I know sen (:love:**) is gonna correct me in some sense or another…:sigh:
its just a matter of syntax where Flash will defined
function functionName(){
before
functionName = function(){
the second version following order of operations in definition
So if you’re used to using functionName = function, your functions can’t be used before their definition. However, at the same time, function functionName(){ function declarations can’t be defined within other operations. i.e.
go()
function go(){
trace("GO!")
if (true){
function newFunc(){
trace("YES!")
}
}else{
function newFunc(){
trace("NO!")
}
}
newFunc()
}
/* output:
GO!
*/
*Originally posted by Ilyas Masa * Thor >> Your French is perfect and you know it
Thanks, pom. Actually, I don’t know it. Since I don’t have my teacher drilling every è’s and é’s and a misplaced ‘s’ in the ‘tu’ form of a verb and other whatnots, I don’t really know if anything I say in french is correct. I haven’t practiced in so long…