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
Similar Posts:
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
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
Jul 28, 2009
When I place a FLVPlayback Object on scene 3 I get the following errorTypeError: Error #1009: Cannot access a property or method of a null object reference.atUntitled_fla::MainTimeline/__setProp_flv_promo1_Scene3_Layer1_0()atUntitled_fla::MainTimeline/frame1()
View 11 Replies
Jan 27, 2009
I made a scene with movement and everything, but when I convert it to a symbol I lose the movement frames. I want to be able to import it as an object so that the animation loops for as long as I need it to in the other project.
View 1 Replies
Jul 28, 2009
When I place a FLVPlayback Object on scene 3 I get the following errorTypeError: Error #1009: Cannot access a property or method of a null object reference. atUntitled_fla::MainTimeline/__setProp_flv_promo1_Scene3_Layer1_0() at ntitled_fla::MainTimeline/frame1()
View 1 Replies
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
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
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
May 1, 2003
can I let a button change an mc in a scene that hasn't been visited yet?
View 4 Replies
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
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
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
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
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
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
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
Feb 6, 2011
So I have a bunch of objects (thumbnails) and I want every photo to be displayed on top of other photos once it's clicked. So what should I put inside the click handler inside the photo object?
View 1 Replies
May 16, 2011
I am trying to use buttons to jump to frame labels. They jump to the label just fine, but they won't stop when pressed again. Below is the code I am using to have the button rest when pressed again.
getting_btn.addEventListener(MouseEvent.CLICK, gettingStarted);
function gettingStarted(evt:MouseEvent):void {
gotoAndPlay("ipad_in");
[code].....
View 2 Replies
Jan 15, 2009
All of the variables that i define in frame one appear to no longer be defined in frame 2.
Here is a snippet of the actual code from frame 1 and frame 2 in case I'm missing something.
Frame 1:
ActionScript Code:
function init() {
var markedFrom = myVariables_xml.firstChild.childNodes[0].firstChild.nodeValue;
//trace("Marked From: " + markedFrom);
[Code].....
View 9 Replies
Sep 9, 2010
My flash document that has multiple frames that the user can navigate by clicking buttons. Each frame has unique symbols that will zoom to full screen when the user mouses over the thumbnails. The problem I am having is that the LAST picture that is "rolled over" stays on the page, no matter the frame.
For simpicity's sake let's say one frame has pictures of dogs that go fullscreen on rollover. The second frame has pictures of cats that go fullscreen on rollover. So when you go to the cat page, you will still have a symbol of the last dog picture you moused over from the previous frame sitting there on the cat page.The way the rollover effect is being done is a movie clip symbol. The actionscript is as follows:
stop();
this.onEnterFrame = function(){
if(zoom == true){
prevFrame();
}
[code]...
I think it has something to do with the "this.swapDepths(100)" command. keep the symbols from "following" the user around multiple frames and, instead, just stay to their propper frame?
View 1 Replies
Apr 1, 2005
how to make a button stay in its over state when it's clicked, and then go back to it's up state when another button is clicked?
i can't remember how to do this.
View 4 Replies
Aug 5, 2004
i'm doing a school project of mine and i am having trouble doing the changing color objects. here is an axample of the script that i;m using:
on (rollOver) {
var colorful = new Color("_root.shapes");
colorful.setRGB(0x003366);
}
For this script it does change color, but how do i make it to stay the same color that user selected after going to another scene?
View 2 Replies
Apr 6, 2011
I have three images and I want change the images size based on the scene size (default size is 1024x768). After each image has completely loaded I call bindableUtils.setter to set width/height when scene size changes but I don't know how to make a pointer or something like that. I'm using a public var img, but it only works with the last complete image.
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].......
View 2 Replies
Mar 23, 2009
I have a new web page I've doing that works fine except that when one clicks on a link then you have to go all the way back to the introduction of the site. What would the code be for allowing one to "stay in the same window" after clicking on this link?
For example:
<a href="http://www.angelfire.com/in/HansonArtGallery/stephenportrait1.html"><u>"View From the Past"-Self-Portrait</u></a></font><br><font color="#ffc56c">
View 10 Replies
Apr 13, 2009
i have this code on a button inside a mc:
on (press) {
rotateCWscreen1.onPress = function() {
screen1.onEnterFrame = function() {
[code]....
View 11 Replies
Jul 19, 2010
I have a flash intro and when ever I preview it,the intro background turns to black instead of staying the way it should be.Can somebody please help me out here,I need this flash intro for a website.Please explain this to me in simple terms because im pretty NEW to adobe.
Note I've tried everything to make the flash background stay the way it was but nothing I do works.
View 6 Replies
Jul 24, 2008
I have an image that will double as a button to make it larger if you click it. on the rollovers I have a plus and minus sign depending on which size the image is currently.if you click the image and it gets larger the cursor will probably still be on the image. Therefore the minus_mc won't play until you move your cursor off then back on the image. How can I have the rollover refresh without having the cursor move off of the image?
View 1 Replies
Apr 1, 2010
I have an image that I want to make into a button/movie clip that starts out color then fades into black and white (that has text on top when it fades into black and white) when its clicked, and stays that way.....how can I achieve this?[URL]His is reversed from B&W to color, and stays in color after it clicks. I want something like that but B&W when its clicked instead (with text on top)
View 6 Replies
Dec 18, 2009
I wonder how can i check that concrete object is on the scene for example:
var sprite1:Sprite = new SPrite();
stage.addChild(sprite1);
...
if(?????)
[Code].....
View 2 Replies