# Questions on Varibles

**URL:** <https://forum.kirupa.com/t/questions-on-varibles/867>\
**Category:** Uncategorized\
**Created:** [August 1, 2002, 3:34am UTC](https://forum.kirupa.com/t/questions-on-varibles/867 "2002-08-01T03:34:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![way0end](https://avatars.discourse-cdn.com/v4/letter/w/c2a13f/32.png) [@way0end](https://forum.kirupa.com/u/way0end)\
**Post date:** [August 1, 2002, 3:34am UTC](https://forum.kirupa.com/t/questions-on-varibles/867/1 "2002-08-01T03:34:18Z")

</div>

a varible is declared and initialized on main stage…  
how do you access this varible through a symbol? i.e while you are editing the symbol…

a varible is declared and initialized on a symbol…  
how do you access this varible on main stage? i.e. while you are in main…

this is confusing little, but, can someone please clear it to me?

:  
::  
::::Thank:::::::::::::::::::::::::::::::::::::::-\>\>\>you.  
::  
:

---

<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:** [August 1, 2002, 3:45am UTC](https://forum.kirupa.com/t/questions-on-varibles/867/2 "2002-08-01T03:45:55Z")

</div>

I’m not sure I understand your question, but…

variables on the main stage are best accessed using

\_root.variablename

variables inside a symbol (movieclip or button) are accessed using

instancename.variablename

hope that helps.

---

<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:** [August 1, 2002, 4:24am UTC](https://forum.kirupa.com/t/questions-on-varibles/867/3 "2002-08-01T04:24:39Z")

</div>

imagine this:

i make a new Movie Symbol called “Something”, with a box in it.

while inside editing the symbol, i add three keyframes:  
on keyframe 1, i add: a = 0;  
on keyframe 2, i add: a++;  
on keyframe 3, i add: while(a \< 100){gotoAndPlay(2);};

now i am out of “Something” back to main stage.  
and i put an instance of “Something” on stage.

::here is the point::

on main stage, i add a input text called “text”;

somehow, i want this “text” show the value of ‘a’ on “Something”.

and the other way around, if i wanted to see a varible on main stage thorugh a movie clip, such as an input text on “Something” to show a varible on main stage…

* * *

* * *

i know something i’m doing wrong, or understanding wrong, that is why it’s not working… as i tried so many variation…

\_root.Something.a; not worked…  
\_root.Something:a; not worked…  
\_root:Something:a; not worked…

please help…  
thanks…

* * *

* * *

---

<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:** [August 1, 2002, 9:12am UTC](https://forum.kirupa.com/t/questions-on-varibles/867/4 "2002-08-01T09:12:04Z")

</div>

ok, i finally got somewhere through some research…  
but only a part of this Post…

to access a variable on main stage from within a movie clip you use:

\_parent.variablename;

…

i am still waiting for a reply on how to get to a variable declared inside a movie clip from within main stage… the \_root.

please if you got some idea reply…

thanks many times.

---

<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:** [August 1, 2002, 11:56am UTC](https://forum.kirupa.com/t/questions-on-varibles/867/5 "2002-08-01T11:56:35Z")

</div>

Hi,

I’m not sure I understand the question either, but the following may help you:

Instead of using an input text field, you could try a dynamic text field, with the variable \_root.Something.a specified.

Instead of the while loop, you could try an if statement:  
frame 1: a = 0;  
frame 2: a++;  
frame 3: if(a \< 100) {  
gotoAndPlay(2)  
} else {  
stop();  
}

Ensure that the instance of movie clip “Something” is named “Something”

Good luck
