# About Global Variables

**URL:** <https://forum.kirupa.com/t/about-global-variables/163422>\
**Category:** flash\
**Created:** [September 22, 2005, 10:53am UTC](https://forum.kirupa.com/t/about-global-variables/163422 "2005-09-22T10:53:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abus](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/abus/32/930_2.png) [@Abus](https://forum.kirupa.com/u/Abus)\
**Post date:** [September 22, 2005, 10:53am UTC](https://forum.kirupa.com/t/about-global-variables/163422/1 "2005-09-22T10:53:02Z")

</div>

In my movie I load a swf to a movieclip with this code

```php
 _root.ImageViewer.loadMovie("deneme.swf");

```

Now can I do this?

before calling the swf named deneme. When I press a button If I attain a number to a global variable with this code

```php
 
on (release) {
_global.myVar = 5;
gotoAndPlay("CloseUpAnimation");
}

```

Can I read this variable from the swf which I load into my movie?

If I can read how can I write a If Statement that will gotoAndPlay according to that variable?

```php
 If (_global.myVar=5) { 
gotoAndPlay("Animation5");
}

```

Can it be done?
