I’m trying to moduralise and optimise some a/s from my Xmas game and have come unstuck when attempting to call a function. I’ve tidied up the code for the penguins (a function for whether they attack, and another for when they are shot), but I’m trying to do similar for the puffins, so I can have a single function that they all call. BUT … I can’t get it to work if I call the function from an onLoad event, within a call-back or from within the clip itself (scope issue?). Strangely though, the same function seems to work correctly for an onEnterFrame event e.g.
PuffinRight_mc.OnEnterFrame = resetPuffin;
or onPress mc event (although this is no use to me but would seem to indicate the function is OK!) …
I’ve attached the fla.
Essentially, I need to be able to call the resetPuffin function for several puffins for
- from within the if statement once it has gone of this screen (this._x < 50) or
- from within the puffin mc itself (last a/s frame after it has been shot) …
Can anyone help or suggest an alternative? Thanks!