Help Required - Photo Gallery

I’ve been using the excellent photo gallery tutorial at:

http://www.kirupa.com/developer/mx/photogallery.htm

I’ve ran into one problem. When I create my flash movie and ‘Test Movie’, the top left of my photographs square up in the center of the Movie Clip and not up top where they should be. So my photographs are in the lower right corner and cut off. Could it be because I am using vertical and horizontal images in the same size gallery? They are sized proportionately, 420 x 290 and then 290 x 420.

Much thanks,

Chad Kerychuk
chad@digitaldreammachine.com

Hi Mr Wolf,

Its to do with the mc’s registartion point no doubt. If you are loading the photo into an mc (target) make sure the target mc’s registration point is set to the top left. I cant remember the tutorial from memory, but give that a go. Vertcial or horizontal it wont matter, the mc will become the same size as the image and will start from the top left (if the reg point is set correctly). Later if you want to force images to a particular size you will have to implement a onLoad function which changes the target mc’s size after the image has loaded.

Let me know how it goes, welcome to Kirupa by the way :wink:

Thanks for the help and welcome.

I recreated the symbol Movie Clip setting it’s registration point to the upper left. That moved the images up. However, the images all register and don’t center within the actual movie which is what I want since i am using vertical and horizontal images.

The only way I can think of is to make them all square. So in Photoshop, I would set the canvas size to be square and save each image again. Which I did. Since I’m using a black background in the Flash file, I used a black Canvas in Photoshop behind the photos.

Unless there’s another way to fix it so the images center in Flash?

I should add that my Flash and Actionscript skills are not the strongest. I used to use Flash when it was FutureSplash Animator and on occassionally, but it seems to be the one program I have to make myself re-learn. I used to do a lot of Director work (v.3-6.5) and had a pretty good grasp of Lingo, but since focusing on video production, I have let a lot of those skill slide. But I’ve made the leap back into Flash and am getting through it pretty reasonably.

Maybe this will help:)

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=38553

scotty(-:

Yeah check out scotty’s link. :slight_smile:

But if you want to centre the image within the canvas, you would use the onLoad function and the Stage.width/ height functions to create a centering algorithm like below:



target_mc.onLoad = function(){
 _x=Stage.width/2;//assuming reg point top left
_y=Stage.height/2;
}

I havent tested the above but its something similar to what I used for an alert box component I created which centres itself on an application. Give it a go

lol, the link I gave centers the pics in the middle of stage;)
(and it uses Stage.width/height)

scotty(-:

hahha so it does…whoops… man it was late when I replied :sigh:

=)