Highlighted

Data storage in the SWF

Explorer ,
Apr 21, 2019

Copy link to clipboard

Copied

I want to create a text input and 2 texts saying completed and in complete and a submit button and if data isnt entered to say incomplete and if data is filled in to say completed and for another text field to recieve the info entered, from here on i need assistance please,

does the swf file hold info entered until the swf is closed ? or if the swf is used with an html file will it then need to work with other html or similar coding to store save and be able to retrieve info entered. If the swf file is emailed to someone to fill in can it be coded to send the info to me by using the swf file sent that was filled in offline and saved and sent back to me ?

TOPICS
ActionScript

Views

848

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Data storage in the SWF

Explorer ,
Apr 21, 2019

Copy link to clipboard

Copied

I want to create a text input and 2 texts saying completed and in complete and a submit button and if data isnt entered to say incomplete and if data is filled in to say completed and for another text field to recieve the info entered, from here on i need assistance please,

does the swf file hold info entered until the swf is closed ? or if the swf is used with an html file will it then need to work with other html or similar coding to store save and be able to retrieve info entered. If the swf file is emailed to someone to fill in can it be coded to send the info to me by using the swf file sent that was filled in offline and saved and sent back to me ?

TOPICS
ActionScript

Views

849

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 21, 2019 0
Advisor ,
Apr 21, 2019

Copy link to clipboard

Copied

just use normal js cookies you will pass trhough flash vars when swf is loaded or use sharedObject

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 21, 2019 0
Explorer ,
Apr 21, 2019

Copy link to clipboard

Copied

ive never tried either,

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 21, 2019 0
Most Valuable Participant ,
Apr 22, 2019

Copy link to clipboard

Copied

How and where you store data in an .swf will vary depending on what you need to do with the data. The simplest is to assign a variable to the textfield on the stage. Then you can get the data by asking for the textfieldname.text .

If you need to interact with content on the html page outside of your .swf then you will need to use ExternalInterface to give and/or get data strings to and from javascript on the html page.

If you need to store data on the user’s local computer after they use your .swf then you will need to use a sharedObject to hold the data until the .swf is opened again. Then it can be retrieved from the local computer.

If you want send data out of the .swf to a third party for whatever reason you will need to use the HTTP send method. This method will send a string to an address. The address is usually to a script of some sort that interprets the data and forwards it to somewhere else, as an email or to a data base, for instance.

None of these are very difficult, but they can seem that way at first glance. There are many examples, in AS2 still available on the web.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 22, 2019 1
Explorer ,
Apr 22, 2019

Copy link to clipboard

Copied

I would like to use all those methods, are you prepared to help me with that.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 22, 2019 0
Most Valuable Participant ,
Apr 22, 2019

Copy link to clipboard

Copied

I or anyone else on this forum can help you. First you have to do the research, replicate the samples and try and build your own example for saving data. If it works for you then you have made a successful project. If or when you run into a problem, post that problem with the code so that someone can help you to find the area that needs correction.

You also need to tell us which version of Flash you are using. I don’t have a copy of any version that still works with AS2, and so I would have to rely on memory to help. As I said in an earlier message, I haven’t used AS2 in years. What is the reason that you don’t want to use AS3?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 22, 2019 0
Explorer ,
Apr 22, 2019

Copy link to clipboard

Copied

i have a as2 project but i can do it in AS3, 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 22, 2019 0
Most Valuable Participant ,
Apr 23, 2019

Copy link to clipboard

Copied

Some of this depends on which version of Flash or Animate you are using and which version of Actionscript you are using. In Actionscript there are two types of variable, local and global. A global variable is created outside of a function by declaring the variable name. If you do not give the variable a value, its initial value is void. Once declared, a global value exists throughout the time that the .swf is playing. Once the .swf is closed the variable and the value won’t exist. A local variable is declared inside a function and is private to that function. I other words, a local variable only exists in a single function and holds a value only while that function is running. You can set or change the value of variable at any point in the .swf. You can change the value of a local or global variable anywhere in the .swf including inside another function.

Read the help files on variables to learn more.

In order to save or send the values in variables you will need to have an internet connection. If the user is offline when they use the .swf, you will have to save the values to the user’s computer and then check for the values when the user goes back on line and then transmit the values.

Look up the information that I gave you in my previous messages about local storage and transmitting information.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 23, 2019 0