[AS3] proper use of square bracket?
Code:
var tipByTxt:Dictionary = new Dictionary();
tipByTxt[Game.txtpName] = "some text";
Game.txtTip.text = tipByTxt[Game[e.currentTarget.name]];//This doesnt work.
trace(e.currentTarget.name);
trace(Game);
trace(tipByTxt[Game.txtpName]);
trace(Game[e.currentTarget.name]);
/* Traces the following:
txtpName
[object MainTimeline]
some text
undefined
*/
Can anyone explain how to get the line that doesn't work to work? I don't really know how to describe this problem but I think its pretty self-explaining what syntax I'm having a problem with... The undefined is what I don't understand...