ActionScript 2.0 :: Store A Simple Cookie That Will Remember The Score For The Next Time The User Plays The Game?

May 6, 2007

I'm just trying to store a simple cookie that will remember the score for the next time the user plays the game (the score governs if an option is visible or not)It all works fine until I close browser/reload the page, at which point the shared object seems to disappear, any clues?

Write:

Code:
var rem_score:SharedObject = SharedObject.getLocal("score");
rem_score.data.score = new Number(score);
rem_score.flush();

The problem prolly lies in my write code but ill post the reading aswell just incase there is a problem with that too

Code:
var rem_score:SharedObject = SharedObject.getLocal("score");
if (rem_score.data.score != undefined) {
this.remdscore = rem_score.data.score;
if (rem_score.data.score >=30) {

[code]...

There is another point it is read but it is the same sort of thing as the above.

View 1 Replies


Similar Posts:


Flex :: Air - Cookie - Storage - Remember A Simple Value Like Date When The App Was Last Opened

Feb 14, 2012

Does an AIR app built with Flex have something similar to a browser cookie? I want the app to remember a simple value, like date when the app was last opened. I'd rather not create a SQlite database just for this.

View 1 Replies

ActionScript 3.0 :: Tracking Time - Count The Seconds Passed While Playing The Game And Gives A Bonus Multiplier To The Current Score When The Game Ends?

Mar 15, 2009

Is there a way to get this code to work? It's meant to count the seconds passed while playing the game and gives a bonus multiplier to the current score when the game ends. I don't know how to get the returned value to combine it into the multiplier int variable. Is there any way to get this code to work or is it completely wrong?

View 11 Replies

ActionScript 2.0 :: Flash8 Simple Game Score Not Working?

Mar 28, 2011

I'm following a tutorial to make a simple game. The aim of the game is for a player to evade a flying enemy ; the higher the score, the faster the enemy. The main elements in the game are the enemy the player and a score card.

However, from following the tutorial, and adding the dynamic text field etc....the score doesn't actually work.

This is the code that I was instructed to place on the first frame of the Scripts layer:

//Game Variables
enemySpeed = 5; //Set Enemy initial speed
numberEnemy = 4; //Change this to add more Enemies
score = 0; //Set initial score to 0

[Code].....

View 2 Replies

ActionScript 3.0 :: AS2 To AS3 Conversion / Simple Score & HitTest For Bug Splatter Game

Sep 26, 2011

Non-programmer here, struggling with having to now (finally) work in AS3.I've looked around, but can't find something similar (or as simple) as my old AS2 scoring - hitTest method was.Problem 1: my converted AS3 game does not hitTest or score.[code]I have a Dynamic text box on the stage named "scorecounter" which is now displaying "0" when the game plays. This is correct.When the gun (mouse) is clicked, we then tell the "hittest1" MC to play, which will detect hits. All Correct.[code]The hittest1 MC plays, and checks if the "cursor" MC was touching the "bug1", and tells it to animate (splat) All bug detections are listed in the hitTest frame - "bug1" through "bug30", ie. the code below x 30. This Fails - maybe because the hitTest MC lists all 30, and not all bugs are visibile at once, some are hidden until required later in the game?[code]Then on the last frame of the "bug1" MC (frame 10), it tells the score to add one. Also Fails - maybe because of errors above, nothing is being processed now.[code]

View 5 Replies

ActionScript 2.0 :: [Flash8] Game Score (A Simple Timer) Not Working?

Mar 28, 2011

I'm following a tutorial to make a simple game. The aim of the game is for a player to evade a flying enemy ; the higher the score, the faster the enemy. The main elements in the game are the enemy the player and a score card.However, from following the tutorial, and adding the dynamic text field etc....the score doesn't actually work.This is the code that I was instructed to place on the first frame of the Scripts layer:

//Game Variables
enemySpeed = 5; //Set Enemy initial speed
numberEnemy = 4; //Change this to add more Enemies
score = 0; //Set initial score to 0

[code].....

View 1 Replies

ActionScript 1/2 :: Game Score - Points To Be Time Based

Jul 18, 2009

Is there an actionscript for a point system? I want my points to be time based from this script
stop();
count = 60;
countdown = function(){count--;
if (count ==0){clearInterval(doCountdown);
gotoAndStop(11);
clearInterval(doCountdown);
}}doCountdown = setInterval(countdown, 1000);

View 5 Replies

ActionScript 3.0 :: Create A Game Where Circles Appear On The Stage And When The User Clicks On One It Disappears And Their Score Is Updated?

Dec 12, 2009

I'm trying to create a game where circles appear on the stage and when the user clicks on one it disappears and their score is updated. The circles appear for a short time then dissapear. If they dissapear before the user clicks the user looses points. The game is to last 20 seconds then the user will be shown their score and a little thanks for player message. This is what I have so far:
 
stop(); 
addEventListener(Event.ENTER_FRAME, playGame);
function playGame(Event):void    {

[code]....

Now what I'm having trouble with is all the timing. I need a way to turn the visibility off the circles after a few seconds of being created and I also need to set the duration of the game for 20 seconds.

View 5 Replies

Actionscript 3 :: Make A Score Counter For A Small Game Where The User Clicks On A Button On The Stage?

Mar 28, 2012

I have been trying to make a score counter for a small game where the user clicks on a button on the stage, each time the user presses the button the score increments by 10, however I cannot get the score to display on the dynamic text field.

var score:uint;
//scoreCounter is the instance name of the dynamic text box
function updateScore():void{
score += 10;
scoreCounter.text = score.toString();
}

View 2 Replies

ActionScript 3.0 :: Make A Simple Game Loop Using Delta Time?

Jan 14, 2012

I have looked everywhere for an example or tutorial on a delta time game loop in AS3. I found many fixed time step examples but very little helpful information on delta time game loops and how it works. I have seen examples that do the calculations in a timer and also seen examples that do the calculations inside the enter_frame event. All the examples I have seen are also incomplete and only provided me with bits and pieces.

View 3 Replies

ActionScript 2.0 :: Store Variable In Session/cookie?

Jul 14, 2009

I have a variable (array) in my ActionScript 2 file, called webshop.Is this possible to store in a cookie (or PHP session) so if a user visit my shop and add items to the basket (the variable webshop) and leaves the page, but then returns later on it will create the variable with the users already stored items?I think it would be most intuitive if it only stores the variable for the browser session, so if you close the browser and open it again it will reset the variable. But if you just leave the page it should save it.

View 1 Replies

Professional :: Store And Read 'cookie' Or Shared Object For A Mute Button In Flash?

Jun 10, 2010

I have only ben using flash for a little while and do not know a lot about action scripts.I have used a flash file found online which plays music and has a mute button, but at present it plays the music when the page is viewed at another time.So need to have a cookie or shared obect as i have been told it is, so that when the music tries to play it can read the mute state cookie to decide if it should play or not.i see i can not upload a file so have uploaded to the following location

View 1 Replies

ActionScript 3.0 :: Using 3.0 To Remember User Actions?

Oct 3, 2010

I have seen similar threads, but I am trying to recreate something I saw on a similar site where the user can record actions such as clicking buttons to produce sounds and stop the recording and then replay what the notes that they played.

I realize that I will need an array of some sort, but I am trying to work it out and I can't seem to get my head around how do replay actions such as the site example above.

View 1 Replies

Professional :: Prevent User Open / Play Flash Game On Multiple Browser Windows At One Time?

Mar 12, 2012

I made a game as the same site URL..Anyone knows how to prevent user open and play game on multiple browser windows at a time?I used flash control to embed flash into aspx page and connect to sql server

View 4 Replies

Can Flash Remember Buttons Clicked For A Game

May 18, 2009

I am making a game for the university I attend.  I am having students choose between college and high school by two buttons to see if they choose the correct answer. Then I want it to display the number correct on a result page I will have them print out for the instructor of their freshman seminar class.Can flash remember if a specific button was clicked?  I have each button with a unique name and could it tell which one was clicked to help me figure out results?
 
Otherwise, I was wondering if there was a way I could have flash keep track of "points" so I can display the number correct.  Would it be possible if I gave each button a numeric value and somehow added up the numbers from each button to put over a total score of 12 (that's how many questions there are)?  Could it be done in a dynamic text field?

View 2 Replies

Actionscript 3 :: Flash - Prompt User To Remember Camera And Mic Settings

Sep 22, 2011

I request my user from mic and camera setting on my website with Flash, but the remember checkbox does not show, so every time my user logs in he's requested once again for permissions, how can I make the checkbox show to avoid this?

View 1 Replies

ActionScript 2.0 :: Making Flash To Remember User (In Browser Cache)

Nov 16, 2009

I would like a Flash application to remember the settings that a user on a specific machine or specific browser has earlier set. This is possible, right? What's the most neat way of doing this? Using some kind of a flash cache?

View 3 Replies

ActionScript 2.0 :: Shared Object - .sol File Remember What Buttons Are Clicked On By A User And Assign An Alphavalue

Apr 13, 2004

I'm trying to learn shared objects by attempting a basic function. I would like to have an .sol file remeber what buttons are clicked on by a user and assign an alphavalue for the buttons that have been clicked. Here's what I have..

[Code]...

View 8 Replies

ActionScript 1/2 :: Developing A Simple Score Counter?

Jan 10, 2011

Working on a simple score counter for my young son -- the idea is to simply add or subtract 1 digit to reveal the score. The variables only need to be 0-9 in each column. Can someone advise on how to make this work correctly? The animation was developed using a root.xxxx +1 or -1. It does the trick but as you can see, it keeps going into the double digits in each column.

He personally does not care about the code glitch -- but his perfectionist Dad does [URL]...

View 3 Replies

Android :: Cross Platform Game - IOS : Develop A Very Simple Game For Iphone/ipad?

Mar 7, 2012

I am going to develop a very simple game for android and for iphone/ipad I have the option to develop it in cocos2d or in adobe flash air (i am not a developer, but i have 2 developers who are offering me the service)I have a developer that states that cocos2d is better and other one that states that adobe flash air.I want it in cross platform.the cost offered by both developers is the same..i have heard that adobe air has the flaw that it is very slow, is this real? if you had the 2 options which will you use to develop your game and why?

View 1 Replies

ActionScript 3.0 :: Flash - Writing A Simple Game Rule For A Platform Game?

Feb 28, 2011

I'm creating a game at the moment for my university course and it involves the player character jumping on top of boxs twice to break them as opposed to just once.What would be the most efficient/simple way of writing this in Actionscript 3.

View 1 Replies

ActionScript 2.0 :: Local Shared Object Or Cookie To Track Time

Jan 28, 2010

I need to make a local shared object (or javascript cookie function- below) that I can use to calculate the time since an ad was last loaded. It's an expanding ad, and I only want it to expand once every 2 hours. (Trying to keep the expanding-annoyance to a minimum!) I understand the basics of creating an "lso" but the action script for retrieving the time, placing it as a variable in the lso, and later retrieving it to figure the time is well beyond me. I considered a normal browser cookie, set to delete after the session, bypassing all time calculations... Forcing javascript to create a cookie ONLY when flash tells it to (after the ad has expanded) is tripping me up and creating a function to check for the cookie on the first frame to decide whether or not to continue is also beyond my simple animation skills.

View 0 Replies

[CS3] Score Counter In A Shooter Game

Nov 24, 2008

I have a simple shooting game set up. 25 monsters appear on the screen, one after another, until no monsters are left. If you hit one before it disappears, the score increases. If you don't, the score stays the same.

In the actions frame, I placed an empty dynamic text box named score, and set it equal to 0 (declared in the main actions frame). But, seeing as though the monster actions are coded into the library item itself, do I have to declare score, and the score increase there instead?

View 4 Replies

ActionScript 3.0 :: How To Save User Information And Score

Dec 15, 2009

I'm working on a project using AS3 and timeline coding. I can't figure out how to save user information and score. When I run the movie and complete form and answer quiz questions, information is displayed on closing section, but it doesn't save.
 
Here are the main sections by label:
 
// SECTIONS
Introduction (labeled "intro") -- contains directions
Information (labeled "inf") -- collects user information
quiz-questions (25 questions -- from q1 to q25) -- presents questions

[code]....

View 4 Replies

ActionScript 2.0 :: Only Show Button If User Gets To Certain Score

Mar 23, 2010

I have recently created a quiz that allows user to submit score to database, however I only want the submit button to be available if the user scores 100 % (all questions correct). This is the actionscript used on the final summary screen. is there a way to add to this? if userScore = 100 then display submit button, else leave blank.

Code:
userScore=(numOfQuestionsAnsweredCorrectly*100)/
(numOfQuestionsAnsweredIncorrectly+numOfQuestionsAnsweredCorrectly)
stop();

View 3 Replies

ActionScript 2.0 :: GAME - Submit Score Via Email?

Apr 5, 2009

I have a question which I think should be fairly simple but my AS knowledge is rather poor so i'm wondering if someone could help me out or point me in a direction to find out how to do this...

I'm playing around with a game, (skinned it and slightly modded it) and at the end I want the player to be able to enter his email and hit a "submit" button and have his score emailed to me? Is this simple?

View 1 Replies

Add Highest Score Table In My Flash Game?

Jul 27, 2009

I want to add highest score table in my flash game ? I want to upload my game to web so visitors can play on my page and see how good they were. Im working with as2

View 1 Replies

ActionScript 3.0 :: Negative Score In Catching Game?

Dec 6, 2011

I'm trying to edit the actionscript of catching game in which a object fall from top to bottom and if the catcher fail to catch the object and the object hit the bottom, the score is subtracted. [code]In addition, how do I end the game after the catcher fail to catch at least 5 objects to go to "game over" screen with final score displayed?

View 10 Replies

ActionScript 3.0 :: Score Board For A Game Show?

Jun 7, 2011

I need to create a score board for a game show at work for staff. The score board must keep score on the left and right parts of the screen. score must start as default on 0. Then every time I press for example the left arrow key the left score must increase by the value of 1 and when I press the right arrow key the left score must decrease by 1.Same goes for the right score only with differant keys example up and down keys. This sounds very simple and I managed to get it to work when I tested with only 1 score, but failed when adding the second score to the picture.

View 5 Replies

Flash :: Write Game Score In XML File?

Feb 19, 2011

I am working on a flash game which is a shooting egg game. I want to export a score(what ever it may be ) to the xml file so that using php developer can take it from there n post it to the wall just like we play games on facebook n it asks you that "Do u want to post your scores?". The variable of Dynamic text box is score.

View 1 Replies







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