# Sending variables when movieclip is clicked

**URL:** <https://forum.kirupa.com/t/sending-variables-when-movieclip-is-clicked/322847>\
**Category:** flash\
**Created:** [June 5, 2011, 9:34pm UTC](https://forum.kirupa.com/t/sending-variables-when-movieclip-is-clicked/322847 "2011-06-05T21:34:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipegm](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@felipegm](https://forum.kirupa.com/u/felipegm)\
**Post date:** [June 5, 2011, 9:34pm UTC](https://forum.kirupa.com/t/sending-variables-when-movieclip-is-clicked/322847/1 "2011-06-05T21:34:04Z")

</div>

I´m trying to send variables when a movieclip is clicked and use some frames later.

```auto

function langFr(e:MouseEvent):void{
	var language = "fr";
	play();
}

```

When the button is clicked, the movie plays until frame 10, where there´s the code:

```auto

if (language == "fr"){
trace ("French")
}

```

but it´s not working. I imagine that because I´m creating the variable inside the function and trying to read it outside. But how can it be done?
