# Class Variable Declaration

**URL:** <https://forum.kirupa.com/t/class-variable-declaration/200374>\
**Category:** flash\
**Created:** [September 11, 2006, 7:26pm UTC](https://forum.kirupa.com/t/class-variable-declaration/200374 "2006-09-11T19:26:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)\
**Post date:** [September 11, 2006, 7:26pm UTC](https://forum.kirupa.com/t/class-variable-declaration/200374/1 "2006-09-11T19:26:07Z")

</div>

Hi,

While working on my second class, an XML controlled slideshow, a problem arose with my variable declarations:

> 

**Error** /Users/chris/Desktop/SlideShow/source/com/bushidodeep/SlideShow.as: Line 24: There is no property with the name ‘title’.  
currentSlide.title = currentSlide.attributes.title;

**Error** /Users/chris/Desktop/SlideShow/source/com/bushidodeep/SlideShow.as: Line 25: There is no property with the name ‘image’.  
currentSlide.image = currentSlide.attributes.image;

**Error** /Users/chris/Desktop/SlideShow/source/com/bushidodeep/SlideShow.as: Line 26: There is no property with the name ‘description’.  
currentSlide.description = currentSlide.attributes.description;

Total ActionScript Errors: 3 Reported Errors: 3

```auto

class com.bushidodeep.SlideShow {
	//Properties
	private var container_mc:MovieClip;
	private var image:XMLNode;
	private var title:XMLNode;
	private var currentSlide:XMLNode;
	private var description:XMLNode;
	//Used by loadImage to reference the container_mc.
	//The constructor function
	//Initializes the SlideShow instance, and performs set-up task.
	public function SlideShow(target:MovieClip, depth:Number) {
		//create an enpty movielcip to hold the loaded image.
		//store a reference to the new, empty clip in
		//the container_mc property.
		container_mc = target.createEmptyMovieClip("container_mc"+depth, depth);
	}
	//The CreateSlideShow method
	public function CreateSlideShow(slideshow_xml:XML):Void {
		//Path to the slide nodes in the XML file.
		var slideShowPictures = slideshow_xml.firstChild.childNodes;
		//Loop used to assign the picture nodes to current picture variable.
		for (var i:Number = 0; i<slideShowPictures.length; i++) {
			var currentSlide:XMLNode = slideShowPictures*;
			currentSlide.title = currentSlide.attributes.title;
			currentSlide.image = currentSlide.attributes.image;
			currentSlide.description = currentSlide.attributes.description;
		}
		container_mc.loadMovie(currentSlide.attributes.image);
		// xml object for xml content (defines sources for selections)
		var portfolio_xml = new XML();
		portfolio_xml.ignoreWhite = true;
		portfolio_xml.onLoad = function(success) {
			if (success) {
				CreateSlideShow(this);
			} else {
				trace("Error loading XML file");
			}
			// no success? trace error (wont be seen on web)
		};
		// load
		portfolio_xml.load("./slideshow.xml");
	}
}

```

Would this be caused with attempting to qualify the variables from within the XML Object, or has something else escaped this still novice class builder.
