-
FK's Geezer Mod
Well, it interested me, and I got it. Very elegant oldnewbie. Similar in some ways to making a slideshow wrap from the last pic back to the first, by way of around the horn.
-
Tyard et al.,
I thought the code you posted could go inside the movie clip to improve it: So I stuck the button ("forward") in the clip on its own layer and put this in frame 1 of scroller
Code:
stop();
forward.onRollOver = function() {_root.scroller.onEnterFrame = function() {
var newframe = this._currentframe + 1;
if (newframe > this._totalframes) {
this.gotoAndStop(1);
} else {
this.nextFrame();
} }};
forward.onRollOut = function() { delete _root.scroller.onEnterFrame };
Is this any better? Can I get rid of mention of "scroller"?
Cheers,
Mark
-
Confused. You put forward INSIDE of scroller? If that's true, you can't get rid of the reference, though you can change it to a relative path:
this._parent.onEnterFrame
would refer to scroller if forward is now inside it. However, one of the reasons I set it up as I did was to centralize all of the code. This rather defeats the purpose.
Again, I might be misunderstanding, so any elaboration would be appreciated.
-
HELP>>>ACTIONSCRIPT DICTIONARY
Here is another version:
1) clip - can be any clip that has an animation in it, just write a nice path, _root.someClip.someClip
2) dir - 0 or false, 1 or true, "stop" - 0 or false will play the clip in the forward direction, 1 or true will play the clip in the reverse direction, "stop" will stop the clip by deleting the onEnterFrame event.
Code:
function reverseMe (clip, dir) {
clip.onEnterFrame = function () {
if (dir == 0) {
clip.nextFrame ();
} else if (dir == 1) {
clip.prevFrame ();
} else if (dir == "stop") {
delete clip.onEnterFrame;
}
};
}
forward.onRollOver = function () {
_root.reverseMe (_root.scroller, 0);// 0 or false works
};
reverse.onRollOver = function () {
_root.reverseMe (_root.scroller, 1);//1 or true works
};
forward.onRollOut = reverse.onRollOut = function (){
_root.reverseMe (_root.scroller, "stop");
};
Basically in the step by step I provided, ditch the "mt" clip out of the scroller clip. Replace the code on frame 1 with the code from above and you should be good to go.
Good Luck!
[Edited by Antibody on 09-29-2002 at 03:03 PM]
-
Antibody,
The onrollover works, but not the onrollout (below). I cannot fix it no matter what.
forward.onRollOut = function (){
root.reverseMe (_root.scroller, "stop");
};
If I say this its okay:
forward.onRollOut = function (){
delete scroller.onEnterFrame;
};
but that defeats having the fuction.
Any thoughts?
Mark
-
HELP>>>ACTIONSCRIPT DICTIONARY
oops that is a typo.. it should be _root not root. Sorry bout that.. fixin it in my post too
-
My eyes must be diabolical. Or my Flash skills.
Thanks for correcting it,
Mark
-
FK's Geezer Mod
Just an aside, I am nowhere near the ability to just write AS. I have an advanced book that I am working through, and I am learning it, but..... I find myself doing a lesson and the exact script is in the book, all I got to do is type it out, character by character. Every mistake I make is from a typo. It's uncanny.
-
HELP>>>ACTIONSCRIPT DICTIONARY
No problem man.. I actually cut n paste the code from Flash but I didn't have the _root's in my original code.. I added them into the post though because I think it is important to note the paths.
iaskwhy-
Believe me man you can be as careful writing your code as you want but typos are like cockroaches, they're everywhere. ;p
Keep on keepin on guys.
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
|