I’m working on a small piece that involves a movieclip that scrolls slowly from the beginning on enterframe, but when a button is clicked it goes directly to a certain point on the x axis.
The first piece of it is here:
http://jxmckenzie.com/opus/index.html
You’ll see it’s kind of wack right now, bc I can’t figure this one issue out…
For the buttons I have this bit of code: (Where photo_mc is the movie clip i’m moving)
[SIZE=1][COLOR=DarkGreen]final_x=0;
speed =3.5;
photo_width = 770;
btn_1.onRelease = function() {
final_x =0;
photo_mc._x += (final_x - photo_mc._x)/speed;
}
btn_2.onRelease = function() {
final_x =-photo_width;
photo_mc._x += (final_x - photo_mc._x)/speed;
}
(…etc. for all the buttons)
[SIZE=2][COLOR=Black]And on the movie clip I have this bit (to get it to move):[/COLOR][/SIZE]
onClipEvent(enterFrame) {
speed = -1;
this._x += speed;
}
[/COLOR][/SIZE]
The motion pretty much works for me, but when I click on the button it doesn’t jump to the right point in the movie clip.
Will I just have to go in and hardcode the x values?
Any help is much appreciated! thanks.