ActionScript 2.0 :: Pressing A Key Squence To Goto Next Frame Or Scene?
Jun 20, 2008actionscript 2 code to reconize a squence of key presses to trigger next frame or next scene.
View 7 Repliesactionscript 2 code to reconize a squence of key presses to trigger next frame or next scene.
View 7 Repliescan anyone tell me how you would press say three keys at once and be taken to a specific frame? thats the best i can do and it doesn't quite work, one in ten trys it works so im utterly confused
[Code]...
I am currently working on a project that has a movie clip, in Scene 1. I would like this movieclip to be able to play from this scene and go to Scene 2 (next scene) when it reaches the last frame of it. I use CS4 & AS3.
View 6 RepliesI have a Flash movie that uses three scenes. In scene one I have a button with some actionscript to take it to a frame label in that first scene and play the movie from that point on. It works fine. The problem is, in the third scene, I am trying the same action with a different button, going to a different frame label in that third scene. I am getting an error saying the frame label does not exist in that scene. Even though it does! I've checked for typos and everything looks fine. I've copied and pasted the simple actionscript from the third scene below. Is there a line I need to add to make this work in a scene that is not the first scene?
rocketstart_btn.addEventListener(MouseEvent.CLICK, rocketbutton);
function rocketbutton(event:MouseEvent):void {
gotoAndPlay("rocket");
}
I have a number of buttons (that are in an array), I want to add a function that basically says:
If the name of the button that you have just clicked on == (is the same as the name of the scene label) then go to that scene: Now I have used this handler function which seems to work O.K, except for the fact that it keeps trying to goto the FRAME label instead of SCENE label.
I keep getting the error message when i click on a button saying:
ArgumentError: Error #2109: Frame label mars not found in scene home.
at flash.display::MovieClip/gotoAndStop()
function autoGoTohandle(event:MouseEvent):void {
for (var i:int = 0; i < arrayItem.length; i++) {
if (event.currentTarget == arrayItem[i]) {
gotoAndStop((destArray)[i]);
}}}
I figured it must be this line of code at the end: gotoAndStop(+(destArray)[i]);
But how do I change it so it goes to the scene label name and not the frame label name? I Tried adding quote marks like
gotoAndStop(("destArray)[i]");
But I am getting errors.
I have four scenes, it loads on the first scene. I click the button which sould go to scene four but it goes to scene 2.
View 2 RepliesI put a movie stopped, I want that when I press (enter) the movie go to and play my next scene. How I can make that?
View 2 RepliesI want the movieclip in Frame 1 Scene 1 to finish before skipping to Frame 2 Scene 1 im using gotoAndStop("Scene 1", 2); at the end of the MC
View 1 RepliesI have an flv video playing from a FLV Playback component. I am trying to have the movie goto the next scene at the end of the FLV video. I have go through numerous tutorials online to get the action to do this, but to no avail. I have tried both addeventlisteners and NS. way to have the movie advance to the next scene after the flv and where the AS has to be to get the movie to function properly.
View 5 Repliesi have 3 scenes: loading, menu and animation.when i'm playing the animation scene, i have a slider. I wanna use it as a on/off switch to go back to my scene "menu" so it goes like that:the bouton (instance "onoff") of my slider (on root of "animation"):on (press)[code]i have a movie clip also on root of "animation" that does a small loop between its frames 1 and 2 and i added the script:[code]So my question is, why can it control a MC and not jump to a scene??
View 14 RepliesI have an FLV video playing from a FLV Playback component. I am trying to have the movie goto the next scene at the end of the FLV video. I'm using Action Script 3. How do I do that?
View 1 RepliesI created a scene that contain a .flv imported(external not into timeline). I want exactly after finishing my .flv , go to next scene. I tried some ways, buut they didnt work.
View 6 RepliesI wrote this AS for my preloader which schould be able to load a movie clip after pressing a specif button in the main sceene:
[Code]....
1) The problem is that to be able to target a movieclip I will need to give it a instance name. Where can i find this function in MX ?
2) I cannot understant how I schoul put a loadBar being a small movieclip on the main timeline, I think( the same timeline the container clip is at ) or maybe not ? well I am bit confused now..
Well I have done already a sceene preloader for my site and it works perfectly and i did not experience any problems as Im having now with this new kind of preloader.
I am getting better at Flash 8, but I have a problem. I am in a Movie Clip, and when you press 'g' it returns you to the first scene, and I want it to go to the second scene.
on(keyPress "g"){
_parent.gotoAndStop("Scene 2",7);
}
Is there a way you can do that?
I have tried to get the advanced gallery to work and now it does but it does not disappear when you going to another scene. What should I write to get it to stop when you want to go to another scene and where should I write it? I used the tutorial on this site to get my gallery: [URL]
The code lookes like this, written in the first frame in a scene:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");
myGalleryXML.onLoad = function() {
[Code] .....
I'm trying to create a game for a class project, using Flash MX. Unfortunatly, I am unable to figure out how to goto a new scene when the score reaches a certain number.
The ActionScript for it is...:
//hit
_root.total = _root.total + 100
//miss
_root.total = _root.total - 50
[Code] .....
I've even tried using ""'s around 'score' and other things, but still no luck. I still havn't figured out the stupid timer either...
I have a movieclip in my main timeline as a menu. I want to go to a different scene in the main swf file depending on what scene I am in. Right now I'm using an if statement on the button within the menu (see below) but when I click on the button it only plays the first line of the if statement.
on (rollOver, dragOver) {
gotoAndPlay("s1");
} on (rollOut, dragOut) {
gotoAndPlay("s2");
} on (release) {
[Code] .....
We have craeted a viral video.I converted raw video to an FLV file and created a swf playing file which progressively streams the FLV file.At end of video I just want to have a final screen that shows some animated text. How is this done?!That is my confusion. In the swf playing file (that calls FLV file) can one program an Action Script that identifies when video has stopped playing and then move to say Scene 2, Frame 1 to play animated text?
View 9 RepliesI have been really strugling getting my buttons working. I have one scene that have multiply buttons that shows from time to time on the timeline. My needs is that each buttons when released goes to an specific frame number (label) waits for 5 sec and then continue playing the scene from were it did stop and wait.
I have mamage to make the first buttons work, but when scene changes to the rest of the buttons on the timeline nothing happends. I have tried to place actionscript on an actionlayer (timeline), also tried to apply actions to each button. Same problem. I use actionscript 2. All buttons have instance name, and they shuffle, meaning that they show and dont show depending were on the timeline you are. This is for an adult site, so I am not sure that it is allowed to post an link to the flash scene.
Just finally making the transition from AS2 to AS3.All i need to do at this point is make two buttons which will control the movie to goto next frame and previous frame. I have gotten how to make the buttons go to a specified frame number and also a button to go to a specified external url but no success in making a simple next/previous pair of buttons.
stop();
but1.addEventListener(
MouseEvent.MOUSE_UP,
[code]....
i created a two layer in time line in one layer there is a movieclip called mc1. In the same layer in 15th frame i have another movie clip mc2. Inside the movieclip mc2 i created another movie clip at frame10 now if i clik the the mc1 on first frame The movie clip should goto and stop at tenth frame
View 4 RepliesWhen you click a button I want my flash to go to the frame label where the movie clip is located, and then play a certain frame of that movie clip.
View 5 RepliesArgumentError: Error #2109: Frame label null not found in scene Scene 1. at flash.display::MovieClip/gotoAndPlay() at intro_fla::MainTimeline/intro_fla::frame606()[intro_fla.MainTimeline: :frame606:3]
View 3 RepliesI'm trying break down a large Flash project into smaller swf's using a Loader :
stop();
var reqA:URLRequest = new URLRequest("New_Inro.swf");var loaderA:Loader = new Loader();
function imageLoadedA(event:Event):void { addChild(loaderA);} loaderA.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadedA);loaderA.load(reqA);
Some of these swf files are animations which have code that states :
MovieClip(parent).gotoAndStop("frameThree");
The first loader works but I cannot get that swf to move on to the next frame(frameThree) to load the next swf file
Instead I get this message
ArgumentError: Error #2109: Frame label frameThree not found in scene Scene 1. at flash.display::MovieClip/gotoAndStop() at New_Inro_fla::MainGuy_1/frame146()[New_Inro_fla.MainGuy_1::frame146:2 ]
I'm getting this error in the OUTPUT window, when I PREVIEW (COMMAND + RETURN) my SWF:
ArgumentError: Error #2109: Frame label nGallery_btn not found in scene Scene 1.
at flash.display::MovieClip/gotoAndStop()
at BrookBrovazMusic004_fla::MainTimeline/pageSelect()
- The funny thing is that the SWF works the way I want it to. You can view it here: http://brookbrovaz.com
- I just don't like the idea that something's wrong, according to the OUTPUT window anyway.
[Code]...
the error is:
ArgumentError: Error #2109: Frame label instance121 not found in scene Scene 1.
at flash.display::MovieClip/gotoAndStop()
at Untitled_fla::MainTimeline/goLabel()
this is my code:
stop();
function goLabel(e:MouseEvent):void
{
[code]....
i am using a movie clip button to open a swf with a loader. hope i m not missing any information/other coding....
I've created a class which simulates an action for example a ball bouncing about a screen thus I'd create it like so:
Code:
var Ball1:ball = new ball(x,y);
How would I go about adding this to a loop, in a sense of every frame add another ball till you reach the maximum balls
currently after looking in help, google and forums this is all I could find
Code:
var ["Ball"+currentball]:ball = new ball(x,y);
but this doesn't seem to work and just causes
"**Error** Scene=Scene 1, layer=balls, frame=1:Line 15: Identifier expected"
I have created a new Flash file using A3.It has a menu system which all works, I have included trace code that outputs button pressed.So the next step is when the right button is clicked it takes them to the next scene. Please note I have coded it in AS3. When I compile it returns no error however at run time when I click on the buttomit returns the following error:
Menu 1, button 1
ArgumentError: Error #2109: Frame label contact not found in scene Scene 1.
at flash.display::MovieClip/gotoAndStop()
at menuformason_fla::MainTimeline/itemButtons()
[code]....
at first, I thought I could manage this myself searching the forums about "preloader" but none of the solutions seem to work. I think it has to do with the fact that I'm using the FLVPlayer with an external file. What am I looking for?
1. Well, the preload code for frame 1 that makes sure the external F4V (movie.f4v in the same dir) is loaded 100% before it jumps to frame 2 where the movie should start playing...
2. If possible, a progress bar.
I am making an online portfolio and I have created the following scenes:homeaboutontactright now, I have three movie clips on the home screen that I have created into buttons.
on (press) {
go to Scene 2, frame 25 ?????????????????????
}
What I would like to do is after someone clicks on the button, it should then jump to another scene's specific frame number. So for example when you press the "about" button, the playhead goes to the "about" scene to 25th frame. Same thing for each button