Groups | Blog | Home
all groups > flash (macromedia) > august 2007 >

flash (macromedia) : Gallery Loader Selection


roiresources
8/8/2007 9:08:58 PM
Hello,

I have added a loader for my picture gallery. What I would like it to do is
when I select a picture it will appear in the gallery.

What command do I need to define that when I click on the picture it will
appear in the main gallery.


I hope this is clear. If you need more clarity. Let me know.

Thanks
dzedward
8/8/2007 9:15:43 PM
roiresources
8/8/2007 9:28:01 PM
What i have is an a drawing object. In this object I have15 images. I have
defined each image as a button. Beside this drawing object I have defined a
loader with a currentpath of the default picture, image1.jpg.

What I would like to do is when I click on one of the images in the drawing
object that it appear in the loader.
Is this the correct way of creating a picture gallery? Or I am I doing this
wrong?

Thanks
dzedward
8/8/2007 9:37:26 PM
give the Loader component and instance name, lets say, myLoader.. then give all
your buttons an instance name, for this example, my_btn, my_btn2, etc.. attach
this to frame

myLoader.contentPath = "image1.jpg"
my_btn.onRelease = function(){
myLoader.contentPath = "image2.jpg";
};
my_btn2.onRelease = function(){
myLoader.contentPath = "image3.jpg";
};
roiresources
8/9/2007 1:17:33 PM
I have tried your code I am still having problems.

I gave the loader an instance name and each button an instance name. Than I
made sure to put the full path to the images in the contentPath. What happened
is that when I put the contentPath in the parameters of the loader I see the
image. When I remove the contentPath and put it in code as you suggested no
image appears and the buttons still do not function.

Is there something I am missing?

Thanks
dzedward
8/9/2007 1:55:20 PM
roiresources
8/9/2007 2:09:44 PM
I gave the component an instance name of myLoader then I put in the full path
to my folder on my computer of where the pictures are. I called the buttons as
you suggested for testing purposes.

When I try to view it in a web page I don't see the loader at all.
dzedward
8/9/2007 2:24:24 PM
you need to use a relative URL like i did in the example.. place the images in
the same directory as your SWF and just use "image1.jpg" or place them in an
image folder in the same directory as your SWF and use "image/image1.jpg"..
that's if you name the folder image.
roiresources
8/9/2007 2:53:31 PM
Great.

It works.

Thank you very much.
AddThis Social Bookmark Button