# Problem with switch/case, or ? something ! help please?

**URL:** <https://forum.kirupa.com/t/problem-with-switch-case-or-something-help-please/217397>\
**Category:** Uncategorized\
**Created:** [February 26, 2007, 5:13pm UTC](https://forum.kirupa.com/t/problem-with-switch-case-or-something-help-please/217397 "2007-02-26T17:13:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benswift](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@benswift](https://forum.kirupa.com/u/benswift)\
**Post date:** [February 26, 2007, 5:13pm UTC](https://forum.kirupa.com/t/problem-with-switch-case-or-something-help-please/217397/1 "2007-02-26T17:13:26Z")

</div>

I have a menuing system which loads XML to populate itself, upon clicking a menu item, it sends an html string to the following function:

```auto
_global.loadHTMLpage = function(htmlToLoad){
	thumbpath.text = htmlToLoad;
	gallerypath.text = typeof(htmlToLoad);
	switch (htmlToLoad){
		case "/Projects/Photo_Gallery.htm":
			if(behind_logo._y != 138){
				glide(contentYwithGallery);
			}else{
				//glide(contentYwithGallery);
				}
			projectsPage();
		break;
		case "/Specialties/index.htm":
			if(behind_logo._y != 138){
				glide(contentYwithGallery);
			}else{
				//glide(contentYwithGallery);
				}
		break;
		default:
			if(behind_logo._y != 38){
				glide(contentY);
			}else{
				}
			closeProjectPhoto();
			content_loader.removeMovieClip();
			nextHTML = htmlToLoad;
			test_next.text = nextHTML;
			content_loader.attachMovie("textArea", "content", 10);
		break;
		}
}

```

ok- if I specify in the AS something like : loadHTMLpage("/"+selectedArea+"/index.htm");  
(for example: “Specialties/index.htm”)

thumbpath shows : Specialties.index.htm (correct)  
gallerypath shows : string (correct)  
and the correct area loads and everything works correctly

However, when the “loadHTMLpage” command comes from the dynamic menu  
thumbpath shows : Specialties.index.htm (correct)  
gallerypath shows : string (correct)  
the correct area does not load…

So- I am thinking that the Switch/case is not able to equate the two values (htmlToLoad to the given value in the “case”)

is there something I’m missing? types match up, traces look right, text output looks right, but I can’t figure it out!

help!
