PDA

View Full Version : Next Scene Action Script Question


AdemoS
03-15-2005, 04:15 AM
on (release)
_root.gotoAndPlay("IntroTrans",1);
}

I know I'm messing something up here, but what? This is AS for my button symbol. IntroTrans is my frame label for scene 2, 1 is the frame number.

Xeef
03-15-2005, 04:19 AM
hi and welcome to As.Org

Description
Function; sends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene.

You can use the scene parameter only on the root Timeline, not within Timelines for movie clips or other objects in the document.

AdemoS
03-15-2005, 04:23 AM
Thank you for the welcome and fast reply, unfortantly I'm missing your point. What I want my button to do is go to the next scene, with the frame label of "IntroTrans." What exactly do I need to have in my code to do that? I'm sorry if my confusion is over a simple question.

Xeef
03-15-2005, 04:27 AM
//on the root time line
MY_mc.onRelease=function(){
_root.gotoAndPlay("IntroTrans",1);
}

this is the only way

Barn
03-15-2005, 04:32 AM
You are using the gotoAndPlay method (that's what it is when you prepent a path to it, and what is necessary to reach outside the current timeline), which does not accept a scene name as a parameter.

Only the gotoAndPlay function allows two parameters, the first being the scene name, but it does not allow a prepended path, so can be used only from the _root timeline, as that is the only place that scenes exist (actually they don't really even exist in the compiled movie, hence the problems).

Use frame labels and omit the scene names entirely.

AdemoS
03-15-2005, 04:34 AM
Grr, still not working. Do me a quick favor, I'm gonna upload the flash file to my host. See if I have any other coding errors that might be screwing it up. Thank you in advance for your time.

The Flash File (http://members.lycos.co.uk/iiiademosiii/Flash_Files/)

EDIT: My bad, I'll just link to the directory instead of the file.

A second question is, how do I rename scenes?

Use frame labels and omit the scene names entirely.IntroTrans is the frame label, my scene name is not in the code.

Barn
03-15-2005, 05:07 AM
IntroTrans is the frame label, my scene name is not in the code.
So what's the number 1 that you've included as the second parameter? As I clearly stated before, the gotoAndPlay() method only accepts one parameter.

AdemoS
03-15-2005, 05:15 AM
So what's the number 1 that you've included as the second parameter? As I clearly stated before, the gotoAndPlay() method only accepts one parameter.1 is for frame 1, if I don't need it, I can easily take it out. But it would easier to understand my coding if you downloaded and looked at the file, if you have time, or if Xeef does, that would probably explain things better.

AdemoS
03-16-2005, 12:32 AM
You are using the gotoAndPlay method

Only the gotoAndPlay function allows two parameters

Hmm, I re-read this. Can you explain how to switch between method and function? What would I need to change?

Also, please check that flash file, it should just take about five minutes but it would help explaining the situation greatly if you could just point out what I did wrong, then I can fix it. So far you have all posted helpful INFORMATION but being very inexpirenced in this scripting language, it would be more benifical to just check the file, correct the coding, and tell me what you did. Then I can know for future reference.

Btw, I did check other threads, searched, but nothing seems to have exactly what I need. Or if it does, I don't understand enough to use it's information...

AdemoS
03-17-2005, 12:12 AM
Update: Well I solved it, but not by using any infomation here, I checked over tons of pages on FlashKit and found the code that worked, that applied it to mine: on(release){

_level0.gotoAndPlay("introtrans");

} Hurreh for me.