Changing From One Scene To Another Without Buttons

Oct 23, 2010

I'm creating a game in which you have to click/shoot the correct number as it passes by and when the scoreboard reaches 2 certain scores I need the scenes to change. I've managed to make it work for one scene where when the score hits 10 it changes to the next part of the game. However I also need to make it so that when the score hits -5 the scene changes to the "Final Score" scene where the player is taken if they lose. When I tried to use the same script I used the first time I just didn't know where to place it and it didn't work. How can I have 2 scripts working on the same timeline so that if the score reaches 10 the game proceeds but if it reaches -5 the game ends?

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Changing From Scene 1 To Scene 2

Apr 24, 2008

im on scene 1, and i made a button which i want so when i click it, on release it will switch the whole flash movie to scene 2 but they doesn't seem to work.i want it to go to Scene 2, Layer 1, Frame 1. i renamed my scene2 layer 1 to 'fishwater' then i put this code on my button [code]

View 9 Replies

ActionScript 2.0 :: Changing Scene With Variable?

Jan 11, 2012

trying to make my first game using flash. I have done the main thing, setup a character which can be moved by the user to catch some falling balls. Every time a ball is caught, the score goes up by 1. To count and display the score, i have used a number variable called "caught" defined in the main timeline with initial value 0. The main timeline has only 1 frame and stopped by codes in the level "action". The "caught" variable is used in many movieclips in the scene and its value changes as the character catches the ball.

Now when the score is 10, i want to go to a new scene that shows a "congratulation you win" animation. For this, I have wrote the following code in the movieclip of the main character -

onClipEvent (enterFrame) {
if (_root.caught == 10) {
gotoAndPlay ("Scene 2",1);
}
}

But this does not work. The score goes upto 10 and then beyond 10.Is there anyway I can use the value of a number variable to determine when to play a particular scene?

View 4 Replies

Actionscript 3.0 :: Changing Scene After Php Event?

May 15, 2011

I made a flash login in flash cs5 following this tutorial ( completed code at the end)and I was wondering how I can use the "this is the user bio" retrieved from the php to change to a different scene. What i am trying to do is have the scene change after a person logs in sucessfully

View 2 Replies

ActionScript 2.0 :: Changing Something In Unvisited Scene?

May 1, 2003

can I let a button change an mc in a scene that hasn't been visited yet?

View 4 Replies

Changing A Flash Scene When Highlighting A CSS Button?

Nov 4, 2009

I have a menu that is HTML/CSS. When I mouse over a menu item, I would a Flash header to change scenes accordingly.

Is this possible, and if so, how would I go about doing it?

I will be using Flash 8. I know how to animate, but I know nothing of ActionScripting. I'm a web designer, not a developer.

(I'm aware I could make the menu in Flash as well, but I personally don't care for having navigation set in a Flash .swf.)

View 3 Replies

ActionScript 1/2 :: Changing The Value Of A Variable In Movieclip From Scene?

Nov 13, 2009

i have a probleme changing the value of a variable in movieclip from my scene. i explain: I have combobox on my scene containing categories,and in the scene i load an xml file containing links to php files that work with the combobox.Also on the scene i have a movieclip "filmstrip", inside this movieclip on the first frame i have a script loading the php file selected in the scene. i use a load() function with a variable "theUrl" inside like this : T.load(theUrl);.In my scene i want to change the value of "theUrl" inside the movieClip filmstrip. I tried filmstrip.theUrl = url; But it doesnt work
 
the xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>[code]....

View 7 Replies

ActionScript 3.0 :: Changing Scene When ComboBox Changed?

Jan 14, 2010

I'm a complete newbie to Flash and programming, so please forgive my lack of knowledge! I have been trying for a good couple of hours now to do what I'd think would be a simple task - change scene when the value in a comboBox is changed.This is the code I have:

