All pastes #198997 Raw Edit

Someone

public text v1 · immutable
#198997 ·published 2006-10-12 09:17 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(this["cb"+i]);
	for(i=0;i<objects.length;i++) {
		this["cb"+i]._visible = false;
	}
	
}
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] = new Object();
	objects[objectsOut].bWidth = bWidth;
	objects[objectsOut].xPos = nextX;
	nextX += bWidth + 10;
	objectsOut++;
}

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