|
-
Scrolling movieClip: Loop within set area?
I've got a movieClip that's scrolling across the stage that loops nicely (kinda like the many cloud animations out there).
I've set the clip up to stop it's scrolling on a rollOver, and start up again on the rollOut.
My problem is that after the rollOut the loop doesn't work. The movieClip just keeps travelling. Can anyone help me in terms of the code? Tnx
Code:
blue.onEnterFrame = function() {
blue._x -= 2;
if (blue._x<=-0) {
blue._x = 864;
}
};
blue.onRollOver = function() {
delete blue.onEnterFrame;
};
blue.onRollOut = function(){blue.onEnterFrame=function(){
blue ._x-= 2;}
if (blue._x<=-0) {
blue._x = 864;
}
};
-
BTW, this is the effect I'm after:
http://www.bestdesigns.com.au/
I absolutely love the fish buttons and that they will scroll/loop, but stop when you mouse over. (If I'm not on the right track with my approach to the code, please let me know)
-
-
*bumpity*
Anyone? Please lend a hand! This is driving me crazy. 
-
-
PHP Code:
function travel(me) { me.onEnterFrame = function() { me._x > 0 ? me._x -= 2 : me._x = 864; }; } travel(blue);
blue.onRollOver = function() { delete this.onEnterFrame; };
blue.onRollOut = function(){ travel(this); };
functions are useful.
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|