Ok, I have a piece of script that a friend sent to me, and I am trying to adapt it with not too much luck. Below is the script.
When I click on the movieclip 'pushhome', movieclip 'home_mc' slides on screen. When I click on 'pushclients', 'home_mc' slides off screen. This works fine. But I am trying to add an extra function whereby clicking on 'pushclients' will not only slide 'home_mc' OFF, but will slide 'clients_mc' ON. As you can see I have added this to the script - but it wont work!! It seems to ignore clients_mc altogether. Anyone got any ideas why?? It should be noted I am NOT an actionscript afficionado...merely a beginner trying to learn on the fly.
Cheers.
Math.easeOutQuad = function(t, b, c, d) {
return -c*(t /= d)*(t-2)+b;
};
MovieClip.prototype.motion = function(clip, pos, speed) {
clip.t = 0;
clip.d = speed;
clip.b = clip._x;
clip.c = pos-clip._x;
clip.onEnterFrame = function() {
if (this.t<=this.d) {
this._x = Math.easeOutQuad(this.t, this.b, this.c, this.d);
this.t++;
} else {
delete this.onEnterFrame;
}
};
};
pushhome.onRelease = function() {
this.motion(home_mc, 700, 25);
};
pushclients.onRelease = function() {
this.motion(home_mc, -300, 25);
this.motion(clients_mc, 700, 25);
};
- Math.easeOutQuad = function(t, b, c, d) {
- return -c*(t /= d)*(t-2)+b;
- };
- MovieClip.prototype.motion = function(clip, pos, speed) {
- clip.t = 0;
- clip.d = speed;
- clip.b = clip._x;
- clip.c = pos-clip._x;
- clip.onEnterFrame = function() {
- if (this.t<=this.d) {
- this._x = Math.easeOutQuad(this.t, this.b, this.c, this.d);
- this.t++;
- } else {
- delete this.onEnterFrame;
- }
- };
- };
- pushhome.onRelease = function() {
- this.motion(home_mc, 700, 25);
- };
- pushclients.onRelease = function() {
- this.motion(home_mc, -300, 25);
- this.motion(clients_mc, 700, 25);
- };