ArgumentError: Error #2109: Frame label default not found in scene default - actionscript-3

I have asked this question on the http://www.actionscript.org/ forums, I have yet to get a reply, so I will try here as well, I will copy the post from those forums, but please do tell me if I am missing any details out, posting it on the wrong forum on this website, or whether I should actually post it to another website.
The post is as follows:
I am fairly new to using action script 3.0, I am following a set of video tutorials for such.
I am using Adobe Flash Professional CC 2014, along with some extra elements, to create the main menu for a game using UDK(Unreal Development Kit), that I have in mind, to confirm, this is a test game, not intended for release, it will be free to try when I get various features implemented, a practice project.
So, I am using Scaleform and CLIK. When I run what I have so far, using the Scaleform launcher, everything works as intended, no errors are logged in the console. However, when I use the debugger and click on the 'Options' button on my main menu (it is the only button in frames 1-10, at the moment, under the 'mainMenuScreen' label that I have declared), I get the following error:
ArgumentError: Error #2109: Frame label default not found in scene default.
at flash.display::MovieClip/gotoAndPlay()
at scaleform.clik.controls::Slider/draw()[C:\UDK\UDK-2014-08\Development\Flash\AS3\CLIK\scaleform\clik\contr ols\Slider.as:273]
at scaleform.clik.controls::Slider/set value()[C:\UDK\UDK-2014-08\Development\Flash\AS3\CLIK\scaleform\clik\contr ols\Slider.as:156]
at MainMenu_fla::MainTimeline/frame10()[MainMenu_fla.MainTimeline::frame10:11]
at flash.display::MovieClip/gotoAndPlay()
at MainMenu_fla::MainTimeline/OpenGameplayOptionsScreen()[MainMenu_fla.MainTimeline::frame1:17]
I am not using a label known as 'default', nor do I have a scene called 'default' and also, as can be seen from the code for the button, I am not trying to go to (gotoAndPlay), 'default', I am trying to go to a label I have defined, known as 'gameplayOptionsScreen', the code is as follows:
import flash.events.MouseEvent;
/*Function
#Name: OpenGamePlayOptionsScreen
#Params: None
#Description: This function will make the scene go to the "gameplayOptionsScreen"
label, so that the components that will be on the screen will now be those under the
label of "gameplayOptionsScreen".
*/
function OpenGameplayOptionsScreen(evt : MouseEvent)
{
gotoAndPlay("gameplayOptionsScreen");
}
// Add an event listener to this button, so it can tell if it has been clicked on, // in this case:
optionsBtn.addEventListener("click", OpenGameplayOptionsScreen);
(The line above this one, is where the debugger highlights one of the places the error occurs)
stop(); // Stop the flash movie here
From what problems that the debugger has informed me of, it also seems to have a problem with the slider that appears in frame 10, the frame that the label, 'gameplayOptionsScreen', is assigned too.
But I am wondering why the error occurs, in regards to a call to 'gotoAndPlay("gameplayOptionsScreen");', as that is where I believe the error becomes existent from.
Please do tell me if you require more information to help me solve this problem that I am having, or do tell me if I have posted this in the wrong forum on this website, or if I have in fact posted this to the wrong website altogether and therefore, should be posting to Epic Games' forums instead.
Edit: I have redone the button, so that, it is now known as TestGameButton and DefaultButton is in my library too, as it was in the click components library, this component has been left unchanged this time. Using my new button still produces the same errors and even using the default button does as well. But removing the slider that the debugger also complains about that is displayed in frame 10, removes all the errors, so it seems to be a problem with the slider, I am not sure what though, I have tried putting in a new instance and naming it, but I get similar errors .

Never mind then, I don't mind if this question does not get any answers, I am moving onto UE4, which has much better systems in place for menus, for example, thanks for trying to help #CyanAngel though.

Related

DataVizExtention: issue with clearing viewables while a sprite is selected

In my code, I have this workflow:
When user wants to see some things, add Sprites using 'DataVizCore.addViewables()'
Use 'viewer.addEventListener(DataVizCore.MOUSE_CLICK, onDotClick)' to show info bubble
When user wants to show other things, call 'DataVizCore.removeAllViewables()' to clear Sprites
Repeat from step 1
This sequence works OK except in one situation.
If a sprite was selected (by clicking on it) before removeAllViewables() is called, I don't get MOUSE_CLICK event for newly added Sprites. In browser console, I see following error is thrown.
CustomViewables.js:318 Uncaught TypeError: Cannot read property 'style' of undefined at ViewableData.getViewableUV (developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/DataVisualization/DataVisualization.js:454)
As a workaround, I added 'event.hasStopped = true' to click event handler to prevent Sprite getting selected internally. That seems to work.
This seems like a bug in DataVizExtension to me. Or, my workflow is wrong?
Thanks
Bandu
Bandu. Thanks for the detailed steps to reproduce this issue. I tried with v7.46.0 version of the DataVisualization.js (latest as of my message) but was not seeing the same issue. I'd be curious if you are using this same version of the Forge Viewer (you can figure that out by looking at the viewer3D.js fetched under the Network tab of Chrome DevTools).
Setting event.hasStopped = true works because it internally avoided the code path calls into getViewableUV that threw the exception, but the flag is meant for other use cases (e.g. overriding default sprite selection behavior).
In any case, I've just tweaked our internal code to make use-cases like yours more robust. The changes will be released with the upcoming v7.47.0. Thank you for your feedback 🙂

Adobe Animate Actionscript 3.0 "clicktogotonextscene" code not working

