controlVR.onLoadError

Availability

Flash Player 7

Edition

Flash MX 2004.

Usage

vr_mc.onLoadError = function(error:String,code:String) {

  // your statements here

}

Returns

Returns an error and code parameter

Description

The contorlVR instance will call the onLoadError for any error that may occur. The onLoadError will always return an error and code parameter.

The following table lists the errors and their codes which are applicable to the specific error.

Error Code
XMLLoadError url
XMLParseError
  • -2 A CDATA section was not properly terminated.
  • -3 The XML declaration was not properly terminated.
  • -4 The DOCTYPE declaration was not properly terminated.
  • -5 A comment was not properly terminated.
  • -6 An XML element was malformed.
  • -7 Out of memory.
  • -8 An attribute value was not properly terminated.
  • -9 A start-tag was not matched with an end-tag.
  • -10 An end-tag was encountered without a matching start-tag.
URLNotFound url
LoadNeverCompleted url
VRObjectError
  • -2 When there are not the same amount of images in each layer.

 

Example

In the following example you will have to give your controlVR instance a name vr_mc and place the following code in the main timeline. The following code will generate a text field that will display any error that the vr_mc instance may generate.


vr_mc.onLoadError = function(error ,code){

	this.createTextField("error_txt",this.getNextHighestDepth(),1, 50, 200, 100);

	this.error_txt.multiline = true;

	this.error_txt.wordWrap = true;

	this.error_txt.border = true;

	this.error_txt.background = true;

	trace(error+code)

	if(error == "XMLLoadError"){

		this.error_txt.text += "sdfdfsgfd"+" : "+code+"\n";

	}

	if(error == "XMLParseError"){



		switch (code){

			case "-2" : this.error_txt.text += error+" A CDATA section was not properly terminated.\n";

				break;

			case "-3" : this.error_txt.text += error+" The XML declaration was not properly terminated.\n";

				break;

			case "-4" : this.error_txt.text += error+" The DOCTYPE declaration was not properly terminated.\n";

				break;

			case "-5" : this.error_txt.text += error+" A comment was not properly terminated.\n";

				break;

			case "-6" : this.error_txt.text += error+" An XML element was malformed.\n";

				break;

			case "-7" : this.error_txt.text += error+" Out of memory.\n";

				break;

			case "-8" : this.error_txt.text += error+" An attribute value was not properly terminated.\n";

				break;

			case "-9" : this.error_txt.text += error+" A start-tag was not matched with an end-tag.\n";

				break;

			case "-10" : this.error_txt.text += error+" An end-tag was encountered without a matching start-tag.\n";

				break;

		}

	}

	if(error == "URLNotFound"){

		this.error_txt.text = error+" : "+code+"\n";

	}

	if(error == "LoadNeverCompleted"){

		this.error_txt.text = error+" : "+code+"\n";

	}

	if(error == "VRObjectError"){

		switch (code){

			case "-2" : this.error_txt.text += error+" Not the same amount of images per layer.\n";

				break;

		}

	}

}