# Using Variables

**URL:** https://forum.kirupa.com/t/using-variables/306349
**Category:** Uncategorized
**Created:** [March 13, 2010, 4:19pm UTC](https://forum.kirupa.com/t/using-variables/306349 "2010-03-13T16:19:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Enjoyed](https://avatars.discourse-cdn.com/v4/letter/e/eb8c5e/32.png) [@Enjoyed](https://forum.kirupa.com/u/Enjoyed)
#### Post date: [March 13, 2010, 4:19pm UTC](https://forum.kirupa.com/t/using-variables/306349/1 "2010-03-13T16:19:10Z")

</div>

Hello,

I’m very new to AS3 having just converted from AS2 which I knew at a basic level.

I’m attempting to use variables, received through xml sockets, to control movie clips and the main timeline.  
I had a few things working, such as the height and width of a movie clip being changed by the variables but I want to also use the variable to simply trigger the creation and playing of movie clips in my library. For example, a “16” comes into flashVar4 and as a result, a movie clip called Circle plays on the stage.

Any help would be much appreciated.

With regards to the control of the main timeline, I currently have the following script…

addEventListener(Event.ENTER\_FRAME,colourSel,false,0,true);  
function colourSel (e:Event){  
MovieClip(root).gotoAndStop(flashVar12);  
}

But despite changing the numbers which are being read into ‘flashVar12’, the main timeline remains on frame 1.

I’m not sure why that’s not working though I wonder if it has something to do with the variable being updated? Do I need something that constantly tells the function to check the variable again?

Thanks,

Peter.
