Flash and lightbox - Action script 3

If you try to seek on-line "flash lightbox," certainly find the results valid, but unfortunately all based on action script 2.

Given the need for Maldor and maybe someone who needs to use lightbox in action script 3, I propose my solution, taking cue from the work of Alan Curtis, which I invite you to read because I explain the changes to be applied to his example to achieve the same result in action script 3.

FLASH-lightbox as3

In fondo all’articolo troverete un esempio e il sorgente da scaricare per Flash CS3 . Basically Article find an example and source to download Flash CS3.

In explanation, riporterò lines of code moficare, we begin:

1. first amendment that you have to make the code of Alan Curtis is in the declaration dell'array pics, to do it this way:

2. Now turn to managing events associated with thumbnail images to open with lightbox.
In the version AS2, events are associated directly to the various buttons / miniatures, which is not possible in AS3.

Give a name to each instance miniature, for example pic1, pic2, etc. pic3. and add this code on another level, in the first frame.

the first event miniature

This code so you have to repeat as many times as photos that are part of the gallery.
If you have 10 photos, we will have 10 listeners: addEventListener (MouseEvent.CLICK, foto1 .. foto10), with 10 function foto1… foto10.

The only thing that will change in any function will be the line 7 where, in the light show, the 0 corresponds to the first photos, 1 correspond to the second…… 9 corresponds to the tenth photo.

I hope this tutorial can be useful for your projects. I think we can do better in terms of code (accepted suggetimenti), but I think it is a good start…

Finally, remember that in the tutorial, there are other articles that you might want, such as flash and thickbox, or flash and lightview.

0 comments:

Copyright © 2008 - kre.arszy design - is proudly powered by Blogger
Smashing Magazine - Design Disease - Blog and Web - Dilectio Blogger Template