Dynamic Variable Names - Need syntactical clarification

I’m familiar with the AS 2.0 and php methods of creating dynamic variable names but AS 3.0 doesn’t seem to subsribe to all of their functionality needs.

Let’s use the example below:

$infoPanelStatInitialLoc = new Object;
$infoPanelStatInitialLoc.x = $root.ui.info_panel_stats.x;
$infoPanelStatInitialLoc.y = $root.ui.info_panel_stats.y; 
 
$infoPanelKillInitialLoc = new Object;
$infoPanelKillInitialLoc.x = $root.ui.info_panel_kills.x;
$infoPanelKillInitialLoc.y = $root.ui.info_panel_kills.y; 
 
$infoPanelFactionInitialLoc = new Object;
$infoPanelFactionInitialLoc.x = $root.ui.info_panel_faction.x;
$infoPanelFactionInitialLoc.y = $root.ui.info_panel_faction.y; 

You’ll see some similarities such as the path and the variable names. What I’d like is to do something with a little less code using dynamic variable names, such as:


panelName = 'whatever';
for(var i:Number=1;i<=3;i++)
{
   this[panelName] = new Object;
   this[panelName].x = $root.ui[panelPath].x;
   this[panelName].y = $root.ui[panelPath].y; 
}
 
or perhaps like this, if you're familiar with php
 
$panelName = 'whatever';
for($i=1;$i<=3;$i++)
{
   ${$panelName} = new Object;
   ${$panelName}.x = ${'$root.ui.'.$panelPath.'.x'}; 
   ${$panelName}.y = ${'$root.ui.'.$panelPath.'.y'}; 
}

If there are minor code mistakes, forgive me. This is just psuedo code and not to be taken for exact examples. What I’m looking for is a way in which i can use my own dynamic variable names to items that aren’t necessarily added to the displayObject.

Any ideas?