The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsI know what the modifiers public, internal, protected, and private are, and how they work in relation to variables, but, being a newb to programming, I have to ask here to see if these modifiers are only for variables in classes and packages or something. The book I'm reading on AS3 seems to only be using those modifiers with variables in classes so far, and I'm wondering whether they work in non-object-oriented programming.
See, I want a variable in a movie I'm working on to be available across scenes and am looking for a way to make it so. If maybe there's some kind of modifier to use that'll make it so. And I was hoping to get the solutions both in AS2 and AS3, for some kind of educational comparison. Can anyone be gracious enough to help?
Variables declared in the timeline become part of the object whose timeline you're coding in. They'll be available whatever frame or scene you go to within that object.
I don't think you're allowed to use private/public etc for timeline variables. I guess they aren't part of the class definition so they just get dumped into the object's lookup table, which seems to be public.