# Flash as2(cs3)

**URL:** <https://forum.kirupa.com/t/flash-as2-cs3/329418>\
**Category:** Uncategorized\
**Created:** [August 25, 2012, 9:34pm UTC](https://forum.kirupa.com/t/flash-as2-cs3/329418 "2012-08-25T21:34:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ame](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@Ame](https://forum.kirupa.com/u/Ame)\
**Post date:** [August 25, 2012, 9:34pm UTC](https://forum.kirupa.com/t/flash-as2-cs3/329418/1 "2012-08-25T21:34:18Z")

</div>

SORRY! I ACCIDENTALLY PUT THE WRONG TITLE FOR THREAD.  
real title: flash as2(cs3) variable to frame prob.

hi guys! im having a little trouble with my flash project.

heres the thing, im trying to add heart symbols as lives for my game

so im my scene1 i got a layer for variables and i declared:

```auto
life=3;

```

and then on another layer i created a movie clip where inside i got 3 frames.

first frame got nothing to show since i put it on alpha 0.

but i put this code to the first frame.

```auto
stop(); if (_root.life == 3) {
          gotoAndStop("3up");
     }     
    if (_root.life == 2) {
          gotoAndStop("2up");
     }    

```

where in 3up and 2up are frames 2 and 3.

here is when i change the value of the variable life which is on a button.

```auto

on(press)
{
              _root.life--; 
    }

```

i dont have any errors on compilation and i just cant see why it wont go to the 2up frame whenever i decrement 1 from life.
