# Can't get my switch statement to work

**URL:** <https://forum.kirupa.com/t/cant-get-my-switch-statement-to-work/55932>\
**Category:** flash\
**Created:** [June 29, 2004, 5:27am UTC](https://forum.kirupa.com/t/cant-get-my-switch-statement-to-work/55932 "2004-06-29T05:27:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfriction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindfriction/32/172_2.png) [@mindfriction](https://forum.kirupa.com/u/mindfriction)\
**Post date:** [June 29, 2004, 5:27am UTC](https://forum.kirupa.com/t/cant-get-my-switch-statement-to-work/55932/1 "2004-06-29T05:27:39Z")

</div>

Hi,

Ive been looking at this for hours and I cant seem to find the bug in my coding :(. Could someone please take a look? Essentially this switch statement decides on whats passed to the preloader function “showLoading”. My “nothing test case” works (obviously), and i get the following output from the “nothing test case” trace:

[AS]  
nothing test case  
this.xmlFile: 28, this.contentUrl: 4, this.targetClip: 5  
[/AS]

```auto

switch(this.xmlFile, this.contentUrl, this.targetClip){
		case (this.xmlFile.length>3 && this.contentUrl.length>0 && this.targetClip.length>0):
			trace("case 1");
			//begin load movie
			eval(this.targetClip).loadMovie(this.contenttUrl);
			//create XML obj and load xml file
			this.xmlData=new XML();
			this.xmlData.ignoreWhite=true;
			this.xmlData.load(this.xmlFile);
			//start preloader
			this.loadComplete = setInterval(this, "showLoading", 50, this.targetClip, this.xmlFile);
			break;
		case (this.xmlFile.length<=3 && this.contentUrl.length>0 && this.targetClip.length>0):
			trace("case 2");
			eval(this.targetClip).loadMovie(this.contenttUrl);
			this.loadComplete = setInterval(this, "showLoading", 50, this.targetClip);
			break;
		case (this.xmlFile.length>3 && this.contentUrl.length<1 && this.targetClip.length<1):
			trace("case 3");
			this.xmlData=new XML();
			this.xmlData.ignoreWhite=true;
			this.xmlData.load(this.xmlFile);
			this.loadComplete = setInterval(this, "showLoading", 50, this.xmlData);
			break;
		case(this.xmlFile, this.contentUrl, this.targetClip):
			trace("nothing test case");
			trace("this.xmlFile: "+this.xmlFile.length +", "+"this.contentUrl: "+this.contentUrl.length+", "+"this.targetClip: "+this.targetClip.length);
			break;
		default:
			trace("Error: cannot continue, no content to load")
			break;
	}

```
