# Creating Variables

**URL:** <https://forum.kirupa.com/t/creating-variables/25586>\
**Category:** flash\
**Created:** [July 14, 2003, 6:27pm UTC](https://forum.kirupa.com/t/creating-variables/25586 "2003-07-14T18:27:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![QBA](https://avatars.discourse-cdn.com/v4/letter/q/e0b2c6/32.png) [@QBA](https://forum.kirupa.com/u/QBA)\
**Post date:** [July 14, 2003, 6:27pm UTC](https://forum.kirupa.com/t/creating-variables/25586/1 "2003-07-14T18:27:34Z")

</div>

Hi  
How flash setup a variable to handle the newly created movieclip?  
Example:

this.createEmptyMovieClip(“mymovie”,2);  
this.clientscroller.setScrollContent(mymovie);

Where did I set it up as a variable? I tried this and didn’t work either:

his.createEmptyMovieClip(“mymovie”,0);  
mymovie.createTextField(“mytext”,1,100,100,300,100);

Hope some one can help me out with this 🙂

Thanks

Alex

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 6:38pm UTC](https://forum.kirupa.com/t/creating-variables/25586/2 "2003-07-14T18:38:53Z")

</div>

[AS]  
mytext.variable = myVar  
[/AS]

that will give the textbox with the instance name mytext a variable named myVar

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2003, 5:12pm UTC](https://forum.kirupa.com/t/creating-variables/25586/3 "2003-07-15T17:12:45Z")

</div>

Sorry Dig if im crashing this thread but…

just thought I would add something for QBA

```auto

//set myMovie var to equal path to new clip
myMovie = this.createEmptyMovieClip("mymovie",0);

```

Sometimes when creating more than one movie you may want to keep track of their instance names dynamically

```auto

mcCol = new Array(20);

for(i=0;i<20;i++)
{
    mcCol* = this.createEmptyMovieClip("mc"+i,i);
}

```

blah…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2003, 5:16pm UTC](https://forum.kirupa.com/t/creating-variables/25586/4 "2003-07-15T17:16:25Z")

</div>

nice call 🙂 i thought he wanted to give atextbox a variable name

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 16, 2003, 5:08am UTC](https://forum.kirupa.com/t/creating-variables/25586/5 "2003-07-16T05:08:10Z")

</div>

🙂 ty Dig, I reread the post and I thought maybe QBA was asking about that instead of what you put in, funny though you’re post has given me some ideas for what Im working on 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 16, 2003, 5:12am UTC](https://forum.kirupa.com/t/creating-variables/25586/6 "2003-07-16T05:12:25Z")

</div>

cool 🙂
