# Calling a function to change frames in an mc on root timeline

**URL:** <https://forum.kirupa.com/t/calling-a-function-to-change-frames-in-an-mc-on-root-timeline/163774>\
**Category:** flash\
**Created:** [September 26, 2005, 6:13am UTC](https://forum.kirupa.com/t/calling-a-function-to-change-frames-in-an-mc-on-root-timeline/163774 "2005-09-26T06:13:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oli\_G](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@Oli\_G](https://forum.kirupa.com/u/Oli_G)\
**Post date:** [September 26, 2005, 6:13am UTC](https://forum.kirupa.com/t/calling-a-function-to-change-frames-in-an-mc-on-root-timeline/163774/1 "2005-09-26T06:13:44Z")

</div>

Hi all

I have created a function on the root timeline, to be called at a certain point (when the character is on a certain frame and so is the certain item, he loses a life)

So, the lives\_mc advances frame by frame to show lives being lost.

heres the function

```auto
 function loseLife(){
     if(_root.lives_mc._currentframe=1){
          _root.lives_mc._currentframe=1
     }else{
          _root.lives_mc._currentframe+=1
     }

} 

```

And here’s how it is being called

```auto
 _root.loseLife();  

```

However I can’t get the lives\_mc to move… any ideas?
