# Help with flashVars in packages

**URL:** https://forum.kirupa.com/t/help-with-flashvars-in-packages/292578
**Category:** flash
**Created:** [July 15, 2009, 10:54pm UTC](https://forum.kirupa.com/t/help-with-flashvars-in-packages/292578 "2009-07-15T22:54:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MacMediaMan](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MacMediaMan](https://forum.kirupa.com/u/MacMediaMan)
#### Post date: [July 15, 2009, 10:54pm UTC](https://forum.kirupa.com/t/help-with-flashvars-in-packages/292578/1 "2009-07-15T22:54:48Z")

</div>

I’m trying to modify a Flash file written with AS3 which sadly I’m not too familar with. I would like to pass variables to it. I can get it to work if I put this line of code in the main script area of the base .fla:

var myVar1:String = this.loaderInfo.parameters.menuID;

But I need to have this code inside a package that is in a separate .as file.

package menu{  
import flash.display._;  
import flash.events._;  
import flash.text.\*;

```
public class MainMenu extends MovieClip {
          public function MainMenu()(
                 var myVar1:String = this.loaderInfo.parameters.menuID;
    }}}(code shortened for brevity)

```

When I try this I get the error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

I kind of understand what the error means, but can’t find any solution to fix it. Can anybody help?

Thanks.
