I'm trying to do a basic little project as a way of teaching myself as3, and I can't even get off the ground. The goal is to have two scenes, each with their own backgrounds and descriptions, that the user can go between. Step one of that is to be able to tell the game which background to load, and I can't even get that far.

Here's what I have:

Code:
import flash.events.Event;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.sampler.NewObjectSample;
import flash.utils.getDefinitionByName;

var curScene:int = new int(1);
var sceneData:Array = new Array("BG_Day", "BG_Night");
 
startButton.addEventListener(Event.ENTER_FRAME, fl_FadeSymbolIn);
startButton.alpha = 0;
startButton.enabled = false;

function fl_FadeSymbolIn(event:Event)
{
	startButton.alpha += 0.05;
	if(startButton.alpha >= 1)
	{
		startButton.enabled = true;
		startButton.removeEventListener(Event.ENTER_FRAME, fl_FadeSymbolIn);
	}
}


startButton.addEventListener(MouseEvent.CLICK, startClick);

function startClick(event:MouseEvent):void
{

	var startRaise:Tween = new Tween(startButton, "y", Regular.easeIn, startButton.y, -100, 10, false);
	mc_bg.addEventListener(Event.ENTER_FRAME, loadCurrentScene);
}


function loadCurrentScene(event:Event):void
{
	
	var libImage:getDefinitionByName(sceneData[curScene]) = new getDefinitionByName(sceneData[curScene])();
	var currentBG:Bitmap = new Bitmap(libImage);
	mc_bg.addChild(currentBG);
	var bgFade:Tween = new Tween(mc_bg, "alpha", Regular.easeInOut, 0, 100, 100, false);
	mc_bg.removeEventListener(Event.ENTER_FRAME, loadCurrentScene)
	
}
There's nothing to it at this point. It loads with a start button, whuch when clicked is supposed to load the appropriate BG. However, I'm having a hard time getting the names of the BGs out of the array where they're stored (It works fine when hard-coded). I suspect I'm using getDefinitionByName wrong. Can anyone help? I