ActionScript 2.0 :: Save Some Variables In A *.txt Or *.xml?

May 15, 2002

I want to save some variables in a *.txt or *.xml. Is this possible with Flash 5??

for example:I have 2 vars:

varA en varB. They are placed in the root.When I hit a button I want them to be saved on (p.e.) C : gamessave.*

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Save/Load Variables To .txt

Dec 21, 2006

I know Flash applications cannot store data locally for security reasons, however, Macromedia has addressed this issue:

[URL]

But I don't understand that at all...

So, probably using what that link says, what's the best (easiest on the user) way to store data to a consenting user's computer? I don't mind if it has a prompt for permission, but it should not rely on too much software that nobody has (java and shockwave seem ok). The goal would be to store data across sessions, so that it would remain available if one returned to the application after closing it and going offline.

This would be useful for saving a character's HP, experience, and location variables in a game for example... possibly ending up with a .txt file that looks like:

name: Aesir
level: 2
exp: 50
zone: Cave of the Poo
x coordinate: 10
y coordinate: 30
gold: 5

Or something simple like that.

View 3 Replies

ActionScript 3.0 :: Save Variables To Be Used Out Of Events And Functions?

Feb 23, 2010

I'm working on a project for school which is requiring me to make a game using Flash and ActionScript 3.0. One of the tasks I have to do is load an external XML file that will be displaying questions and answers. I've looked at google to find simple scripts for loading XML, one example being below:

Code:
var myXML:XML;
var myLoader:URLLoader = new URLLoader();

[code].....

View 1 Replies

Uses Php To Save Variables To Web Folder On Site In Text File

Dec 2, 2009

I have build a flash form that uses php to save variables to a web folder on my site in a text file. There is a .swf file with dynamic txt fields in the same folder it which pulls the data from the txt file. It doesnt seem to pull it as real time as I would like. sometime just once and not after that.When I update the form the text file saves to the web folder ok, but I have to refresh the link to pull the data in or empty browsing history etc.is there a way around anyone can think of so everytime I update the flash form the data come in straight away or after a few seconds.

View 5 Replies

ActionScript 3.0 :: Input Text: Save Pieces In Different Variables?

Jan 17, 2011

I have an input textfield where the user can enter a long string of numbers, seperated by spaces. Example of this is "2 4 10 20". I made the textbox and made sure it only numbers and spaces can be entered. However, I am looking all over google for a way to split these numbers and save them in a different var when a space is encountered. I don't really know how to even start doing this.

saving in vars does not have to happen in runtime, but only when a button is pressed.

is there also a way to prevent the user from entering a space right after another space?

View 4 Replies

ActionScript 2.0 :: Save / Load Variables In Games? No Cookies

Nov 30, 2004

Once, I wanted to make a large RPG-game. I wanted it to be like Zelda, Diablo2 style of RPG with much Hack-and-Slash but also a little quests and a big world to explore. (a BIG game). A game needs to be programmed, so I had to choose a programming language. I chose Flash, because its easy to make graphics in it, and its not that hard, I thought. The game was planned to be a stand-alone-application that you could have on your computer and play whenever you wanted to. Much like any other game. But, this was not something I thought of in the beginning, games you make in Flash usually is web-games, right? But this RPG I wanted to make was not an online-game, and I didn't want it to be either, because it would be to big to download everytime you wanted to play it.

A RPG-game needs a save game/load game function. But Flash cannot write to external files! This was terrible! Now, its a great safety protection to make flash files not write bad things into your computer. But I need it in order to save my games! There is this way, that flash can load variables from external text files. But is there some way that I dont know about to make it save there to? One way is to make the player manually copy a mass of code (variables) from a window in the game, into the textfile. Any way to write from flash to a textfile?

I know these other two ways of "saving".
1. Using cookies to save and load.
2. Using an online database of some sort to store/load variables.
But they're for online flash applications only... So I'd rather not use them.

View 5 Replies

ActionScript 3.0 :: Save/store Variables To Be Used Out Of Event Handlers?

Feb 23, 2010

create, save, or store variables in event handlers (or functions invoked in them), to be used outside in the main body of a program. I am working on a project that is requiring me to load an XML file and then manipulate certain children in the file. Basically I'm trying to make a question and answer post with the XML storing the actual question and answers, also I'm trying to read in the max number of questions the XML file holds, and any other information. My problem is is that data stored in variables during the event or the function invoked due to the event isn't saved afterward.Here's a simple code from a site on google dealing with loading XML below for reference:

var loadmyXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("test.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);

[code]....

After the event is processed loadmyXML is emptied, so using it in the main body is pointless since the object doesn't contain any data. In C/C++ you'd have to pass objects by reference in order to modify them for outside use, but I haven't seen ANY syntax to show how you'd do that in events here. Like I'd prefer to save loadmyXML, store loadmyXML.questions.length() in a variable also, etc.

It's been a long time since I've used global variables in C so I've forgotten how they really work, but couldn't you just address them / change them inside of a function without ever calling them and it would reflect outside in the main program?

View 8 Replies

ActionScript 2.0 :: Save Data From The Game(like Variables) To A File?

Mar 22, 2011

how can i save data from the game(like variables) to a file that is in my folder and read the variables from it when i open the game it will read the data from the file(save/load data to a helper file in the game's folder)is there a way to do it?(even with shared objects,as long as it use a file that is in the game's folder)

View 6 Replies

ActionScript 3.0 :: Grab Information From A Text File And Save Them In Variables?

Jan 4, 2012

I got a request today conserning .txt files.What I want to accomplish is to grab information from a text file and save them in variables (or an array, depends).Whats the best way to do this, and whats the do's and don'ts?I'm planning to use the LoadVars class to pass the variables through and i've got a working test, but isn't there a more efficient way to do this?

View 9 Replies

ActionScript 2.0 :: Save And Load Data To And From Variables - Reading From And Writing To Textfiles

Nov 26, 2003

I need to save and load data to and from variables. I know how to read from text-files, but not how to write to them. The text-files should work as a "database" for the high-score in a game, I cant use php cause the computer running the game wont be online all the time.

View 6 Replies

ActionScript 2.0 :: Incorporate A 'Save' Button Which Takes A Snapshot Of Their Drawing Which They Can Then Save To Their Computer

Nov 21, 2009

I've designed a painter program where the user can select different colours and 'paint' a custom design on screen. What I would like to do is incorporate a 'Save' button which takes a snapshot of their drawing which they can then save to their computer.

View 0 Replies

ActionScript 3 :: Save File Locally In Flash Without Displaying Save Dialog

Jan 31, 2010

How do we save file locally in Flash (ActionScript 3) without displaying dialog. I know we can use the following code to save file locally but it prompts Save dialog. I don't want this dialog while saving file locally.

[Code]...

View 3 Replies

Flex :: Bypass The Save Dialog Box Of FileReference.save?

Jul 6, 2011

Can we Bypass the save dialog box of FileRefernce.save()? If not, then Is there any workaround to save a file from web application in Flex without asking user where to save file?

View 1 Replies

ActionScript 2.0 :: Save File By Prompting Save Window?

Nov 21, 2006

I need to create a notepad in flash.here how could i save the file by prompting the save window?

View 11 Replies

ActionScript 3.0 :: Save Images With My MyProject.as With FileReference.save?

Dec 20, 2010

i have movie clip with Images and button Save and class MyProject.as how save images with my MyProject.as, with help FileReference.save? what to write in code? how code should look like? tell me good people I want to write everything in a separate class

View 3 Replies

ActionScript 3.0 :: Get Rid Of Save Dialog Box In Filereference.save()?

Sep 22, 2010

Is there a way to get rid of the save dialog box in filereference.save()?I want to specify the filename and location rather then letting the user do it.

View 6 Replies

Professional :: Save CS4 Documents In CS5 Without Save As Dialog?

May 7, 2011

At my college, they have CS4 (master suite) and at home I've got CS5 (design premium). I can save files in CS5 as CS4 so they can be read at college (by Flash) but I have to do it via the "save as" every time I save. After a couple of times, it get rather irritating. Is it possible for me to save in the usual way (as if it was a CS5 document) without the save as dialog every time I save my work?

View 5 Replies

ActionScript 2.0 :: Save A Page - Add Some Sort Of A Password Or Save Feature To People Can Type In The Password

Sep 23, 2008

Im new at actionscript, and I am making a very project. Basicly, I have some thing were there is a page you can get to by beating other parts of the 'game'. I want to add some sort of a password or save feature to people can type in the password of something at the opening screen and jump to that page.

View 1 Replies

ActionScript 2.0 :: Save Files With "Save As Window" From A CD To User Choice?

Jan 19, 2006

I need to open a popup(html) form a Flash projector.

And I need save Files with "Save as window" from a CD to user choice...

View 1 Replies

ActionScript 2.0 :: Defining Variables - Unique To Load SWFs Instead Of Declaring All The Variables

Mar 21, 2012

I have an empty SWF that's sole purpose is to call loadMovieNum and start the project. Each loaded movie has a few variables defined within them - unique to those loaded SWFs. Instead of declaring all the variables in each SWF can I declare all of them in one place, in the first frame of the empty loader it all starts from? I'm thinking I can then declare a variable which each loaded movie can increment as needed for me.

View 2 Replies

ActionScript 3.0 :: Variables True/false Custom Variables Work In Flash?

Aug 20, 2008

How do variables true/false custom variables work in flash?

For example, what I want to do is create a simple true=false variable that I can call on an if statement later.

For example:

Code:
Var1 = true;
if (!Var1)
{

[Code]....

I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.

View 4 Replies

ActionScript 3.0 :: Array Of Variables - Make A Bunch Of Variables From A For Loop

Feb 21, 2009

How can I make a bunch of variables from a for loop. for example for (var i=0; i<total; i++) {var bunch(i);}. that i make a bunch of variables named bunch1, bunch2, bunch3. I keep getting errors. I program and use so many different languages that I dont know if that can be done with AS3. my only other alternative i can think of is to create some sort of event dispatcher object array. but I dont know how to get them all to send events to one listener with there index number.

View 5 Replies

Actionscript 3 :: Changes To Array Of String Variables Doesn't Update The Variables Themselves

Jul 30, 2010

I have a list of strings that I add to an array, then attempt to set those values in a for-loop using data that I read in. The array gets updated, but the values the array contains do not. I also have an array of buttons that I update this same way that works great, but strings don't seem to work the same way. I have tried moving the string array to give it full scope, and still nothing...

public class test extends Sprite
{
// Declare a list of strings
protected var title0:String = undefined;

[Code]....

View 1 Replies

ActionScript 3.0 :: Load Data From Different Variables - The New Variables Come Back As Undefined?

Jun 15, 2010

I'm writing code that takes data from mysql that's processed by a PHP script. It's actually a bit bizarre, at least to me. Anyway, here's some basic AS3 code that's moving toward what I want to do:

var loader:URLLoader = new URLLoader();
var urlRequest:URLRequest=new URLRequest("receive.php");
urlRequest.method=URLRequestMethod.GET;[code]....

For some reason, the statement "trace(evt.target.data);" produces a whole pile of garbled text before the actual stuff that it's supposed to show Because of problem #1, I've had to include a throwaway variable at the beginning, otherwise the first variable I try to pass into AS3 comes back as undefined. This causes errors when I run my flash movie in the IDE, but when I run it from the browser it doesn't seem to have any effect.But this is the strangest thing of all whenever I make any changes to the database (and subsequently try to load data from different variables), the new variables come back as undefined. For example, let's say that I add another entry to the database, and decide to load students 2, 3, and 4 instead of 1, 2, and 3. When I do that, any new data I've added comes back as undefined, even though when I view the PHP output in my browser, it looks just fine.

And now for the REALLY bizarre part: I'll copy that output, paste it into my PHP script as an echo statement, comment everything else out, and my flash movie runs fine. Even though the output from the PHP script is exactly the same, it gives me errors.

View 9 Replies

ActionScript 3.0 :: Array Variables, Variables Not Working Correctly?

Jul 11, 2011

There is a bird, and you control its upwards movement with a key. It has thrust, gravity, it works fine. The problem is I have a bunch of icicles that come at the bird that he is supposed to avoid. I tried this first with math random to use as an x coordinate and than move across the screen, but the icicles had the same x-coordinates sometimes. I tried does not equal(!=) but that doesn't work. I made an array and each number that came out of the array I assigned a different variable. This works fine. I put this variable into the x-coordinate such as mc.x=((n)*60)+480. I did this for five different icicles. All their differnt variables have a different value, and I put them into the same function for each individual video clip, but they still don't go to the right coordinate. Here is the test code just for the initial coordinate of each icicle before it moves...////////////////////////////Quote:

var temp:Array = new Array()
for (var i:int=0;i<8;i++) {
temp.push(i);

[code]......

View 1 Replies

ActionScript 3.0 :: Create Several Variables To Aasign Each One Of Those Variables One Number?

Apr 9, 2011

i am trying to do a loop to create several variables to aasign each one of those variables one number.when i write

[Code]...

View 4 Replies

ActionScript 2.0 :: Check Variables In MyPictures.onLoad, The Variables Are Always The Same?

Aug 5, 2004

I have 2 loadVars - myVars, myPictures

basically i have defined their onLoad functions

so in myVars, i call for

Code:
myPictures.load("http://www.fakedevil.com/lurgee/pictures2.php?id="+this._parent.link2.text+"&time=" add getTimer(), "");

pictures2.php is working cos I just check so by rite the variables loaded should change.. but somehow each time I check those variables in myPictures.onLoad, the variables are always the same.

View 5 Replies

ActionScript 3.0 :: Load Variables, Remembering Variables

Nov 19, 2008

I am trying to load variables from a text file, and have them available from then onwards in the movie, globally so to speak.

While I can read the variable values in a loader function which executes when the text file is loaded, I don't seem to be able to keep those variables available afterwards.

View 10 Replies

ActionScript 3.0 :: Regular String Variables Vs XML Variables?

Jun 20, 2009

I'm trying to figure out which is more efficient in terms of memory and speed. What I'm doing is having a series of messages loaded to the screen. Is it just faster to write them in string variable or in an XML document which is more versatile in terms of editing and adding on to the document.

View 1 Replies

ActionScript 2.0 :: Append 3 Variables To A Url That Already Has 2 Variables Appended?

Jun 8, 2006

iam trying to append 3 variables to a url that already has 2 variables appended .. iam using the LoadVars -> "send" method but it wont work. it works if i use a url like "form.aspx" but it wont work if i use "form.aspx?var=nun" which is what i need so i can append 3 more variables to that URL.

View 1 Replies







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