|
Here are directions to setting up a website with the Flashblocks Developer Gallery
Note: Flashblocks ML comes with a gallery slide show module that is much simpler to use and customize.
Placing a gallery in a new Flash document.
- Start by copying the flashblocks folder into a new Flash document
- Then drop and position the "linked library items" movie clip at 0x0 in the upper left corner of the stage. This contains the Flashblocks engine and references to the linked library items and embeded font outlines.
- Drop a "flashblock" editblock movie clip, on the stage, on the frame following the Flashblocks engine. Give it a unique instance name.
- Drop two "blank" movie clips onto the stage near the blue flashblock instance. Give the first blank movie clip the instance name, "theGallery", and the second, "f". These are placeholders for the gallery thumbnails and the full size images respectively.

Editing the new Gallery
- From the editor menu, Login
- From the editor menu, Turn the advanced editor ON.
- Select "Parameters/Modules", then select "Gallery", then enter the path to your directory of images. In the blank _developer demo, this path is, "flashblocks/g1"
- From your website, click on the editblock and watch the thumbnails appear.
Customizing the Gallery
You may edit the "pc gallery" to change how things layout. Some lines of interest are:
change the size of the thumbnails. (delete old thumbs first)
new_width = 50;
new_height = 50;
This is the function that lays out the thumbnails.
function drawGallery() {
}
These lines tell the gallery to crop and resize the thumbs to the desired size.
send_lv.boxCrop = "true";
send_lv.boxResize = "true";
Auto opening the Gallery
Here is an example of actionscript to auto open the thumbnails and finally the first full size image. In the code below "galler1" refers to the instance name of the flashblocks containing the gallery module.
openGallery(gallery1)
// AUTOMATE THE OPENING OF A GALLERY AND THE OPENING OF THE 1ST IMAGE IN THE GALLERY
function openGallery (galleryMC) {
var autoOpenCount=0
var p
this.onEnterFrame = function () {
if ((autoOpenCount++)==20) galleryMC.onPress() // OPEN GALLERY
else if (autoOpenCount==40) { // OPEN 1st FULL SIZE IMAGE
var gal = _root.theGallery
for (var n = 0; n < gal.NumberOfPics; n++) {
var p = eval(gal + ".p" + n)
if (p.galleryNum == gal.currentGallery) {
p.onPress()
break
}
}
delete this.onEnterFrame
}
}
}
|