shaftbond
03-01-2004, 10:32 PM
Hi, I have four movie clip buttons at the top of my page, and I made a movie with this code:
onClipEvent(load){
_y=189.6;
_x=467.3;
speed=5;
}
onClipEvent(enterFrame){
_x+=(targetx-_x)/speed;
_root.homeb.onRelease=function(){
targetx=467.3;
};
_root.compb.onRelease=function(){
targetx=252.3;
};
_root.gallb.onRelease=function(){
targetx=57.3;
};
_root.servb.onRelease=function(){
targetx=-147.7;
};
}
to have it slide back and forth on the x axis when the buttons are pushed. It worked flawlessly. Then I added another movie that I wanted to slide around when the same buttons were pushed and I added this code to the second movie:
onClipEvent(load){
_y=381;
_x=530;
speed=8;
}
onClipEvent(enterFrame){
_x+=(targetx-_x)/speed;
_y+=(targety-_y)/speed;
_root.homeb.onRelease=function(){
targetx=530;
targety=381;
};
_root.compb.onRelease=function(){
targetx=22;
targety=381;
};
_root.gallb.onRelease=function(){
targetx=530;
targety=126;
};
_root.servb.onRelease=function(){
targetx=22;
targety=126;
};
}
Now the second movie clip slides around just as it should, but the first MC doesn't move...I haven't changed the code from when it was working...am I doing something wrong? Thanks.
onClipEvent(load){
_y=189.6;
_x=467.3;
speed=5;
}
onClipEvent(enterFrame){
_x+=(targetx-_x)/speed;
_root.homeb.onRelease=function(){
targetx=467.3;
};
_root.compb.onRelease=function(){
targetx=252.3;
};
_root.gallb.onRelease=function(){
targetx=57.3;
};
_root.servb.onRelease=function(){
targetx=-147.7;
};
}
to have it slide back and forth on the x axis when the buttons are pushed. It worked flawlessly. Then I added another movie that I wanted to slide around when the same buttons were pushed and I added this code to the second movie:
onClipEvent(load){
_y=381;
_x=530;
speed=8;
}
onClipEvent(enterFrame){
_x+=(targetx-_x)/speed;
_y+=(targety-_y)/speed;
_root.homeb.onRelease=function(){
targetx=530;
targety=381;
};
_root.compb.onRelease=function(){
targetx=22;
targety=381;
};
_root.gallb.onRelease=function(){
targetx=530;
targety=126;
};
_root.servb.onRelease=function(){
targetx=22;
targety=126;
};
}
Now the second movie clip slides around just as it should, but the first MC doesn't move...I haven't changed the code from when it was working...am I doing something wrong? Thanks.