PDA

View Full Version : [AS2] Pixgal Dynamic XML Gallery



andrewfitz
September 20th, 2007, 02:22 AM
Hey guys, this is my first XML gallery I made a year ago, and just dug it up to share with whoever wanted it.

I just wrote a post on my blog about it here:
http://blog.visualcondition.com/2007/09/19/pixgal-as2-xml-image-gallery/

You can download it there, but for instant gratification, here's what it looks like: http://play.visualcondition.com/pixgal/pixgal.swf

Features tagging, preloading, XML based configuration, class (not FLA) based, etc. Not as complete and optimized as I'd like, but take it easy, it was a year ago :P

Hope somebody finds it useful somewhere along their Flash journey.

Enjoy! :mountie:

prototype
September 20th, 2007, 09:23 AM
That's pretty sweet! Thanks Andrew!

twdesignz06
September 20th, 2007, 01:19 PM
Thanks for this, it's always good to see examples of fuse at work for galleries

dimitri_c
September 20th, 2007, 03:43 PM
Hello andrewfitz -

Thank you to share this, very nice… :king:



- Dimitri http://www.thebend.be/personal/

Mamboindustries
September 21st, 2007, 01:50 PM
Hi Dimitri, I like the gallery on your site... I want same!

AleThai
:panda:

jeremy1987
September 22nd, 2007, 07:41 PM
pretty nice

illamc
September 22nd, 2007, 08:52 PM
sweet! :)

estandart
September 23rd, 2007, 04:04 PM
it appears to me an error:

**Error** /Users/estandart/Desktop/pixgaltest/com/visualcondition/pixgal/PixImage.as: Línea 40: El tipo de la declaración de asignación no coincide: se encontró Void donde se requiere TextField.
var destxt:TextField = this.createTextField("description_txt", 1, 5, 100, (_thumbdim[0]*2)-10, 20);

**Error** /Users/estandart/Desktop/pixgaltest/com/visualcondition/pixgal/PixImage.as: Línea 42: El tipo de la declaración de asignación no coincide: se encontró Void donde se requiere TextField.
var titxt:TextField = this.createTextField("title_txt", 3, 0, _thumbdim[1], _thumbdim[0], 30);

**Error** /Users/estandart/Desktop/pixgaltest/com/visualcondition/pixgal/PixImage.as: Línea 48: El tipo de la declaración de asignación no coincide: se encontró Void donde se requiere TextField.
var rtxt:TextField = rmc.createTextField("txt", 1, 0, 0, 44, 20);

Total de errores de ActionScript: 3 Errores comunicados: 3

andrewfitz
September 23rd, 2007, 05:34 PM
I don't really know what's going on being in Spanish, but it seems like it doesn't think the textfields are really textfields. You can try removing the strict typing for each.

digitaldivide
September 24th, 2007, 08:38 AM
Really cool! Gonna use this one for sure! Thanx

minthu
September 25th, 2007, 08:54 AM
This is very good. I really like the tag function. Thanks for sharing. :hr:

boozy juice
September 25th, 2007, 10:40 AM
This is brilliant - thanks Mr.Fitz

:p:

EDIT: is there anyway of making the loaded images 'null' upon first loading - so the user has to activate them by clicking one of the buttons first? Yes, I can see the 'all' and 'none' bits in the .as code but i cant seem to get it to 'null' without always cancelling out the other buttons. Thanks.

andrewfitz
September 25th, 2007, 01:04 PM
Wow thanks everyone, I'm glad you all like it.

@bj: I'm not sure, maybe you can just create the gallery on a button release instead of automatically. Is that what you mean?

boozy juice
September 25th, 2007, 01:18 PM
Yeah, i changed the button from 'onRelease' to onEnterFrame but that nulls the other buttons as well. I also changed it from 'all' to 'none'.. Is there any other methods i could add in? anyone?

andrewfitz
September 25th, 2007, 02:11 PM
Hmm, I guess I'm not quite understanding what you want to do.

boozy juice
September 25th, 2007, 05:49 PM
sorry, im probably not explaining myself properly, let me try again...

when the preview swf (from your first post) first loads and all the thumbnail images have loaded in ok, theyre all clickable (and thus previewd in full colour). Whilst in this status, then should the user decide to click on 1 of the 4 buttons at the top of the page the AS code then 'greys out' the pre-specified thumbnails, thus making then 'unclickable'. Right?

So what i was randomly babbling to ask earlier was:
Is there anyway of adding/editing the existing AS code to make all the thumbnails upon first loading default to the 'unclickable' greyed boxes, thus forcing the user to click on 1 of the 4 buttons to effectively activate the desired thumbnails?

sorry if i wasnt clearer earlier - my bad ..and thanks again for your patience!

andrewfitz
September 26th, 2007, 01:10 AM
Ah, I got ya.

You should be able to just do:
my_gallery.showTaggedWith('none');

Now it won't work because there's no events in this, because it's not fully featured etc. So that func is called before there's really any images loaded. You could set a timer, but that's very shady. So, I guess what you can do is either make an event of sorts when the thumb is done loading yourself, or just go in and add this to the class itself:

So on line 264, after tt.buttonEvents(tt); (which is line 263) put this:
tt.hideTag();

So it should look like:

//make button events
tt.buttonEvents(tt);
tt.hideTag();
}

Now this isn't the best way for the future, but it works perfect for now. Hope it helps!

boozy juice
September 26th, 2007, 03:46 AM
Works like a dream!! ..and there was me messing around with the event side of the code = going no where, huh!

Thanks a lot Mr Fitz ;)

andrewfitz
September 26th, 2007, 04:43 AM
No problem mate. You could do something like a old school onEvent. So instead of just putting hideTag() there, call a function:

tt._gallery.onThumbLoad(tt);

Now just go to the gallery class, and add this to the end:

public function onThumbLoad(targ):Void{
};

Then in your fla, just do:

my_gallery.onThumbLoad = function(tg){
tg.hideTag();
}

That's just off the top of my head, but you get the idea.

boozy juice
September 26th, 2007, 07:01 AM
yeah, i see what youve doing there (lol @ old skool 'onEvent'!) but for now legacy code isnt an issue at the minute, so yeah, ill stick with the first solution, thanks again Mr Fitz ;)