ActionScript 3.0 :: Saving Progress (inventory Items Or Partial Actions Taken)
May 21, 2010
I am learning flash, and to do so I'm writing a little adventure game. My current issue is with saving progress; namely, having the game remembering what was done on previous frames. I've experimented with Booleans, who work nicely for small stuff, but it's proving more difficult to save things like inventory items or partial actions taken.
Google pointed me towards SharedObject, which would save data regardless of frame, handy! It seems to have the side effect of remembering the data even when closed though, meaning I have to erase it before every test. So now I'm thinking of turning it into a proper save & load system, like in a real game. But now I'm left to wonder, is SharedObject really the best way for me to save progress made in individual rooms? It's really simple stuff like redKeyTaken = true or greenDooropen = false (wheres then the movieclips of redkey or greendoor jump to their correct frames) What would you guys recommend for keeping track of individual room(frame) status? Keep using SharedObject and just flush at every action, or is there a better way?
View 4 Replies
Similar Posts:
Dec 9, 2010
So you start off with all of the items in the inventory. You do not have to collect them.I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.[code]I thought this. called on every movieclip of the Rebound class?So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.
View 1 Replies
Dec 9, 2010
So you start off with all of the items in the inventory. You do not have to collect them.
I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.
What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)
it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.
but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.
here's the class
Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code]....
I thought this. called on every movieclip of the Rebound class?
So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.
View 1 Replies
Dec 6, 2010
I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.[code] if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead.
View 7 Replies
Dec 9, 2010
So you start off with all of the items in the inventory. You do not have to collect them. I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class. What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP). It goes to frame 2 of its movieclip and making a variable I made up called isSelected = true. But when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.
Here's the class
Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Rebound extends MovieClip {
public var isSelected:Boolean;
public function Rebound():void {
this.addEventListener(MouseEvent.MOUSE_UP, starting);
[Code] .....
I thought this. called on every movieclip of the Rebound class? So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.
View 1 Replies
Dec 13, 2007
I have a character that can move on two dimensions, and i've got coins and a money counter. I'd like to learn how to make random items go into an inventory.
View 1 Replies
Jun 28, 2009
I am using the tutorial for the simple inventory system located here. I've got it working fine within my game I'm making. However, if the player uses an item in the middle (or, in fact, anywhere other than the end) of the inventory list, it leaves a gap where it once was. How would I go about making each of the found items in the inventory move back one slot upon the player using an item?
I've uploaded a sample of my current inventory system here. To understand what I mean, pick up all four items (in any order) and then "use" one of the first three items you picked up. You should see a gap has been left in the inventory. I want this gap to be filled in by the remaining items in the inventory once said item has been used.
I've been thinking about it and I think a method that may work would be to do a hit test for all of the slots every time an item is used (to check if any slots don't have any items overlapping them), and move all of the items that are positioned to the right of it left by 60 pixels (as each slot and item is 60x60). This could work in theory but I'm not sure if it's the best method, or how to actually do it. Does anyone know how I could achieve this? Or know of any better tutorials for inventory systems that include this feature already?
View 1 Replies
Jun 1, 2005
I am making a gta style game, and, i was wondering wat methods i could use for tehm to save their progress..It is an online game..(i think u may need to know that)
View 1 Replies
May 24, 2010
I am developing a static flex application which does not have a database connection, all the values are hardcoded(its just a prototype for the original app). Now when I click the save button, i need to get a message like saving in progress... please wait, I need to display this message for 3 seconds.
View 3 Replies
Sep 15, 2009
The application will pre load 5 different images and place them in an array of bitmaps.My only problem is that i want to display a progress bar to the user.I know how the calculate the progress of one image:progressBar.source=loader.contentLoaderInfo;but i want to load the images using a loader one by one, which means that after each loaded image
View 1 Replies
Jun 4, 2010
I have an SWF movie (1375 frames) and created a progress bar (248px wide) with a slider that moves according to the movie progress. I'm doing that next way:Calculating the distance for the slider to be moved each frame (248 / 1375) On each ENTER_FRAME moving the slider for the calculated distance The problem is - the movie ends far before the slider reaches the end of the progress bar.
I'm thinking that the distance (Step 1) is is somehow ends floored by Flash and the actual distance it moves the slider is smaller than required. That's why the movie ends, but the timeline control just passed the 2/3 of its way. My question is - is there any solution for the problem? Or any other way to go, if it's a wrong one?
View 2 Replies
Mar 2, 2011
I have a progress bar inside a repeater and therefore I will need to use getRepeaterItem to set it's progress as suggested in this question.
How can I do that such that the value of progress may be taken from repMonitor.currentItem.threatLevel?
<mx:Accordion id="monAccordian" includeIn="Monitoring" x="10" y="10" width="554" height="242" change="monAccordianChange()" >
<mx:Repeater id="repMonitor" dataProvider="{monitoringArray}">
[Code]....
View 1 Replies
Mar 5, 2012
I'm making a sort of interactive graphic novel and was wondering how would I implement some sort of inventory system. Btw, I'm using Actionscript 2.0
----INVENTORY SYSTEM 001----
You see, I would like the ending screen to show a summary of what the player has done in the game.And certain points in the game would add certain 'items' into the inventory which will in turn affect what is displayed in the summary screen.The 'items' here being words or phrases.eg:
Quote:
You _______ with the _______ and proceeded to _______. But you _______.
For example, if the player chooses Path A, summary screen will show: eg:
Quote: You stabbed the unicorn with the shark fin and proceeded to shag your mistress. But you ate a pecan pie.But if the player chooses Path B, the summary screen will instead show eg:
Quote: You stabbed the tree with the shark fin and proceeded to shag the corned beef. But you smashed a watermelon and caused a civil war.
----INVENTORY SYSTEM 002----
I think with a few modifications, this inventory system could also be used to affect the outcome of the movie depending on what item the player currently owns? Please enlighten me if this system is feasible.
The player is given a choice to pick up a spoon or a fork in the beginning of the game.The player is later faced with a soup crisis. If the player has previously picked up a spoon, the soup can be consumed. Otherwise, the soup is left well alone.
View 13 Replies
Sep 17, 2010
Suppose all that happens initially in a client swf is a user clicks a hyperlink in a text object of the swf, so this requests a "page" from the server. In response the server just modifies that existing swf in the client browser, by for example (?) invoking public functions of it, and possibly passing in as parameters the name of image or data files which were also downloaded in response to the URL request. The crucial part is that all that can happen initially in the SWF is a URL "page" request. Is this commonly done and if so, how.
View 1 Replies
May 12, 2009
I have gone thru the Kirupa's tutorial "Using XML in Flash CS3/AS3", and it helped a lot in my project. Now, I have a question in XML searching. If an attribute's value is say title="kirupa tutorial" and a user wanted to search only the word "kirupa", then how can i get this node of xml, which title is "kirupa tutorial"..
@title == "kirupa" only works when the whole word matches the value of "title" attribute, but i want to search a partial word.
View 8 Replies
Jun 19, 2011
I have a series of frames one the timeline. Each frame has a graphic and a mouse click leads to the next frame. Think Myst.
[Code]...
When the middle frame is returned to, clicks no longer change anything. I believe that the actions of the 'left' frame are replacing the one's in the middle frame so then it is told to gotoAndStop to itself.
I'd like to know if that is indeed what is happening and how I can make it stop.
View 1 Replies
Mar 17, 2011
I'm working on a batch process script that's executed from Flex. The batch script is in a .aspx Page and returns partial results through the following class:
public class ResponseLogger
{
private HttpResponse _response;
public ResponseLogger(HttpResponse response)
[Code].....
In my Flex application I'd like to show the result as soon as it's flushed on server side. Can this be done using Actionscript?
View 1 Replies
Jul 22, 2011
I need a button, or movie clip, to fade partially when clicked.This code worked but caused everything else on the screen to fade too. And I don't know how to fade down to 20% instead of 0?I am a newbie so please could you give a specific code example.
Code:
on (release) {
this.onEnterFrame = fadeOut;
[code].....
View 3 Replies
Nov 29, 2010
I'm moving on with my optics system in Box2D (which seems to run into its share of kinks and platform limitations, but that's a subject for another time) and I expect to have the need for a way to procedurally draw sprites for varying shapes of lenses.Really, the critical component of this process seems to be the ability to draw partial circles. By this, I mean a part of a circle if it were divided from the whole by a straight line through the circle's interior.
View 2 Replies
Nov 8, 2011
I know this might sound odd, but if I wanted to create an app using Flash for my iPad, but just for me,not for distribution, do I still have to have an Apple Developer license?
I just want to create an in-house app for pricing and inventory. It's a unique business, so selling it isn't even an issue, but I don't want to have to spend another $99 just to try it out and see if this would be something we'd use long-term.So, can I make an iPad app just for myself without anything extra?
View 2 Replies
Jan 18, 2012
I'm trying to implement an inventory functionality into my program, i.e. equipping and taking items off a player character. I have created a superclass named 'Item' which I would like another two classes to inherit from. Those would be 'Weapon' and 'Armor' classes. The superclass 'Item' contains at this moment a list of variables that can describe any item, e.g. name, slot, armor, damage, durability. No methods have yet been added. My question is: if my superclass holds all the properties of an item, how exactly would those properties be inhertied by the other two classes? Is it even a good idea? My initial thought was to create a motherclass to hold all the variables and later methods, you could name it a 'variable pool', wherefrom each one could be used by other classes, but it makes me wonder if's going to be of any use. If you don't mind, would you create for me two short code snippets to show me how a superclass can cooperate with its subclasses?
View 1 Replies
Mar 27, 2005
I'm having trouble getting a certain function in my inventory to work properly.
View 5 Replies
Oct 10, 2005
Right now i have an inventory, but it is on the same page as the character and the map and stuff. I am trying to get it so when you pick up an item that it will go to a seperate frame or something. Like just an inventory page. And then I would need to know how to go back to the main screen from where you left off.
View 2 Replies
Sep 25, 2009
I have been creating an Inventory for my game and some thing go wrong... here is my code :
[code]...
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Shape@2565a101 to flash.display.MovieClip.at Untitled_fla::MainTimeline /drop Item()
View 2 Replies
Oct 24, 2002
how to create an inventory system for a flash game? Ya know, those stuff that like lets say there's a box on the screen, you click on it and it is added to your inventory, then you can select it from your inventory screen and use it for stuff.
View 3 Replies
Mar 27, 2005
I'm having trouble getting a certain function in my inventory to work properly... here's what I have...
View 6 Replies
Nov 20, 2008
I have an XMLList from a feed that takes the form shown belowand has about 90 'contact' nodes within it.I can use E4X to filter the list by a node value and displayall contacts from the uk say but now I am trying to search by nameas the user types in to a text field and am stuck.What I want is that each time a character is entered in thesearch field a list is created that contains only objects whosfirstName node value contains what the user has entered. This mightbe a full name or just the first few letters.I managed to do this easily with an array of data by usingArray.filter() and String.search() but with an XMLList I am stuck.I could create an array I suppose but that seems dirty when the
View 4 Replies
Dec 9, 2010
I'm drawing some cars. They're Bitmap's, loaded from PNG's in the library. I need to be able to color the cars-- red ones and green ones and blue ones, whatever. However, when you paint the car green, the tires should stay black, and the windows stay window-color.
I know of two ways to handle this, neither one of which makes me happy. First, I could have two bitmaps for each car; one underneath for the body color, and one on top for detail bits. The underneath bitmap gets its transform.colorTransform set to turn the white car-body into whatever color I need. Not great, because I end up with twice as many Bitmap's running around on screen at runtime.
Second, I could programmatically search-and-replace "white" with "car-body" color when I load the bitmap for each car. Not great either, because the amount of memory I take up multiplies by however many colors I need.
What I would LIKE would be a way to say "draw this Bitmap with JUST THE WHITE PARTS turned into this other color" at runtime. Is there anything like this available? I will be less than surprised if the answer is "no," but I figure it's worth asking.
View 3 Replies
Oct 19, 2011
I've got a string in AS3 composed of two elements that is dynamically assigned to a textField. I want to make one element one color and the other a different color. Code below: allInfoForSchedules = data[j].weekDay + " " + data[j].scheduleType + "."; I can make the entire string change color but not just one part of it.
View 1 Replies
Jan 20, 2010
I have made revisions to my SWF file and only part of the SWF loads. I have included the path for the .FLA
[URL]
I have checked and rechecked the AC_RunActiveContent.js (attempted to update and that failed)
I get this error when I attempt to Run command to update the AC_RunActiveContent.js "At line 5 of file "AC_RunActiveContent.js": ReferenceError: navigator is not defined".
View 0 Replies