I have a MC that you scroll using buttons. It scrolls left, right and when the end of the MC enters the frame it duplicates so it appears to continue scrolling. The problem is it only duplicate one time the it will disappear out of frame if you continue to scroll.
I want it to keep duplicating and scrolling.
This is the actions I have for my buttons:
// left
on (rollOver) {
_root.pic2.left = true;
}
on (rollOut) {
_root.pic2.left = false;
}
// right
on (rollOver) {
_root.pic2.right = true;
}
on (rollOut) {
_root.pic2.right = false;
}
This has been put together from deconstruted FLA. files and help from the great people on this site. So sayin add this or try if, else dose'nt help, I might need more explanation than most or show me where to add it in the code.
I am attaching a sample to better explain what I am trying to do.
I got one side working, the left button when moused over scrolls and scrolls and scroll as it should. However the right button continues to only duplicate one time. I think I need to change a - to a + somewhere.
Here is the new code for the MC:
onClipEvent (load) {
mode = true;
speed = 10;
//
function go(degree) {
_y -= speed;
_x += speed;
}
}
onClipEvent (enterFrame) {
//
if (mode) {
if (up) {
_y -= speed;
}
if (down) {
_y += speed;
}
if (right) {
_x += speed;
}
if (left) {
_x -= speed;
}
}
//
// loop to opposite side of the masked area when the beetle travels off-screen
}
onClipEvent (load) {
pic1.duplicateMovieClip("pic2", 100);
pic2._x = pic1._x+pic1._width;
pic1Startx = this._x;
pic1Speed = 10;
}
onClipEvent (enterFrame) {
if (this._x<=(pic1Startx-pic1._width)) {
this._x = pic1Startx-pic1Speed;
}
}
onClipEvent (load) {
pic1.duplicateMovieClip("pic2", 0);
pic2._x = pic1._x-pic1._width;
pic1Startx = this._x;
pic1Speed = 10;
}
onClipEvent (enterFrame) {
if (this._x<=(pic1Startx-pic1._width)) {
this._x = pic1Startx-pic1Speed;
}
}
Now I want to have a few different pics do this. Can I use buttons with go to and stop frame 2. Then use the same code with the new pics instance, say hold 3.
Hey I got this thing working using your awsome sample. However I am having trouble with the Up and Down. I have played with some of the numbers but I am not sure which ones control that part. Can you show me where to adjust the Up and Down?
I have attached another sample that is the actual size I am working with.