# Passing Global Var from swf to swf

**URL:** https://forum.kirupa.com/t/passing-global-var-from-swf-to-swf/198032
**Category:** flash
**Created:** [August 21, 2006, 10:34pm UTC](https://forum.kirupa.com/t/passing-global-var-from-swf-to-swf/198032 "2006-08-21T22:34:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rumoroso](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rumoroso](https://forum.kirupa.com/u/rumoroso)
#### Post date: [August 21, 2006, 10:34pm UTC](https://forum.kirupa.com/t/passing-global-var-from-swf-to-swf/198032/1 "2006-08-21T22:34:24Z")

</div>

sorry if this is a bit redundant, but I’m having problems with global variables… What I have is an intro swf, which has a series of buttons. If a button is selected, main.swf is loaded and a variable is passed (ie \_global.startSection=“products”). The problem I’m having is once the swf loads, I can’t seem to use this variable to control which section loads first… here is the code I have on a mc on the first frame of main.swf

```auto
onClipEvent(load){
	if(_global.startSection=="history"){
		_parent.moveSlider(45);
		_parent.linkIntro.gotoAndPlay("history");
	}
	if(_global.startSection=="products"){
		_parent.moveSlider(172);
		_parent.linkIntro.gotoAndPlay("products");
	}
	if(_global.startSection=="locations"){
		_parent.moveSlider(311);
		_parent.linkIntro.gotoAndPlay("locations");
	}
	if(_global.startSection=="press"){
		_parent.moveSlider(429);
		_parent.linkIntro.gotoAndPlay("press");
	}
	if(_global.startSection=="contact"){
		_parent.moveSlider(540);
		_parent.linkIntro.gotoAndPlay("contact");
		
	}
}

```

moveSlider is a animation function for the section. and LinkIntro plays an animation correlating with the section selected… please help, I’m about to pull my hair out!!
