Groups | Blog | Home
all groups > flash (macromedia) > august 2006 >

flash (macromedia) : I need help with a simple task (PLEASE HELP)


Chris Georgenes
8/5/2006 3:11:30 PM
on (release) {
nextFrame();
}

from the help docs (F1):

nextFrame function
nextFrame() : Void

Sends the playhead to the next frame.

Availability: ActionScript 1.0; Flash Player 2

Example
In the following example, when the user presses the Right or Down arrow key, the playhead goes to
the next frame and stops. If the user presses the Left or Up arrow key, the playhead goes to the
previous frame and stops. The listener is initialized to wait for the arrow key to be pressed, and
the init variable is used to prevent the listener from being redefined if the playhead returns to
Frame 1.

stop();

if (init == undefined) {
someListener = new Object();
someListener.onKeyDown = function() {
if (Key.isDown(Key.LEFT) || Key.isDown(Key.UP)) {
_level0.prevFrame();
} else if (Key.isDown(Key.RIGHT) || Key.isDown(Key.DOWN)) {
_level0.nextFrame();
}
};
Key.addListener(someListener);
init = 1;
}



******************************************
--> **Adobe Certified Expert**
--> www.mudbubble.com
--> www.keyframer.com




[quoted text, click to view]
mybluehair
8/5/2006 7:01:56 PM
hi, you know how you can make a button and link it to a different site with the
actionscript in this program? well I need to know of a way like...to make a
button and...link it to the next frame. ok, heres what im trying to make
happen...the user presses a button in the flash program thing and a comment
apperars. then they press it another time and a new one come up...and so on...I
could make like 50 different frames with new comments on them and then make the
button on each frame link to the next frame. is there a way to do that? if
there is I REALLY need your help. please

thanks :)
Chris Georgenes
8/6/2006 10:33:02 AM
no need to modify anything - look at the first code:

on (release) {
nextFrame();
}

that's all you need on the button.
If you want it to happen on click and not release:

on (press) {
nextFrame();
}

******************************************
--> **Adobe Certified Expert**
--> www.mudbubble.com
--> www.keyframer.com




[quoted text, click to view]
mybluehair
8/6/2006 2:05:00 PM
thank you so much. this will really help me. and, is there any way I can modify
that script so that its when the mouse is click, and not the arrow keys?



[q][i]Originally posted by: [b][b]Newsgroup User[/b][/b][/i]
on (release) {
nextFrame();
}

from the help docs (F1):

nextFrame function
nextFrame() : Void

Sends the playhead to the next frame.

Availability: ActionScript 1.0; Flash Player 2

Example
In the following example, when the user presses the Right or Down arrow key,
the playhead goes to
the next frame and stops. If the user presses the Left or Up arrow key, the
playhead goes to the
previous frame and stops. The listener is initialized to wait for the arrow
key to be pressed, and
the init variable is used to prevent the listener from being redefined if the
playhead returns to
Frame 1.

stop();

if (init == undefined) {
someListener = new Object();
someListener.onKeyDown = function() {
if (Key.isDown(Key.LEFT) || Key.isDown(Key.UP)) {
_level0.prevFrame();
} else if (Key.isDown(Key.RIGHT) || Key.isDown(Key.DOWN)) {
_level0.nextFrame();
}
};
Key.addListener(someListener);
init = 1;
}



******************************************
--> **Adobe Certified Expert**
--> www.mudbubble.com
--> www.keyframer.com




[quoted text, click to view]
[/q]


supportinfo
8/6/2006 6:49:02 PM
Keep each comment to 1 keyframe and have a stop on each keyframe. Then have a button on each keyframe say:

on (release) {
gotoAndStop(WHATEVER FRAME NUMBER YOU WANT IT TO GO TO);
}
Mike
8/7/2006 12:00:00 AM
Follow this method below, and if you ever want to modify or add to the
comments all you would have to do is edit all that hard coding from the 50
buttons you just coded... I think youd be better following chris's onRelease
method.
..x.

[quoted text, click to view]

AddThis Social Bookmark Button