Passing a variable as an Object (Actual data is XML)

I’ve a function to generate a tree, reading data from an XML file. That is something like this. I just mentioned only the passing values…


function dispTree (str, loop) {
body of function here // That is working properly

}

Another movieclip on the stage that is populated with duplicate buttons to see the tree.
Each button has an attached variable to hold the data


_root.picAttach["picHolder" add i].viewRelation.onRelease = function ( ) {
_root.dispTree (this.gourlOne, int (this.gourlTwo));
}

While passing the variables i’m not getting the generated tree. Nothing happens while click on the button. But instead of passing varibles directly passing the xml property the tree is generated.

I’ve tried to check which object is passing directly something like this


function dispTree (str, loop) {
trace (typeof (str); // this displays Object
trace (typeof (loop); //This displays Number 

body of function here // That is working properly

}

The second variable i’ve successfully passed but the first variable still return as string. How to i tranfer that to Object before passing the value, I’ve tried this method but failed


_root.picAttach["picHolder" add i].viewRelation = function ( ) {
_root.dispTree (new Object (this.gourlOne), int (this.gourlTwo)); //Returns Object as first variable but no result
}

Any suggestion will really appreciable. I’m moving with sinking spirits :crying: