# Whats wrong with \_GLOBAL.....?

**URL:** <https://forum.kirupa.com/t/whats-wrong-with--global/7832>\
**Category:** flash\
**Created:** [November 8, 2002, 4:28pm UTC](https://forum.kirupa.com/t/whats-wrong-with--global/7832 "2002-11-08T16:28:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShinFu](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@ShinFu](https://forum.kirupa.com/u/ShinFu)\
**Post date:** [November 8, 2002, 4:28pm UTC](https://forum.kirupa.com/t/whats-wrong-with--global/7832/1 "2002-11-08T16:28:30Z")

</div>

I want a global var for selecting sounds (0 = no sound, 1 = loop1, 2 = loop2,…). a mc indicates what sound is selected but that mc  
doesnt do anything:

Main Timeline  
Action Keyframe 1 (only one frame):

\_global.SoundLfo1 = 0;

Sub.Sub.Sub Button  
Action in the Button:

on (press) {  
if (\_global.SoundLfo1 = 0 ) {  
this.attachMovie(“wave”, “waveactive”, 5);  
}  
}

i cant see any wave  
if i delete the if thingy i can see the wave…☹  
there is lots a code missing for the sound implementation but  
if this \_global doesnt work i doesnt want to push it forward  
anymore…:\*(

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 8, 2002, 7:04pm UTC](https://forum.kirupa.com/t/whats-wrong-with--global/7832/2 "2002-11-08T19:04:26Z")

</div>

i think you’re meaning to use “==” in your if statement

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 9, 2002, 11:11am UTC](https://forum.kirupa.com/t/whats-wrong-with--global/7832/3 "2002-11-09T11:11:11Z")

</div>

yes…  
its a comon mistake of lot of people… using asign (=) insted of equalation test (==)… actualy I do this mstake often to… you get a zero in your if statment and c language like pprograms stati it ash FALSE.

🙂 hare is one trick… : use::  
if ( 0 == \_lobal.SoundLfo1){}

…

if you mis and tipe

if ( 0 = \_lobal.SoundLfo1){} ypu get an error as you cant asign value to a number…

GL.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 9, 2002, 11:27am UTC](https://forum.kirupa.com/t/whats-wrong-with--global/7832/4 "2002-11-09T11:27:59Z")

</div>

thx a lot…it works now =)
