if i include an external actionscript file in frame one of my
movie, then [as you'd expect] all the functions, global variables
etc contained in that external AS file are available throughout my
movie - with one notable exception.
if i add a button to the stage - in a frame other than frame
one - whose onRelease handler is defined in the external AS, the
function is not called when the button is clicked - i have to
re-include the external AS file again on the frame in which the
button resides, in order for the buttons function to be called.
anyone know why this is - and if there's a way round it?
how come all the other functions in the AS persist across all
frames and all timelines in the movie, but the button handlers only
seem to be available on the actual frame in which the AS file is
I think you and I are dealing with similar issues and the
root cause is referred to as "scope." The only difference between
your and my problems is that your code is in an external as file
and mine is on the timline. But in both instances, code that should
work doesn't. Robert Reinhardt has covered this in an article at
He is the author of the Flash Actionscript Bible series and so
knows what he is talking about. I have been studying it for an hour
and darn if I can understand the second page of it. I've asked for
help myself about this at