# Accessing main timeline variable in .as file

**URL:** https://forum.kirupa.com/t/accessing-main-timeline-variable-in-as-file/283676
**Category:** flash
**Created:** [March 9, 2009, 9:42pm UTC](https://forum.kirupa.com/t/accessing-main-timeline-variable-in-as-file/283676 "2009-03-09T21:42:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flashdaddy](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@flashdaddy](https://forum.kirupa.com/u/flashdaddy)
#### Post date: [March 9, 2009, 9:42pm UTC](https://forum.kirupa.com/t/accessing-main-timeline-variable-in-as-file/283676/1 "2009-03-09T21:42:53Z")

</div>

Hi All,

I’m running into something that has me stumped. I’m trying to access a variable that I’ve added on my main timeline. I’m trying to access that variable in my .as file. I’ve been doing some research, and it said to use:

```auto
root.loaderInfo.parameters.yourVariableName

```

but when I try that and run a trace, I get “undefined”. It seemed to have worked for someone else (where I was reading the post) but it’s not working for me. Is there something I’m doing wrong?

My code is something like this:  
Main Timeline

```auto
var stage_height:Number = stage.stageHeight;

```

.as File

```auto
trace(root.loaderInfo.parameters.stage_height)

```

result:  
undefined

(Note: The stage.stageHeight changes on resize, which is set on the Main Timeline, that’s why I’m not calling stage.stageHeight directly from the .as file) Can someone tell me what I’m doing wrong?
