Function won't respond

So here is me, a smalltime C (not C++) programmer stuck with this new ActionScript thing and feel mega stupid to ask this…

A simple function won’t respond, I have a trace before the call and after it and both check out, there is no error.

The function is in the main timeline and so is the call, in fact on the same frame. Function is added to the actions of buttons, and call is an action of one specific button.

What oh what could be wrong folks? I have checked all I could think of. I have careated a simple function with just a trace in it and still no love for me, the stupid button just would not call the function, but happily shows traces.

For example my call is

on (release){
search_array=[153,154,155,156];
trace(search_array[3]);
// gotoandstop(153);
meow();
trace(“done”);
}

and meow simply is

meow()
{
trace(“meow”);
}

in the same time line, and nothing happens. In the previous version of the same movie it all worked fine, now that the designer (??) has designed it more it refuses to comply.

any help/pointer would be appreciated, thanks.

Replying to my own post…

The ‘playhead’ had to pass through it before it was recognised, eh? No more days when you could just write it and it would wake up (at least if you absolutely addressed it)

Not impressed with this weird limitation.

anyone care to recommend an FAQ/tutorial for hacks like me? which might list nuisances like that?

thanks.

i dont think its a ‘limitation’ but just a clear way of starting functions, if you want it to start in the beginning place it in the first frames either on the timeline or inside another MC, isnt clear and simple ???

Its not horrible or anything, but Flash’s economy with error messages is baffling. Why wouldn’t it tell me this obvious error( now that I know it)

I am sure it all becomes second nature when you reach a certain point, but surely makes life tough for beginners in Flash.

where is the error?
you can’t use a function before it’s declared,
so just put the cat’s howl before your on(whatever)…remember, computers can only do what they’re told… :slight_smile:

Now I get it, I was just wishing Flash Compiler (?) found it worth its while to throw a ‘function called before declared’ for people (refugees) from other languages :wink:

And overall, I find it just too economical with error and warning messages, Easier to fix things when the tool helps you at least find them…

this forum is the best help yet…thank you all.