All pastes #197660 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-10-11 13:14 UTC
rendered paste body
var objectsOut:Number = 0;
var spacing:Number = 10;
var nextX:Number = spacing;
var maxHeight:Number = menubar._y - 35;
var objects:Array = Array();
var contentHolder:MovieClip = createEmptyMovieClip("contentHolder", _root.getNextHighestDepth());
contentHolder._x = 0;
contentHolder._y = 35;

function closeAllContentBoxes() {
	trace("Total Objects: " + objectsOut);
	trace("Objects: " + objects.length);
}
function resizeAllContent() {
	
}

function showBox(bWidth) {
	
	var tempMovie:MovieClip = contentHolder.attachMovie("cb", "cb"+objectsOut, contentHolder.getNextHighestDepth());
	bHeight = Stage.height - 35 - 100;

	tempMovie.fill._height = 0;
	tempMovie.fill._width = bWidth - 10;
	
	tempMovie.back._height = 0;
	tempMovie.back._width = bWidth;

	tempMovie._x = nextX;
	
	var fHeight:Number = bHeight - 10;
	
	tempMovie.onEnterFrame = function() {
		this._visible = true;
		if(this.back._height >= bHeight) { this.back._height = bHeight; }
		else { tempMovie.back._height += 10; }
		if(this.back._height > bHeight-50) {
			if(this.fill._height >= fHeight) { this.fill._height = fHeight; delete tempMovie.onEnterFrame; }
			else { this.fill._height += 15 ; }
		}
		tempMovie.fill._width = bWidth - 10;
	}
	objects[objectsOut].bWidth = bWidth;
	objects[objectsOut].xPos = nextX;
	trace("Object is: "+objects);
	trace("Object bWidth is: "+objects[objectsOut].bWidth);
	nextX += bWidth + 10;
	objectsOut++;
}

top_right.bginfo_button.onRelease = function() {
	showBox(300);
	resizeAllContent();
}