Scene Wont Play After button ?

Community Beginner ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

I Currently changed the coding of my intro scene to test the functionality of the current scene im working on (scene 4). I have a button that takes the user from scene 4 to scene 5. It swittches to scene 5, but nothing plays, no audio none of the frames or anything. Currently scene 5 has 0 coding on it. Please let me know if i can provide anything . thanks ^^

 

Views

359

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Apr 19, 2021 Apr 19, 2021
If you are making the change to where you have a set of frames with one movieclip on each frame, instead of having multiple scenes, this line would change: MovieClip(this.root).gotoAndPlay(1, "HallwayScene1M"); You could put the different movieclips spread out more in the timeline, and use frame labels, that are the same as your current scene names. Then that line of code would become: MovieClip(this.root).gotoAndStop("HallwayScene1M"); The movieclip will play itself automatically, so no need to...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

Can you show the code you are using?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

Of course i can.


/* Click to Go to Scene and Play

SC4MNextTrialBTN.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_22);

function fl_ClickToGoToScene_22(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene5M");
}

 

I also tried putting it on my other button and scene 5 didnt play either. I tried changing the frame number and that did not work either.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

That works for me without any changes. Are there any errors appearing in the Output panel?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

The only error is a warning regarding font embedding, has been there for me since the beginning and has had no effect on my project currently. I tried a lot of options to fix the issue, i have currently about 7 functioning scenes that play with the same code snippets, but only "scene 5" is having issues . 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

If you are allowed to, you could post the FLA online somewhere, and reply with a link, so I can try the file as well.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

Every button works but to get to the 5th scene as i mentioned, you need to click start, then play, then pick the right character, then click the wait button twice, and then the next trial button leads to the broken scene. 

Thanks again,
SG

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

I newly discovered, that every scene AFTER the scene i coded, refuses to play unless i move it higher up on the scene list, i still have a lot more scenes to put. will this cause even more problems? if so, how do i solve it.

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

I wasn't able to tell much from the SWF file you posted. To tell what is going wrong I would need the FLA.

Are you familiar with Debug Movie? It runs the SWF inside Animate, and you get panels that show the variables, and that lets you add breakpoints. That might make it easier to find where the problem is.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

Good Afternoon Colin, I did some more researching and testing, is the 16,000 frame limit on a whole document or  TOTAL of all the scenes? because  heres what i did:

I tested that its every scene after the one that isnt playing. Then, i pulled one of the scenes up to go BEFORE the scene that i KNOW WORKS. and it played. i dont even have 1/2 of the project done and its an interactive project, 16k frames is too small for me to work with and im currently tryimg to trim my scenes to make it  work. i think this is why it wasnt playing because bye the time it got to scene5 (not working) , it hit the frame cap.

Thanks,
SG

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

A way around the 16000 frame limit is to use movieclips in the way that you use scenes. Imagine that your main timeline has 10 frames with 10 different movieclips, each one of which has the contents of your existing 10 scenes. To jump to say the 7th scene, you would do this:

gotoAndStop(7);

instead of:

gotoAndPlay(1,"Scene7");

Working that way would let you have 16000 scenes, each of which is 16000 frames long. 256 million frames should be more than you will need.

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

The Problem with this method, is that each scene has multiple interactive buttons, that lead to other scenes with interactive buttons. I dont know if this method allows you to interact with buttons.

Thanks,
SG

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

All of the interactive buttons you currently have in separate scenes would go into the separate movieclips. Everywhere that you are jumping from one scene to a particular frame in a different scene, you would change so that you go to the matching frame in the main timeline, and tell that scene's movieclip to jump to the frame you need to get to. It would only take a few changes in your scripts for it to work.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

I will give this a shot i appreciate it and i will post an update. 

Thanks.
SG

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

I'm currently testing this method and am encountering A TON of sound overlapping. Any advice?

 

Thanks,
SG

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

It may be that jumping between scenes took care of shutting off the sound for you. If that's the case you can do the same thing with some code.

At the top of each script where you are about to jump to somewhere else, add this line:

import flash.media.SoundMixer;

Then when you are about to jump to a different frame and movieclip, include this line:

SoundMixer.stopAll();

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

So, lets say  my first movie clip has a button taking it to a new scene and the code is :

MeleeCSLCTBTN1MC.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_27);

function fl_ClickToGoToScene_27(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "HallwayScene1M");

and i have a stop at the end of the movie clip.
Do i turn it into

import flash.media.SoundMixer;
MeleeCSLCTBTN1MC.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_27);

function fl_ClickToGoToScene_27(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "HallwayScene1M");
}
 and the at the end add  the soudmixer stop?

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

OK i figured it out, it goes in in the NEXT SCENE that its going into and its now working. THANK YOU

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

If you are making the change to where you have a set of frames with one movieclip on each frame, instead of having multiple scenes, this line would change:

MovieClip(this.root).gotoAndPlay(1, "HallwayScene1M");

You could put the different movieclips spread out more in the timeline, and use frame labels, that are the same as your current scene names. Then that line of code would become:

MovieClip(this.root).gotoAndStop("HallwayScene1M");

The movieclip will play itself automatically, so no need to tell it to play with code. The full script, with the sound code as well, would be:

import flash.media.SoundMixer;
MeleeCSLCTBTN1MC.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_27);
function fl_ClickToGoToScene_27(event:MouseEvent):void
{
SoundMixer.stopAll();
MovieClip(this.root).gotoAndStop("HallwayScene1M");
}

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

I appreciate the swift replies as im on a super tight schedule to finish this! I will start doing this method and coming back if i have any questions.

Super thanks,
SG

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

So, im getting it to work with 1 clip per scene but for some reason when i put 2 it breaks:

First Scene with clip at end code:

Frame 1 "

StartScenePlay.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_5);

function fl_ClickToGoToScene_5(event:MouseEvent):void
{
MovieClip(this.root).gotoAndStop(1051);}

 

Then i have a stop at frame 1050

On frame 1051 i have the next scene movieclip with nothig special and it works.

MeleeCSLCTBTN1MC.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_27);

function fl_ClickToGoToScene_27(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene4M");

 

RangeCSLCTBTN1MC.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_30);

function fl_ClickToGoToScene_30(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "HallwayScene1M");
}

 

 

The current scene im working on, the first movie clip worked fine, but once i put the second one it starts to overlap audio

WaitBTNMStep1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);

function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void
{
gotoAndPlay(961);
}

Part 2 of the wait:

import flash.media.SoundMixer;
WaitBTNMStep2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_8);

function fl_ClickToGoToScene_8(event:MouseEvent):void
{
SoundMixer.stopAll();
MovieClip(this.root).gotoAndStop(1531);

 

 


import flash.media.SoundMixer;
ProgressBTNMStep1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_7);

function fl_ClickToGoToScene_7(event:MouseEvent):void
{
SoundMixer.stopAll();
MovieClip(this.root).gotoAndStop(1539);

 

The Progress button instantly plays the audio coming from frame 1531 and i have  a stop at frame 1530, and a stop frame at 1538

 

I also double checked both movieclips and they are coded tthe same in terms of how they play out.

Once again, i appreciate all the help and ive spent about 3 hours trying to solve.

Thanks,
SG

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

If you previously had the sounds in the timeline of each scene, the sounds would now want to be in the timeline of the movieclips, not in the main timeline.

You should read about frame labels as well. If you used gotoAndStop("the name of the label you made"), you wouldn't run a risk of accidentally inserting a frame, causing all of the numbers to be wrong.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 19, 2021 Apr 19, 2021

Copy link to clipboard

Copied

I triple checked the frame numbers and i also  started to label them . The sounds are in the movieclips as well. Still unsure where the bug is occuring worst case im going to try to put a scene of just the movie clip and see if it works.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines