• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flash AS 2 One global variable updates fine in a Symbol the other not...

New Here ,
Jun 07, 2017 Jun 07, 2017

Copy link to clipboard

Copied

Flash makes my brain melt. I really have no ide whats going wrong -.-

I have two global variables:

_global.IsGreat = 0;

_global.Bronze = 0;

Both are updatet in my Maincode...

The working one:

if (Maske._y <= DrittelMaske)
{
_global.Bronze = 1;
trace ("Bronze " + Bronze);
Mask_n_v._alpha = 0;
Mask_s_v._alpha = 0;
Mask_m_v._alpha = 100;
Schnell = 0;
//Normal._alpha = 0;
//Mittel._alpha = 100;
//Schnell._alpha = 0;
}

The Symbol that reacts...

if (_global.Bronze == 0)

{

  gotoAndPlay (1);

}

else

{

  gotoAndPlay (3);

}

if (player._y <= PlayerLowest) //Best Position!
{
IsGreat = 1;
trace ("IsGreat " + IsGreat)
}

- In the Mainscene "IsGreat" gets an update and changes to 1 when the Position is reached... But no alternate Animation from frame 10 of the symbol is played...

In the Symbol that doesn't react

if (_global.IsGreat == 0)
{
gotoAndPlay (1);
}
else
{
gotoAndPlay (10);
}

I had it onece in a while that I had to delete and paste code in aain that flash got it that I changed something... but this isn*t working at ALL!

I don't get what the problem is.

Both variables are updating in the maincode just fine. But the "new" global" doesn't want to update...

I am glad for any helü. I had this "updating" problem several times the last days and I really have no idea what I have to do that the codes get the link between the symbol and the code

TOPICS
ActionScript

Views

339

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

LATEST

isGreat is not the same as _global.isGreat

ie, if you want to use global variables use the fully qualified name.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines