Jump to content


Photo
- - - - -

experimental xml gallery


  • Please log in to reply
8 replies to this topic

#1 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 515 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 02 October 2008 - 05:39 AM

Needed something to do, so I set out to build a new gallery, over the past week or so.

- This gallery would be able to fill the page. (100% width & height) or run in a set size.
- Stage management is in place, using simple penner equations.
- Photos larger than the stage area will be re-sized to fit.
Also, tied into the stage management so as to keep the pic in scale to stage, tho not over 100%
- With that in mind, I have this set with a simple Boolean to either
allow or disallow a URL link to the image in a new(_blank) browser window.
- Be able to have more than one gallery, each with it's own set of thumbnails.
- The galleries would be listed in multiple pages.
- Number of galleries per page is adjustable, depending on layout.
Four galleries per page works for this layout, but it is adjustable.

Completly built with actionscript, all in one frame.

I have updated my own gallery with this example.
I do have the URL link to the image set to false in my gallery,
but is set to true in the zipfile example. Flash8 fla included.

http://www.flawlessd...og_HomeGallery/

I don't know how well you'll think I did on this.....tossing xml generated _globals all over the place as I do here, but it does seem to work, mostly. It was just a matter of keeping track of the number variables I have set up here.

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#2 Bendeguz

Bendeguz

    Advanced Member

  • Members
  • PipPipPip
  • 292 posts
  • Gender:Male
  • Location:Canada

Posted 02 October 2008 - 12:26 PM

Nice job. Works pretty sweet.
fairly easy to work with too.

peace

#3 nzizo

nzizo

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • Gender:Male
  • Location:On net

Posted 07 October 2008 - 11:45 PM

Very nice work, thanks for sharing :)
FREE FULLSCREEN TEMPLATE FOR ALL download the source files here

#4 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 515 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 09 October 2008 - 05:32 AM

Yeah, yeah, yeah...So that wasn't the last update. ;)
Seems like every time I say that, I learn something new.
I thought about not saying, "Last update", but if I did that, I might not learn nothin' new. LOL

In any case, here we go again.

After reading, and helping out a little bit with this thread in the kirupa forums, I learned more about two new things that I could use in this gallery.

The first new thing I learned was how to read xml attributes on the fly, using a “for loop”.
http://livedocs.adob...e=00002885.html
The second new thing for me is the creation of multidimensional arrays and how to populate them using that same “for loop”.
http://livedocs.adob...e=00001260.html

As I am using attributes and not values in my xml, this seemed a great way to update this gallery, and get rid of all those _globals I was tossing around in the previous version of this xml galleries.
That's not to say xml values wouldn't be able to be loaded into those multidimensional arrays instead of the attributes.
I simply chose this xml attribute way to do it.

I have updated my Home Gallery with this new version.

Here’s the new files with the cool new stuff I learned over the past few days.

Still completly built with actionscript, all in one frame.

Enjoy!

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#5 Bendeguz

Bendeguz

    Advanced Member

  • Members
  • PipPipPip
  • 292 posts
  • Gender:Male
  • Location:Canada

Posted 09 October 2008 - 07:37 AM

Hey Eggs
Is this a component?

#6 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 515 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 09 October 2008 - 08:07 AM

Hey Eggs
Is this a component?


No, but it wouldn't be hard to make this into a component.
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#7 Rob Wells

Rob Wells

    Advanced Member

  • special
  • PipPipPip
  • 246 posts
  • Gender:Male
  • Location:United Kingdom

Posted 09 October 2008 - 06:29 PM

Eggs, good to see you're still at large with Swish!

Great work, I couldn't look at the .swi as I don't have Smax 2, but I'll base my judgement on the fact that it works and nicely too!

I noticed something minor, its hardly even a problem:
If you use the next arrow in the top right to move through the pictures, the thumbnail viewer doesn't 'catch up' when the selected image moves off the scroll pane.

I hope that makes sense. Don't worry if it doesn't, im only being picky.

Cheers :)
blankCanvas.abracadabra();

#8 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 515 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 10 October 2008 - 11:48 AM

.....I noticed something minor, its hardly even a problem:
If you use the next arrow in the top right to move through the pictures, the thumbnail viewer doesn't 'catch up' when the selected image moves off the scroll pane.

I hope that makes sense. Don't worry if it doesn't, im only being picky.

Cheers :)


I'll have to look into that, and see if I can find a solution.

Here's a SM1 swi for you to check out.
Will work with the xml from the zip folder.

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#9 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 515 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 13 October 2008 - 04:44 AM

...'K, it occured to me that because this gallery re-sizes the photo when/if needed,
that a bit of Bitmap smoothing would be required to keep the photos looking good.
I have noticed on a couple of the pictures I know are being re-sized, how jagged some of the lines in the image are looking.

For me the trick was to figure out the easiest way to add this feature to what
I have already written, after the fact as it were, and just where to add what I need.
After a bit of reading on the subject, I think the best place to add the 3 lines of script needed is in each of the 2 "mcListener.onLoadInit = function"s with in the "MovieClip.prototype.myToggleReader"
function.
Also, each of these 3 lines of script would need to be added before any re-sizing is actually done.

