# What's wrong with this code?

**URL:** <https://forum.kirupa.com/t/whats-wrong-with-this-code/196458>\
**Category:** Uncategorized\
**Created:** [August 8, 2006, 4:35pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this-code/196458 "2006-08-08T16:35:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AgentOrange](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@AgentOrange](https://forum.kirupa.com/u/AgentOrange)\
**Post date:** [August 8, 2006, 4:35pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this-code/196458/1 "2006-08-08T16:35:03Z")

</div>

Hi all, can anyone spot any errors in this code? I’m trying to make the movie ‘jump’ straight to one particular point in the embedded movieclip. It’s a Flash nav for an HTML site by the way and the (var varPageLocation = ‘About’😉 part is just my way of testing to see if it’ll go straight to that part.

stop();  
var varPageLocation;  
var varPageLocation = ‘About’;  
switch (varPageLocation) {

case ‘Home’ :  
gotoAndPlay(‘Home’);  
Headers.gotoAndPlay(“Header\_HomeMC”);  
break;

case ‘About’ :  
gotoAndPlay(‘About’);  
Headers.gotoAndPlay(“Header\_AboutMC”);  
break;

case ‘Advertising’ :  
SubMenuMC.gotoAndPlay(“Advertising”);  
Headers.gotoAndPlay(“Header\_AdvertisingMC”);  
break;

case ‘Branding’ :  
SubMenuMC.gotoAndPlay(“Branding”);  
Headers.gotoAndPlay(“Header\_BrandingMC”);  
break;

default :  
stop();  
}
