Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akisute/285555 to your computer and use it in GitHub Desktop.
Save akisute/285555 to your computer and use it in GitHub Desktop.
// TEST CODE
var abesi = {
"hidebu": {
"loginPage": this.loginPage,
"tawaba": 1
},
"itterebo": 2
};
trace(abesi);
trace(abesi.hidebu.loginPage, abesi["hidebu"].loginPage, abesi["hidebu"]["loginPage"], abesi["hidebu.loginPage"]);
/* result is... OMG didn't make it
[object Object]
[object LoginPage] [object LoginPage] [object LoginPage] undefined
*/
// So I have to make a workaround like this...
var tokens = "hidebu.loginPage".split(".");
var targetObj = abesi;
for each (var token:String in tokens) {
trace (targetObj, token);
targetObj = targetObj[token];
}
trace(targetObj, targetObj.addChild);
/* result is... looks like it's working
[object Object] hidebu
[object Object] loginPage
[object LoginPage] function Function() {}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment