jjlG2022

James J Lemon Graphics
Copyright © James J Lemon Graphics
FlashGal

flash gallery browser
Click on the tabs to open folders until you find images.
Use the keyboard "up" and "down" arrow keys to navigate.
Have fun!

I found this nifty example on Macromedia's help files, and started to customize it.
The flash movie reads an XML file and displays is as a tree.
The first version, I created the XML with scripts, scanning my website folder.
Later, I made a small application program that writes the same XML nodal tree diagram from any folder, but the idea's the same.
The application establishes acceptance criteria: a 50KB minimum or greater JPG file size, to exclude thumbnails.
For the makefile and source in C, send me an email with the title "flashgal". Or, you can use the original scripts, presented here.

--- MAKE A NEW SCRIPT; chmod +x; execute
dirsof.cmd

   ls -l $1 | grep drwx | awk -v MYDIR=$1 '{print "dirsof.cmd " MYDIR    "/" $9}'
   

--- MAKES an XML file by finding images and making a reference
dirsnewg.awk

BEGIN{
	print "awk -f start.awk"
	while( getline ){
		if( n > 1 ){
			real0 = n;
			realN = length($2) - n + 1;
		}else{
			real0 = 1;
			realN = length($2);
		}
		print "find " $2 "/*.jpg | awk -v gallery=" substr($2,real0,realN)"    -f newg.awk"
	}
	print "awk -f end.awk"
}
   

--- MAKES a GALLERY from a FOLDER
newg.awk

   BEGIN{
   	print "\t<node label=\"" gallery "\">" 
   	while( getline ){
   		nx = 1;
   		for( ix = 1; ix < length( $1 ); ix++ ){
   			if( substr( $1, ix, 1 ) == "/" ){
   				nx = ix+1;
   			}
   		}
   		tx = substr($1,nx,999)
   		print "\t\t<node label=\"" tx "\" src =\""    $1 "\"/>"
   	} 
   	print "\t</node>"
   }
   
--- STARTS a TREE
start.awk

   BEGIN{
   	print "<?xml version=\"1.0\"?>"
		print "<tree>"
   }


--- ENDS a TREE
end.awk

   BEGIN{
		print "</tree>"
   }


--- REFERENCE THIS XML FILE from your Flash script
gallery_tree.xml

	<?xml version="1.0"?>
<tree>
<node label="downloads">
<node label="pkg1/pkg001.images">
<node label="jjbrik.door.mask.jpg" src ="../downloads/pkg1/pkg001.images/jjbrik.door.mask.jpg"/>
<node label="jjbrik.doorwindow.color.jpg" src ="../downloads/pkg1/pkg001.images/jjbrik.doorwindow.color.jpg"/>
<node label="jjbrik.doorwindow.htmap2.jpg" src ="../downloads/pkg1/pkg001.images/jjbrik.doorwindow.htmap2.jpg"/>
<node label="jjbrik.doorwindow.mask.jpg" src ="../downloads/pkg1/pkg001.images/jjbrik.doorwindow.mask.jpg"/>
<node label="jjbrik.tiling.jpg" src ="../downloads/pkg1/pkg001.images/jjbrik.tiling.jpg"/>
</node>
</tree>

Here's a screen shot: