# Referencing variable on another timeline

**URL:** https://forum.kirupa.com/t/referencing-variable-on-another-timeline/68063
**Category:** flash
**Created:** [October 21, 2004, 6:02pm UTC](https://forum.kirupa.com/t/referencing-variable-on-another-timeline/68063 "2004-10-21T18:02:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Vortex2](https://avatars.discourse-cdn.com/v4/letter/v/ce73a5/32.png) [@Vortex2](https://forum.kirupa.com/u/Vortex2)
#### Post date: [October 21, 2004, 6:02pm UTC](https://forum.kirupa.com/t/referencing-variable-on-another-timeline/68063/1 "2004-10-21T18:02:07Z")

</div>

Hi gang,

I’ve got a simple scenario which has been causing some distress and confusion for me. I have a movie clip placed on the stage, which has a variable defined within it. My question is…how can I reference that variable from the \_root timeline, without instantiating any on{} statements?

Sounds simple, yes…but I’m unable to do this. I’ve tried setting the variable in a variety of ways (var, global, Object, etc). No matter how that variable is set, I simply cannot reference from the main timeline, without reading the variable in an on statement block

ex.  
trace(\_root.mcTest.strTest); // invalid

on(press) {  
trace(\_root.mcTest.strTest); // correct  
}

Thanks in advance to anybody who can enlighten me.