stop();
dropdown.addEventListener(Event.CHANGE, changemade);
function changemade(event:Event):void {

[code].....

View 3 Replies

ActionScript 1/2 :: Object Staying After Changing Scene?

Oct 23, 2010

i am making this simple drag and drop game using flash cs3 using as2.i got 4 games and it has the same codes but different game type.. basically it uses drag and drop.here is the problem, when i finish the game, and press the back button to go to the selecting game scene, the last object dropped in the previous game stays and appears in the scene after that.
  
below is the as2 code i am using.
  
--- 
// global variablesvar tabbingON = false;var draggingON = false;var selectedPiece = 0;var totalPieces = 10;var total = 0;var mySound = new Sound();var origPos:Array = new Array();var justHit = false;var offset = 50;var counter = 0;
 // function callsinitGame();

[code]....

View 4 Replies

ActionScript 2.0 :: Object Staying After Changing Scene?

Oct 23, 2010

okey i am making this simple drag and drop game using flash cs3 using as2.

i got 4 games and it has the same codes but different game type.. basically it uses drag and drop.

here is the problem, when i finish the game, and press the back button to go to the selecting game scene, the last object dropped in the previous game stays and appears in the scene after that.

below is the as2 code i am using.

HTML Code:
// global variables
var tabbingON = false;
var draggingON = false;

[Code].....

View 0 Replies

ActionScript 2.0 :: Stop Sound While Changing Scene?

May 18, 2004

I have created an into to my flash site. I have put the intro in one scen and the main site in another. While the visitor watch the intro, he has the option to click "Skip intro", then he goes directly to the main site scen.In the intro scen I also have added a sound trackSo, I would like to find a way to stop the sound when the visitor click the "Skip intro" button and are linked to another scen. Right now the sound continue to the end of the sound track, even though I click to change scen. Does anyone know how to do this?

View 1 Replies

ActionScript 2.0 :: [FMX04] Changing Background For A Image With One Click On EVERY Scene?

Jan 8, 2006

I have set up ma flash project to have various scenes. One of these scenes is a page whereby when a user clicks on a button he/she can change the background image on every scene in my project.On each scene i have made a layer called 'background' and drawn a black rectangle which is the default background. This has been converted to a graphic using F8.What i'd like to be able to do is when the user clicks on the button he/she can change this default background to 1 of 4 photo's i have in my library.i have tried the code:

on (release)
{
colorchange = new Color("/rectangle");

[code]......

View 3 Replies

Flash :: Make A Button Navigate From Scene 1 To Scene 2 Without Displaying Both Scene Content In Scene2?

Jan 27, 2011

ive made a button in the scene 1 which i have managed to navigate to scene 2 but when i click the button it goes to scene 2 but displays everthing that is in scene 1 in scene 2, how can sort this out so upon the button click in scene 1 it goes to scene 2 and only display content in scene2.

[Code]...

View 1 Replies

Using Buttons To Go To The Next Scene

Jun 16, 2009

I am very new to flash. I am building an interactive video player. I am trying to get one scene to go to another scene with the use of a button, but everything I do is not working. I keep geting the null error when it tries to look at the scene I am directing it to. I have looked at other forums and can not seem to find a resolution. The first scene just seems like it doesnt want to stop and then when it does the null error comes up. Here is the last action code that I have been using.

[Code]...

View 3 Replies

ActionScript 1/2 :: Scene Changes On Buttons?

Mar 19, 2009

I have made a button in flash and i want the movie to to change to a different scene when clicked. I have attached the below code to the button but for some reason its not working

on (release) {
gotoAndPlay("Turns invisible 1st decision", 1);
}

View 2 Replies

ActionScript 2.0 :: Passing Parameters - Swf Should Open A Particular Scene Called 'Scene 2' Rather Than Scene 1

Sep 13, 2004

Check out this code:

[CODE]...

everything here is fine. It opens finely. But... i want to pass parameters where if i click a button in html page My.swf should open a particular scene called 'Scene 2' rather than scene 1. i tried

[CODE]...

View 2 Replies

Professional :: How To Get Multiple Buttons In Scene

Mar 22, 2010

I've got this scene which is a movie clip; the only movement is in the models eyes, so I want to add invisible buttons around the scene that the user can interact with. When a certain object is clicked (the button) it triggers a short movie clip in the bottom corner of the scene, which is basically a text box typing letters.

However, I've tried to do this and I've come across two problems.
One, I can only click the button once, it won't repeat itself again.
Two, I can only seem to add one button as it's a movie clip and it messes with the others in the scene.

Here's a screen grab of what I've got: [URL]
I want multiple buttons in this scene, and I want to be able to click them as many times as I like.

View 1 Replies

ActionScript 3.0 :: Scene Navigation Via Buttons?

May 26, 2011

I've looked at endless tutorials, including ones that just say "copy this code" and none of it works, so here I go: I want to make a flash document that will play 20 different scenes. The scenes are independent of one another (will stop when they reach their end rather than continuing to the next, etc.), and are selected for viewing via a navigation bar on the left side (with 20 buttons respective of each scene, obviously). So, I've tried numerous code to try and make the first frame of each scene recognize all the buttons (they are the same for each scene), and make each button skip to it's respective scene.

However, nothing seems to work. Even the "stop();" function ceases to work as soon as I try to enter more code to make the buttons work. So, my question, in essence, is how do I get something like this to work? A generic example code or template would obviously be very useful (instance name and such are not complicated, as I just use "button01_btn" "button02_btn" / "Scene 01" "Scene 02" etc.), I'm using actionscript 3, but admittedly know very little about coding

View 7 Replies

ActionScript 2.0 :: Creating More Buttons On One Scene

Sep 12, 2009

Basically, i want 5 buttons in one scene to link on to different scenes. The buttons are images. I tried doing it and each button goes on to the next scene which is not what i want.I have converted the images as button symbols and added actionscript on each of them, but it just links on to the next scene instead of going to different scenes.[code]

View 2 Replies

ActionScript 3.0 :: Buttons Linking To Only One Scene?

Jan 11, 2010

So I have 3 buttons. One button links to an animation, the second button links to a different animation, and the third one shows the links. The first button works properly, but when I click on the second button, it goes back to the animation that is shown at the first button. How do I fix this? Here is my code for the first button:

button2.addEventListener(MouseEvent.MOUSE_DOWN,mou seDownHandler);
function mouseDownHandler1(event:MouseEvent):void {
gotoAndPlay(1, "random");
}

I have made sure that the button's instance name is button2, and that the scene name is "random".

Here is my code for the second button:

button3.addEventListener(MouseEvent.MOUSE_DOWN,mou seDownHandler);
function mouseDownHandler2(event:MouseEvent):void {
gotoAndPlay(1, "random1");
}

View 2 Replies

ActionScript 3.0 :: Removing All Buttons On A Scene?

Aug 10, 2010

I am using the following code to remove all buttons on a scene but it throws a RangeError and leaves behind one button.

ActionScript Code:
var childCount:int = _mc.numChildren;
var i:int;
for (i = 0; i < childCount; i++)

[Code]....

View 5 Replies

ActionScript 3.0 :: Navigate From One Scene To Another With Buttons?

Dec 3, 2010

I am trying to navigate from one scene to another with buttons. the first scene is a simple Main Menu that has a button and when clicked it navigates to another scene. The code works and takes me to the scene, but once I am at the new scene I lose focus of the scene until I click on the stage. The second scene uses the keyboard to control the scene and not the mouse. Is there something that I need to add to the new scene so when I get there that I will have focus of the scene instead of clicking of the stage.

View 6 Replies

ActionScript 2.0 :: Buttons (movieclip) To Scene?

May 9, 2005

i opened the buttons from lindquist in this thread:I have posted already a reply but i thought it i good to start a new thread.

View 9 Replies

ActionScript 3.0 :: If 3 Buttons Clicked - Go To The Next Scene?

Aug 16, 2011

I have a game where there are five buttons which can be clicked (which will play sounds). But once 3 of them have been clicked, the user is taken to a new scene.

I have the following code, I'm completely lost why this isn't working:

Code:
var buttonArr:Array = new Array (button1, button2, button3, button4, button5);
var t: int = 0;

[Code]....

make the game go to a new scene once 3 buttons are clicked?

View 3 Replies

ActionScript 3.0 :: Buttons Don't Work Past First Scene

Aug 17, 2009

in the first frame, first scene. Shouldn't that be where I but the include? (the buttons do work in scene) The buttons that are defined in external.as work in the first scene, but not in the other scenes. When I do an "include" in every scene, I get errors, no buttons work (makes sense....that should throw errors).

[Code]..

View 4 Replies

ActionScript 2.0 :: How Many Times Buttons In Scene Are Clicked

Nov 7, 2009

Action Script 2.I have a count function that counts how many times the buttons in my scene are clicked.It counts upwards on each mouse click:root. count+=1.I know this is working because a trace(_root.count) shows appropriately.When count == 6, I need to trigger a sound. My code is as follows;[code]The problem is, it's not triggering the sound as expected, even though the _root.count trace is showing 6.

View 2 Replies

ActionScript 2.0 :: Scene Is Not Working In Nested Buttons?

Dec 7, 2011

I have two scenes on my flash file viz., Scene 1 and Scene 2.

I have created one nested button i.e., button inside the movieClip and one normal button as in the following code.

ActionScript Code:
jan_btn.onPress = function() {
gotoAndStop("Scene 2", 1);
}

[Code]....

The problem is the first button jan_btn works and it goes to Scene 2 when it is clicked. But the second nested one i.e., button inside the scroll_mc movieClip is not working.

I have kept jan to dec buttons inside scroll_mc movieclip (it will scroll) and kept on stage.

Why nested button i.e., button inside movie clip is not going to Scene 2 when it is clicked?

View 1 Replies

ActionScript 2.0 :: [MX2004] Transfering To Another Scene Without Using Buttons

Oct 20, 2005

i want to transfer to another scene when the player hits the enemy...but i can't transfer to that scene unless i use a button to link me to there....you know like in rpg games, when you hit the enemy there will be the fight scene....how can i do that...without using any buttons?

View 10 Replies

ActionScript 1/2 :: Move To Another Scene Automatically Without Presing Buttons

Sep 16, 2009

1-What is the ActionScript command to move to another scene (like for example if I want that when Scene A reaches frame 340 is moves on to frame 1 of Scene B automatically without presing buttons, what ActionScript should I put in frame 340 of Scene A)?

2-What actionscript code should I put on a button so that when I click it it starts playing Scene X?

I know this should be relatively easy to find, and I promise I'll search next time, but I just don't have much time now

View 2 Replies

ActionScript 3.0 :: Same Set Of Buttons Controlling MovieClips In Current Scene

Mar 27, 2012

I'm just starting to learn as 3.0, and was having problem understanding the scenes, timeline (stage, root) and movieclips.

Basically now I have two scenes: S1, S2
S1 has one mc: round_mc ; S2 has one mc: rect_mc
And I have same set of control buttons: play, stop, prevFrame, nextFrame, prevScene, nextScene, gotoAndStop()

The control buttons worked with the round_mc in S1, but didn't control rect_mc when S2 is playing. Why same set of buttons doesn't work in all scenes. Should I have to assign a variable to detect movieclips on the current scene...

Code:
import flash.events.MouseEvent;
import flash.display.MovieClip;
prevS_btn.addEventListener(MouseEvent.CLICK, preScene);
nextS_btn.addEventListener(MouseEvent.CLICK, nexScene);
prev_btn.addEventListener(MouseEvent.CLICK, preframe);
[Code] .....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved