Gallery problems

Hello,

I’m new to flash and I wanted to make a gallery whit some photo’s of mine and I followed the tutorial here on this site.

It works very well but there was this little problem. Some of the pictures are taken whit the camera horizontally. And those pictures are perfectly compressable to 640480. But sometimes I turn the camera vertically whit makes the picutres look scaled out on 640480 and they should be in 480*640 size.

Now, I was thinking I make a ‘turn’ button and I load all the pictures in and if I (while watching the galery) encounter a picutre on his side I just turn it.

So i made this button


on the general layer

t = false;


and actionscript for the button


on(release)
{
if(t == false){

i= getProperty(picture,_rotation);
setProperty(picture,_rotation,i+90);
p= getProperty(picture,_x);
setProperty(picture,_x,p+640);
t = true;
}
else{
i= getProperty(picture,_rotation);
setProperty(picture,_rotation,i-90);
p= getProperty(picture,_x);
setProperty(picture,_x,p-640);
t = false;
}
}


the problem is not the the picture aint turning, it turns and turns back but, when I turn a picture and turn it back and then I want to press the next picture btn the gallery freezes and gives an error.

Some idead what the problem could be? I’ve been trying to get it to work for hours now.