So I have the following code for a button called "n2" and as you can see it's supposed to take me to the next scene when I click it, but it isn't working. It is inside Scene 2 and I'm trying to get to the next one and whenever I test the scene and click it, I don't even get an error, it just doesn't work.
Btw, it's a GIF defined as a movie clip and then as a button. Could that be causing the problem?
n2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextScene);
function fl_ClickToGoToNextScene(event:MouseEvent):void
{
MovieClip(this.root).nextScene();
}
If you put a trace in the function and comment out "MovieClip(this.root).nextScene();" you could then see if the function gets called on a button click.
I've not used animate before, but in flash you have to name your button/movieclip and then also name the instance. This allows you to create the object twice with two seperate names to be referred to by actionscript.
Not sure if this helps but thought I'd give you some things to try, good luck

Actionscript ExternalInterface syntax error

I have created a simple container app whose purpose is to:
play an embedded flv by clicking a button onscreen
activate an external interface call (this records the fact that the person has watched the video)
That's it.
I have it working partially. I have a button on scene 1 with the "click and go to next scene" code snippet attached to it. I click it and it happily moves on to scene 2 where the flv video plays beautifully. The problem happens when I try to insert the code that the external developer told me to use to make the connection between my flash file and IT's back end work.
Here is the recommended code:
ExternalInterface.call("recordScore()”);
Unfortunately, as soon as I enter this code, there is a syntax error and the movie no longer plays. I added the code on a frame at the end of the movie.
I am no sure that the syntax the developer sent was correct, nor do I know where to insert this code into the proper place.
It looks like there is a closed double quotes (”) in what you pasted:
ExternalInterface.call("recordScore()”);
Assure quotation marks, and you do not need the () on the JavaScript function you're calling:
ExternalInterface.call("recordScore");
When running from Flash Projector (as in Ctrl+Enter), you can test whether External Interface is available; otherwise, an exception is thrown at runtime:
if (ExternalInterface.available) {
ExternalInterface.call("recordScore");
}
Fortunately, I found some code in the former employee's files that seems to have worked:
ExternalInterface.call
(
"recordScore()"
);
Hopefully this will connect with the database and resolve the issue so I can go back to making videos.
Thank you so much for your help!
Regards!

Actionscript 3 problems with "Call to a possibly undefined method"

Thanks partly to info from people here, I'm getting more comfortable with Actionscript 3, but I've got a problem that is very puzzling.
The program (done entirely in AS3, no Flash) has several different screens. One does music and it's working very well. Another does video. Obviously when somebody goes from music to video we need to make sure the music is turned off. There is a Main screen that handles going from one to the other.
I started out doing it this way, and the reason I got "Call to a possibly undefined method" is obvious. The following is in the Main class, with the "private var" part inside the class but external to the functions and the "music = new MusicPanel" part in one of the functions:
private var music:MusicPanel;
music = new MusicPanel(trackNames.songNames, trackNames.numSongs);
When switching to the video panel, I added a public function in MusicPanel called StopMusic and called it when the user went to the video panel:
if(music != null)
music.StopMusic();
That got the error:
Call to a possibly undefined method StopMusic
I was checking to make sure music was not null, but that error didn't seem like a bad thing. So I changed the code to:
private var music:MusicPanel = new MusicPanel();
and added a function that would get the song names and number of songs to the music class. That did not help- I got the same error, and in fact the function that tried to put the song names and number of songs got the error also.
At the same time, the Video panel does not give me that error, even though I have laid it out in exactly the same way.
private var video:VideoPanel = new VideoPanel;
video.PlayVideo();
I do a fair amount of setup on the music screen when it gets called as a new class, I do less setup for the video screen. I'm not sure if that makes a difference.
Clearly there is something I don't understand here. Anybody got any idea what's going on? I've looked at a number of questions about this, but have not found an answer. I think I'm doing this right, but the compiler thinks I'm doing it wrong, so I must be doing it wrong.
Later Note: One answer mentioned the difference between Sprite and MovieClip. I gave that a try, changing to MovieClip does not help, and the VideoPanel, which works, extends Sprite.
What is the base class of MusicPanel, Sprite or MovieClip? If Sprite, change to MovieClip and see what that does. In AS3 Sprites are not dynamic, so can't take properties that are not inherent in the class.
It appears that the problem is coming either from Actionscript 3 or from FlashDevelop. I built a new module (SongsPanel) which is very close to the same as the original MusicPanel. It works. If I add a public function in MusicPanel the compiler comes back with the same error. If I add a public function in SongsPanel everything works.
Does FlashDevelop keep track of errors in some hidden file? I'm guessing that's what's going on, and that there is a bug in the way that is done.
PITA!- but at least it now works.

actionscript 3: calling function for second time wont work

I'm new to actionscript 3, I have sequences of frames and two buttons to control which sequence to play, it first works properly, but have problem when a sequence is being played for the second time. I have used gotoAndPlay function for my navigation. can anyone help me?
From your description I have a hunch about what may be happening...
Firstly I would ask you if the buttons are present at all frames along the timeline? If they are not (ie, sometimes the timeline shows a frame where the buttons are not present before returning to them ) you should realise that when they come back into view again, they are not the same buttons as the ones from before. That means that the event listeners you attached the first time are not going to respond to clicks on these new buttons.
This happens because flash always totally recreates timeline objects when they come into view again. Flash can sometimes cope with a "jump" over a "gap" when a symbol is the same, but this is extremely unreliable and should be avoided for this reason.
You can avoid this problem by keeping the ui on the stage at all times, and revealing and hiding the buttons when you need them. Even better, create an instance of your ui in code and add it to the stage when you need it. This way you know there is only one instance, and you are in control of it.