|
-
Function not invoking...please help
Hello
I have a function that works well when i invoke it through onPress, however, the function does not work when i place it in the movie frame.
For instance
function traceMessage(){
trace("I am invoked");
}
works when I invoke like this through a button:
on (press){
traceMessage();
}
However, when I just place the function in the first frame of my movie, like this:
traceMessage();
it doesn't work.
Any suggestions? Thanks,
Tone
-
imagination through stupidity
 Originally Posted by toneDigital
Hello
I have a function that works well when i invoke it through onPress, however, the function does not work when i place it in the movie frame.
For instance
function traceMessage(){
trace("I am invoked");
}
works when I invoke like this through a button:
on (press){
traceMessage();
}
However, when I just place the function in the first frame of my movie, like this:
traceMessage();
it doesn't work.
Any suggestions? Thanks,
Tone
Code:
function traceMessage(){
trace("I am invoked");
}
traceMessage();
place that in frame 1 and it will work.
the frame where the function is defined has to be shown before you can try to run the function.
code is read top down so the function is defined before it is called.
Nothing to see here, move along.
-
Thanks.
I'll give a go and let you know : )
T
-
Works like a charm!
Thanks!
T
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|