Categories
Flash Flash experiments FlashBox

Flash experiments: Flashbox – part 3

Update: Check the Flashbox directory or more post about FlashBox for recent update

Lightbox Javascript to Flashbox Javascript
Bugs in the Lightbox script:

  1. Lightbox doesn’t follow when the window is scrolled, I’ve fixed this bug
  2. if no Image (broken link) is loaded, there is no way to stop this process, and you get no feedback

Bug #1: My fix for the scroll bug:


function onscrollChange ()
{
	var arrayPageSize = getPageSize ();
	var arrayPageScroll = getPageScroll ();
	var lightboxTop = arrayPageScroll [1] + (arrayPageSize [3] / 15);
	setTop ('flashcontent', arrayPageScroll [1]);

}

and in the showFlashbox function I started to check if the window is scrolled:
window.onscroll = onscrollChange;

Bug #2: This is a bug which will not be fixed in javascipt, but in Flash.

Lightbox HTML to Flashbox HTML

use this doctype in your html files, you need it if you want layers (

) to have a 100% width and height:



put the following lines in you directory structure and html:



Lightbox CSS to Flashbox CC


body,html  {height: 100%;margin: 0;padding: 0;}
#overlay{
	position: absolute;
	top: 0;
	left: 0;
	z-index: 90;
	width: 100%;
	height: 500px;
	background-color: #000;
	filter: alpha(opacity=60);
	-moz-opacity: 0.6;
	opacity: 0.6;
}
#flashcontent{
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 100;
	text-align: center;
	line-height: 0;
}