PDA

View Full Version : Flash simple image gallery problem



marcelomdsc
March 11th, 2009, 11:51 AM
Hello I have what I think is an easy problem to solve but I canīt find a solution.
Iīm creating an image gallery with thumbnails on the right inside a symbol so that
they can all fade in at the same time, and the bigger images on the left that also fade in.

I can only fit 8 thumbnail images at a time, and want to have more than that.
So Iīll add an arrow below the thumbs so that when you click on it, you can see the other thumbs.
I have the first 8 thumbs on the first frame of a symbol and the rest on the second frame.

My problem is that the symbol that contains the thumbs is a graphic symbol, so that the thumbs in it, that are button symbols can be clicked on. I tried using button and movie clip symbols for the thumbnails container but then the buttons (thumbs) canīt be clicked any more.
That was not a problem till I had to add more than 8 thumbs, cause i need to give the container an instance name, and graphic symbols canīt have one.

Here is the link to download the .fla
www.ginkgo.com.uy/old/downloads/handheld_pink.fla

In case I didnīt make my self clear, what I need is to know if thereīs a way to have a movie clip or button symbol that can have buttons in it that can be clicked on.

I hope I didnīt give you a headache.

Thanks a lot, Marcelo.

snickelfritz
March 11th, 2009, 12:47 PM
zip your fla before posting it.
Web browsers do not generally know how to handle an "fla" file.
...

The problem with your file is probably the path to the symbols; you should be able to assign event listeners to the buttons by including the movieclip container instance name in the path.


// this creates a clickable button that is nested within a movieclip named "container_mc".
container_mc.button.addEventListener(MouseEvent.CL ICK, btnClick, false, 0, true);


It is also possible with AS3 to simply attach the listeners to the parent movieclip; mouse events will propagate to the nested children.
The following script will work for any number of nested buttons.


container_mc.addEventListener(MouseEvent.MOUSE_OVE R, btnOver, false, 0, true);
container_mc.addEventListener(MouseEvent.MOUSE_OUT , btnOut, false, 0, true);
container_mc.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);