Welcome aboard,
Scope isn't the issue here. The problem is that your second trace actually fires before the xml is loaded, at which point your variable still has no value.
You need to wait until the xml is fully loaded. For example, this would probably do the trick:
ActionScript Code:
var XML4:XML = new XML();
var pathtologo:String;
XML4.ignoreWhite = true;
XML4.onLoad = function(success) {
if (success) {
pathtologo = this.firstChild.childNodes[3];
trace("(1) Path to logo is: "+pathtologo);
}
};
XML4.load("common.xml");
this.onEnterFrame = function() {
if (pathtologo) {
trace("(2) Path to logo is: "+pathtologo);
delete this.onEnterFrame;
}
};