# The fantastical Disappearing variable

**URL:** <https://forum.kirupa.com/t/the-fantastical-disappearing-variable/328500>\
**Category:** flash\
**Created:** [May 21, 2012, 4:34pm UTC](https://forum.kirupa.com/t/the-fantastical-disappearing-variable/328500 "2012-05-21T16:34:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheOtherTedium](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@TheOtherTedium](https://forum.kirupa.com/u/TheOtherTedium)\
**Post date:** [May 21, 2012, 4:34pm UTC](https://forum.kirupa.com/t/the-fantastical-disappearing-variable/328500/1 "2012-05-21T16:34:01Z")

</div>

## **Solved**

Here’s the code:

```auto

//SentientBeing-specific functions loop for all sentientBeings
        for (var n:int = 0; n < sentientBeings.length; n++)
        {
            var subject:MovieClip = sentientBeings[n];
            setDynamicValues();
            updateSentientMovement();
            if (shrapContainer.length != 0)
            {
                updateShrapMovement();
            }
        }

```

I’ve defined the variable ‘subject’, yet I get an error saying that the subsequent functions, which use it later, are accessing an undefined property.
