This is starting to annoy me. For this website im doing, I need a photo gallery, which I’ve got all the pictures in the right directory for the photo gallery (which I have created using the tutorial on kirupa :snug:), but when it loads them up, it puts them right at the top left of the stage! The alignment isnt even in the top left? I dont understand it, and desperately need some help. Its probably really simple and im being brain dead.
The fla is attached. You might want to test it with a .jpg image of your own, but call the image ‘image0’ and make sure its in the same directory, duh.
Thanks alot :sigh:
Still not working. I tried making it a new movie clip, and then REsetting the registry point to central (it was already) and that seemed to put it in the center but I couldn’t see any more of the stage. I checked the tutorial, and this is because you have to name the movie where the photos load as ‘photo’ and I hadnt done. So I put its instance as ‘photo’ and the same problem came up; spawning the jpg in the top left. Not even on the stage area, right at the top left of the .swf.
I’m no expert or anything but I tested your file with a random pic that I think is bigger than the ones you are testing. Anyway, when I first tested the movie it put the center of the photo at the registration point of the photo movie clip you have on the stage (the black box). When I commented out this.photo_x and _y it loaded the top left corner of the pic in the top left corner of the photo movie clip. Is that what you want to happen? :h: Or am I totally missing what you are trying to do?
[AS]this.photo._x = absX-256;
this.photo._y = absY-192;[/AS]
absX and absY are not defined so it’s loading your first picture x/y in -256/-192
[AS]var absX = Stage.width/2;
var absY = Stage.height/2;[/AS]
and for the 256/192 half of the width and half of the height of your first picture.
You miss also the alignment for the rest of your photo’s(it’s not in your code)
Do you want them all centered?
Wahey. The code on that thread worked. Thanks alot, must have been something wrong with deviding the dimens by 2, but I thought I had done it right. Owell, thanks a lot man.