# Driving me nutz! PAssing vriables from menu.swf to viewer.swf

**URL:** https://forum.kirupa.com/t/driving-me-nutz-passing-vriables-from-menu-swf-to-viewer-swf/185760
**Category:** flash
**Created:** [April 16, 2006, 7:42am UTC](https://forum.kirupa.com/t/driving-me-nutz-passing-vriables-from-menu-swf-to-viewer-swf/185760 "2006-04-16T07:42:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![scopa](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@scopa](https://forum.kirupa.com/u/scopa)
#### Post date: [April 16, 2006, 7:42am UTC](https://forum.kirupa.com/t/driving-me-nutz-passing-vriables-from-menu-swf-to-viewer-swf/185760/1 "2006-04-16T07:42:58Z")

</div>

sorry about the horrible spelling on the title. sheesh!

So basically, I have a navigation.swf file with a large menu. I’ve set up a product\_viewer.swf so that once a couple variables are defined, the viewer displays the correct images/descriptions.

I want a button in the navigation to set 4 variables and pass them to the loaded product viewer

This is what I THOUGHT would work:

```auto

//FROM THE NAVIGATION.SWF
on (release) {
    _global.cat1:String = "hom";
    _global.cat2:String = "fur";
    _global.cat3:String = "cab";
    _global.cat4:String = "page1";
    _level0.loadContent("product_viewer.swf");
}

```

So… I was thinking I could set up each button so that they set these 4 global variables. If the variables are global, then shouldn’t the product\_viewer.swf read them? Do I need to add in any special code to the first frame of product\_viewer?

---

<div class="post-metadata">

### Author: ![rhamej](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rhamej](https://forum.kirupa.com/u/rhamej)
#### Post date: [April 16, 2006, 5:10pm UTC](https://forum.kirupa.com/t/driving-me-nutz-passing-vriables-from-menu-swf-to-viewer-swf/185760/2 "2006-04-16T17:10:55Z")

</div>

You should be able to call cat1 from anywhere in the movie since it’s global. =)  
ie;

```auto

home.text=cat1

```

The text field should display “hom” .
