Skip to main content
Participant
June 20, 2007
Question

Global Variables

  • June 20, 2007
  • 1 reply
  • 138 views
Hi guys,

So here's the thing. I have a number of nested movie clips, 8 clips, each having 3. At the bottom of each, there is a common clip that is waiting to play when it sees the correct flag. But for whatever reason, Something as simple as:


onEnterFrame = function () {
if (_global.go == 2) {
gotoAndPlay(1);
}
};

Refuses to work. On the main stage, I have this:

_global.go = 0;
btn.onRelease = function() {
_global.go = 2;
};

This is just a stipped down verion of what I'm trying to do while I debug. WHAT am I doing wrong here?
Thanks~
This topic has been closed for replies.

1 reply

Inspiring
June 20, 2007
Without seeing your fla file it is hard to troubleshoot the error.

My initial thought is that you need to make sure that you are declaring the
variable before checking its value. Also, on the onEnterFrame, where is the
gotoAndPlay(1) going? Do you mean this.gotoAndPlay(1)?


--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com <--check this

*Must Read* http://www.smithmediafusion.com/blog




"Fen4554" <webforumsuser@macromedia.com> wrote in message
news:f5bnt4$ev7$1@forums.macromedia.com...
> Hi guys,
>
> So here's the thing. I have a number of nested movie clips, 8 clips, each
> having 3. At the bottom of each, there is a common clip that is waiting to
> play
> when it sees the correct flag. But for whatever reason, Something as
> simple as:
>
>
> onEnterFrame = function () {
> if (_global.go == 2) {
> gotoAndPlay(1);
> }
> };
>
> Refuses to work. On the main stage, I have this:
>
> _global.go = 0;
> btn.onRelease = function() {
> _global.go = 2;
> };
>
> This is just a stipped down verion of what I'm trying to do while I debug.
> WHAT am I doing wrong here?
> Thanks~
>