Conrad
01-18-2006, 02:40 PM
I have a bit of code that places, and scripts, everything from ActionScript but doesn't work quite right.
Here's the code:
addWindow("mc - ButtonAdd", "mcButtonOne", 20, 300);
addWindow("mc - ButtonAdd", "mcButtonTwo", 70, 300);
mcButtonOne.onRelease = function():Void {
addWindow("mc - Burbank_NBC", "mcBurbank_NBC", 0, 0);
};
mcButtonTwo.onRelease = function():Void {
addWindow("mc - Eddie", "mcEddie", 0, 0);
};
function addWindow(sLinkage:String, sIntanceName:String, nX:Number, nY:Number):Void {
var nIndex:Number = this.getNextHighestDepth();
var mcWindow:MovieClip = this.attachMovie(sLinkage, sInstanceName, nIndex);
mcWindow._x = nX;
mcWindow._y = nY;
//trace("Adding window " + sIntanceName);
}
The problem is that the onRelease events don't work for mcButtonOne or mcButtonTwo unless I place them on the stage through the WYSIWYG. I'm sure I'm missing something rather basic, but I just don't see it.
Any help would be most appreciated!
Here's the code:
addWindow("mc - ButtonAdd", "mcButtonOne", 20, 300);
addWindow("mc - ButtonAdd", "mcButtonTwo", 70, 300);
mcButtonOne.onRelease = function():Void {
addWindow("mc - Burbank_NBC", "mcBurbank_NBC", 0, 0);
};
mcButtonTwo.onRelease = function():Void {
addWindow("mc - Eddie", "mcEddie", 0, 0);
};
function addWindow(sLinkage:String, sIntanceName:String, nX:Number, nY:Number):Void {
var nIndex:Number = this.getNextHighestDepth();
var mcWindow:MovieClip = this.attachMovie(sLinkage, sInstanceName, nIndex);
mcWindow._x = nX;
mcWindow._y = nY;
//trace("Adding window " + sIntanceName);
}
The problem is that the onRelease events don't work for mcButtonOne or mcButtonTwo unless I place them on the stage through the WYSIWYG. I'm sure I'm missing something rather basic, but I just don't see it.
Any help would be most appreciated!