var bitmap:flash.display.BitmapData = new flash.display.BitmapData(target._width, target._height, true);
hold1.hold1a.attachBitmap(bitmap, hold1.hold1a.getNextHighestDepth(), "auto", true);
bitmap.draw(target);

and

var bitmap:flash.display.BitmapData = new flash.display.BitmapData(target._width, target._height, true);
hold2.hold2a.attachBitmap(bitmap, hold2.hold2a.getNextHighestDepth(), "auto", true);
bitmap.draw(target);

MovieClip.prototype.myToggleReader = function(myG:Number,myI:Number):Void{
		Gg = myG;
		Pp = myI;
		if (SetToggle == true){
			buildPreloader();
			hold1._alpha = 0;
			var hold1a:MovieClip = hold1.createEmptyMovieClip("hold1a", hold1.getNextHighestDepth());
			var mcLoader:MovieClipLoader = new MovieClipLoader();
			var mcListener:Object = new Object();
			mcListener.onLoadStart = function(target:MovieClip) {
				eggsLoader._xscale = 0;
			};
			mcListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
				var totLoaded:Number = Math.round(bytesLoaded/bytesTotal*100);
				eggsLoader._xscale = Number(totLoaded);
				myMenu.desc_txt.text = "Image: " + Number(totLoaded) + " % Loaded";
			};
			mcListener.onLoadComplete = function(target:MovieClip):Void {
				removeMovieClip(eggsLoader);
				myMenu.desc_txt.text = imageData[myG][myI][2];
				current_pos = myI+1;
				myMenu.pos_txt.text = current_pos+" / "+ _global["GItotal_"+myG];
				Pp=Pp;
				picTrans();
			};
			mcListener.onLoadInit = function(target:MovieClip):Void {
				var bitmap:flash.display.BitmapData = new flash.display.BitmapData(target._width, target._height, true);
				hold1.hold1a.attachBitmap(bitmap, hold1.hold1a.getNextHighestDepth(), "auto", true);
				bitmap.draw(target);
				w = target._width;
				h = target._height;
				if (w != 0 && h != 0) {
					scaler = scalerf(w, h);
					if (scaler != 100) {
						target._xscale = scaler;
						target._yscale = scaler;
					}
					if (menuTrig == "open")target._parent._x = (Stage.width/2)-(target._width/2)+(175/2);
					if (menuTrig == "close")target._parent._x = (Stage.width/2)-(target._width/2);
					target._parent._y = (Stage.height/2)-(target._height/2);
				}
				target.filters = [myShadow];
				//target._quality = "BEST";
				if(allowLink)target.onRelease = target.onReleaseOutside = function() {
					getURL(imageData[myG][myI][0], "_blank");
				};
				this.removeMovieClip();
			};
			mcLoader.addListener(mcListener);
			mcLoader.loadClip(imageData[myG][myI][0], hold1.hold1a);
		}else if(SetToggle == false){
			buildPreloader();
			hold2._alpha = 0;
			var hold2a:MovieClip = hold2.createEmptyMovieClip("hold2a", hold2.getNextHighestDepth());
			var mcLoader:MovieClipLoader = new MovieClipLoader();
			var mcListener:Object = new Object();
			mcListener.onLoadStart = function(target:MovieClip) {
				eggsLoader._xscale = 0;
			};
			mcListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
				var totLoaded:Number = Math.round(bytesLoaded/bytesTotal*100);
				eggsLoader._xscale = Number(totLoaded);
				myMenu.desc_txt.text = "Image: " + Number(totLoaded) + " % Loaded";
			};
			mcListener.onLoadComplete = function(target:MovieClip):Void {
				removeMovieClip(eggsLoader);
				myMenu.desc_txt.text = imageData[myG][myI][2];
				current_pos = myI+1;
				myMenu.pos_txt.text = current_pos+" / "+ _global["GItotal_"+myG];
				Pp=Pp;
				picTrans();
			};
			mcListener.onLoadInit = function(target:MovieClip):Void {
				var bitmap:flash.display.BitmapData = new flash.display.BitmapData(target._width, target._height, true);
				hold2.hold2a.attachBitmap(bitmap, hold2.hold2a.getNextHighestDepth(), "auto", true);
				bitmap.draw(target);
				w = target._width;
				h = target._height;
				if (w != 0 && h != 0) {
					scaler = scalerf(w, h);
					if (scaler != 100) {
						target._xscale = scaler;
						target._yscale = scaler;
					}
					if (menuTrig == "open")target._parent._x = (Stage.width/2)-(target._width/2)+(175/2);
					if (menuTrig == "close")target._parent._x = (Stage.width/2)-(target._width/2);
					target._parent._y = (Stage.height/2)-(target._height/2);
				}
				target.filters = [myShadow];
				//target._quality = "BEST";
				if(allowLink)target.onRelease = target.onReleaseOutside = function() {
					getURL(imageData[myG][myI][0], "_blank");
				};
				this.removeMovieClip();
			};
			mcLoader.addListener(mcListener);
			mcLoader.loadClip(imageData[myG][myI][0], hold2.hold2a);
		}
	};

I updated my home gallery, and it seems to be much better.
I really notice the change in the first dahlia pic(1/28), on the virticle bits of the stair rails
and 7/28 in the petals of the dahlia flower.

(SM2 swi)

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users