Created
February 15, 2010 05:56
-
-
Save akisute/304446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When loader has finished its loading... | |
var loaderInfo:LoaderInfo = event.target as LoaderInfo; | |
var mc:MovieClip = loaderInfo.content as MovieClip; | |
var xml:XML = describeType(mc); | |
var variable:XMLList = xml.child("variable"); | |
// Correct way, uses temporary variable | |
for each (var v:XML in variable) { | |
var name:String = v.@["name"]; | |
trace(name, mc[name]); | |
} | |
// Wrong way... Security error because mc directly invokes this.@ (and causes cross-domain policy error) | |
for each (var v:XML in variable) { | |
trace(v.@["name"], mc[v.@["name"]]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment