I have been trying to solve the following problem for ages and I just can’t get my code work. Any help is much appreciated!
I have the following LoadVars…
identifier = new LoadVars();
var aIdentifier:Array = new Array;
identifier.onLoad = function() {
aIdentifier.push([this.pin_type, this.pin_title, this.pin_x, this.pin_y, this.pin_link]);
for(var i:Number = 0; i < aIdentifier.length; i++) {
trace(aIdentifier*[0]);
trace(aIdentifier*[1]);
trace(aIdentifier*[2]);
trace(aIdentifier*[3]);
trace(aIdentifier*[4]);
}
}
identifier.load(“getValues.php?name=value”); //The URL is defined elsewhere in the script
This all works fine i.e. each trace() outputs the code I’m expecting. The problem is that I need to access the values in the array aIdentifier inside another movieclip. When I try a trace() ouside the function I get ‘undefined’.
In the other movieclip I have the following code that needs the values from aIdentifier …
for(var i:Number = 0; i < aIdentifier.length; i++) {
var nextDepth:Number = _root.getNextHighestDepth();
_root.attachMovie(“pinAreaOriginal”, “pin”+aIdentifier*[0]+i, nextDepth);
_root.pinArea._x = trace(aIdentifier*[3]);
_root.pinArea._y = trace(aIdentifier*[4]);
}
Thank you in advance.