# 1120 error with multiple variables

**URL:** https://forum.kirupa.com/t/1120-error-with-multiple-variables/320263
**Category:** flash
**Created:** [March 18, 2011, 12:11pm UTC](https://forum.kirupa.com/t/1120-error-with-multiple-variables/320263 "2011-03-18T12:11:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chilldog](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@chilldog](https://forum.kirupa.com/u/chilldog)
#### Post date: [March 18, 2011, 12:11pm UTC](https://forum.kirupa.com/t/1120-error-with-multiple-variables/320263/1 "2011-03-18T12:11:08Z")

</div>

Hello - I am getting multiple “access of undefined property” (1120) errors. The code that throws the error is inside a class. From the main timeline, I’m calling a function from within that class (it’s a static function) it goes something like this -

```auto
SoundPlayer.playSound()

```

In the SoundPlayer class, I declare a bunch of variables at the top like this:

```auto

public const BLINKS:Number = 0;
.
.bunch of constants here
.
public var enemy1_snd:enemy1_sound;
.
.lots of enemy(n) sounds here
.
public var sndChannel:SoundChannel

public static function playSound():void {
if (BLINKS == 1) {
   enemy1_snd = new enemy1_sound();
   sndChannel = new SoundChannel();
   sndChannel = enemy1_snd.play();
}

```

Even though I declared the variables at the beginning of the class, each variable is giving me an error.
