Nicholas222
06-06-2008, 11:16 AM
Hi,
I'm currently working on a pretty basic image gallery of which the concept is very simple: if you hover the images, the Movie Clip (with the imgs included) scroll to the right or left side, depending on the direction of the cursor. So far, so good.
function scrollPhotos() {
if (gallerij_mc._x >= 60) {
gallerij_mc._x = 60;
}
if (gallerij_mc._x <= -1460) {
gallerij_mc._x = -1460;
}
var muisafstand = _xmouse-(Stage.width)/2;
gallerij_mc._x += -muisafstand/10;
}
As you can see, the MC freezes if the last (or first when scrolling back) image is being displayed. In this case: position 60 and -1460.
Now, I try to loop the Movie Clip with the images, so after the last img, the first one shows up again. I've been told the way of doing this is as follows: you give a second instance of the gallery_mc a different instance name so you can switch the MC's of position using AS. If a MC is at the end, the following instance is being pasted at the end, and vice versa.
I don't want to confuse, but I would call it 'sliding mc's'
Given that I'm just a newbie, any help is much appreciated!
Thanks in advance.
I'm currently working on a pretty basic image gallery of which the concept is very simple: if you hover the images, the Movie Clip (with the imgs included) scroll to the right or left side, depending on the direction of the cursor. So far, so good.
function scrollPhotos() {
if (gallerij_mc._x >= 60) {
gallerij_mc._x = 60;
}
if (gallerij_mc._x <= -1460) {
gallerij_mc._x = -1460;
}
var muisafstand = _xmouse-(Stage.width)/2;
gallerij_mc._x += -muisafstand/10;
}
As you can see, the MC freezes if the last (or first when scrolling back) image is being displayed. In this case: position 60 and -1460.
Now, I try to loop the Movie Clip with the images, so after the last img, the first one shows up again. I've been told the way of doing this is as follows: you give a second instance of the gallery_mc a different instance name so you can switch the MC's of position using AS. If a MC is at the end, the following instance is being pasted at the end, and vice versa.
I don't want to confuse, but I would call it 'sliding mc's'
Given that I'm just a newbie, any help is much appreciated!
Thanks in advance.