# TypeError: Error #1010: A term is undefined and has no properties

**URL:** <https://forum.kirupa.com/t/typeerror-error-1010-a-term-is-undefined-and-has-no-properties/283496>\
**Category:** Uncategorized\
**Created:** [March 6, 2009, 10:16pm UTC](https://forum.kirupa.com/t/typeerror-error-1010-a-term-is-undefined-and-has-no-properties/283496 "2009-03-06T22:16:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anix](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anix](https://forum.kirupa.com/u/anix)\
**Post date:** [March 6, 2009, 10:16pm UTC](https://forum.kirupa.com/t/typeerror-error-1010-a-term-is-undefined-and-has-no-properties/283496/1 "2009-03-06T22:16:07Z")

</div>

All of my code is listed below as long as the file name the code is located in:

**Gallery.fla**  
[AS]  
import caurina.transitions._;  
import fl.transitions.Tween;  
import fl.transitions.easing._;  
import flash.display.MovieClip;

include “Actions/GalleryActionscript/initial\_variables.as”;  
include “Actions/GalleryActionscript/load\_swfs.as”;  
include “Actions/GalleryActionscript/menu.as”;

stop();[/AS]

**initial\_variables.as**

[AS]var mainBox:MovieClip = new MovieClip();  
addChild(mainBox);

var fadeIn:Tween;  
//trace(fadeIn);  
var maxIndex:Number = this.numChildren - 1;

var URLvar:String = “XML/gallery.xml”;  
var totalSwfs:Number;  
var SWFPathList:Array = [];  
var mainSwfPlacementX:Number;  
var mainSwfPlacementY:Number;

loadXML();[/AS]

**menu.as**

[AS]menu.x = -230;  
menu.menubttn.addEventListener(MouseEvent.CLICK, loadMenu);

function loadMenu(e:Event):void  
{  
if(menu.x \< -1)  
{  
Tweener.addTween(menu, {x:0, time:2});  
setChildIndex(menu, numChildren - 1);  
}  
else{  
Tweener.addTween(menu, {x:-230, time:2});  
}  
}  
[/AS]  
**load\_swfs.as**

[AS]//This file will load all the swf’s once the buttons have been clicked

function loadXML(){

```
var xmlURLLoader:URLLoader = new URLLoader();//Creates a new URLLoader
var xmlURLRequest:URLRequest = new URLRequest( URLvar );//Creates a URL request and uses the var in "initial_variables" as the loaded file

xmlURLLoader.load(xmlURLRequest);//uses the URL Loader to load in the file from the URLRequest

xmlURLLoader.addEventListener(Event.COMPLETE, sortXml);//Event listener to listen for the xml file to be loaded

//Function that starts when the xml file is loaded
function sortXml(event:Event):void
{
    var xmlData:XML = new XML(xmlURLLoader.data);//variable to store the xml data
    var a:Number = xmlData.swf_path.length();//Creates a number the length of the files in the xml
    totalSwfs = a;//Sets the totalPics variable to the number of files in the xml by using the "a" variable
    
    var b:Number = 0;//Creates a variable number and sets it to 0
    
    //A while loop that pushes each piece of data in the xml into the preset arrays one at a time
    while(b &lt; a)
    {
        SWFPathList.push(xmlData.swf_path**);
        trace(SWFPathList);
        b = b + 1;//increments b by 1 until it reaches the amount of files in the xml
    }//End of while loop
    
    var randNum:Number = Math.round(Math.random()* (totalSwfs - 1));//Creates a randome number between 0 and the total number of files
    trace(SWFPathList[randNum]);
    var mainLoader:Loader = new Loader();//Creates a new loader for the main content
    var mainRequest:URLRequest = new URLRequest( SWFPathList[randNum] );//Creates a URLRequest for the the picture path list and selects a picture at random.        
    
    mainLoader.load(mainRequest);
    mainBox.addChild(mainLoader);
    mainLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedMain);
    
    //This function initiates when the image completely loads in
    function loadedMain(event:Event):void
    {
        //This sets the mainPicPlacementX to be the value of the equation below this is so that if the stage is resized the image will be moved
        mainSwfPlacementX = 5;
        mainSwfPlacementY = 10;
        //mainBox.addChild(mainLoader);//This adds the mainLoader(large image) to the mainPicBox
        mainBox.x = mainSwfPlacementX;//This sets the x location of the mainpic box to be the value of the mainPicPlacementX var
        mainBox.y = mainSwfPlacementY;//This sets the y location of the mainpic box to be the value of the mainPicPlacementY var
        fadeIn = new Tween(mainBox, "alpha", None.easeNone, 0, 1, 30, false);//This creates a Fade effect for the pics as they are loaded in
        
        
        
    }
    
    
    
}

```

}  
////////////////////////////////////////////////  
//Event Listeners for button clicks  
menu.satin.addEventListener(MouseEvent.CLICK, satinLoad);  
menu.machining.addEventListener(MouseEvent.CLICK, machiningLoad);  
menu.satin.addEventListener(MouseEvent.MOUSE\_OVER, satinOver);  
menu.satin.addEventListener(MouseEvent.MOUSE\_OUT, satinOut);  
menu.machining.addEventListener(MouseEvent.MOUSE\_OVER, machiningOver);  
menu.machining.addEventListener(MouseEvent.MOUSE\_OUT, machiningOut);  
menu.challenger.addEventListener(MouseEvent.CLICK, benchingLoad);

////////////////////////////////////////////////

////////////////////////////////////////////////  
//Functions for button clicks

function satinLoad(event:MouseEvent):void  
{  
mainBox.removeChildAt(0);  
var mainLoader:Loader = new Loader();//Creates a new loader for the main content  
var mainRequest:URLRequest = new URLRequest( SWFPathList[1] );//Creates a URLRequest for the the picture path list and selects a picture at random.

```
mainLoader.load(mainRequest);
mainBox.addChild(mainLoader);

```

}

function machiningLoad(event:MouseEvent):void  
{  
mainBox.removeChildAt(0);  
var mainLoader:Loader = new Loader();//Creates a new loader for the main content  
var mainRequest:URLRequest = new URLRequest( SWFPathList[2] );//Creates a URLRequest for the the picture path list and selects a picture at random.

```
mainLoader.load(mainRequest);
mainBox.addChild(mainLoader);

```

}

function benchingLoad(event:MouseEvent):void  
{  
mainBox.removeChildAt(0);  
var mainLoader:Loader = new Loader();//Creates a new loader for the main content  
var mainRequest:URLRequest = new URLRequest( SWFPathList[0] );//Creates a URLRequest for the the picture path list and selects a picture at random.

```
mainLoader.load(mainRequest);
mainBox.addChild(mainLoader);

```

}

function satinOver(evt:MouseEvent):void  
{  
menu.satin.gotoAndStop(2);  
}

function satinOut(evt:MouseEvent):void  
{  
menu.satin.gotoAndStop(1);  
}  
function machiningOver(evt:MouseEvent):void  
{  
menu.machining.gotoAndStop(2);  
}

function machiningOut(evt:MouseEvent):void  
{  
menu.machining.gotoAndStop(1);  
}  
/////////////////////////////////////////////////[/AS]

Please can some1 help me with this issue as i cant find the problem? thanks
