# How to pass variable between action script files?

**URL:** <https://forum.kirupa.com/t/how-to-pass-variable-between-action-script-files/311460>\
**Category:** Uncategorized\
**Created:** [July 7, 2010, 7:38am UTC](https://forum.kirupa.com/t/how-to-pass-variable-between-action-script-files/311460 "2010-07-07T07:38:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasukexkun](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sasukexkun](https://forum.kirupa.com/u/sasukexkun)\
**Post date:** [July 7, 2010, 7:38am UTC](https://forum.kirupa.com/t/how-to-pass-variable-between-action-script-files/311460/1 "2010-07-07T07:38:39Z")

</div>

I am new in AS3 and i need to learn how to pass variables from one Movie clip’s AS file to my Main AS file.

Let say my Movieclip’s AS file is calling damage = 1;

so how the Main AS file retrieve the damage value from the Movieclip’s AS? :puzzled:

hope my explanation is very clear and understandable.

thanks in advance!

```auto
 public class robotMC extends MovieClip
    {

        public function robotMC()
        {
           addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
           
        }
                private function loop(e:Event) : void 
        {
    
            
            if(currentLabel == "attack1"){
                    
                    daamage = 1;
                    }
        }

```

this is the sniplet of my code for my Movieclip’s AS file
