How do you access an associate array using a variable?

Inside my function popup["text"]; won't access the array. I can't find any information in the books I have Actionsript Cookbook and Actionscript for Flash MX.

Anyone dealt with this before?

// Define the text and titles for the popups
var myarray = { text: "Lorem ipsum dolor sit amet ..." };

// Testing - this works!
trace(myarray["text"]);

// Show the popup
function showPopup(popup) {
        mainMap[popup].gotoAndPlay("on");
        mainMap[popup].label_title.text = popup["text"];  // This doesn't work.
        trace(popup["text"]);
};

showPopup("myarray");
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to