Link to home
Start Free TrialLog in
Avatar of JohnnyKnoxville
JohnnyKnoxville

asked on

Simple Flash MX 2004 Question

Can you write flat files in MX 2004 pro ?  I need to introduce some type of logging capabilities.  I'll need to store some user session data in some type of collection object and then write it to a file.  Is this possible?  


Do collection objects exist?  If not.....is there any type of struct, enumeration, dictionary object, multi-dimensional array or anything of that nature to store my data during a user session?

thanks

knoxxx
Avatar of Calron
Calron

You can't write files driectly from flash. There is something similar to cookies though:

http://www.macromedia.com/support/flash/action_scripts/local_shared_object/

If you need to write files you will have to go through php, asp, or something like that.
Avatar of rascalpants
can you explain your project a little better...  It helps to know what you want to do...

but it seems that all you need to do is store some variables and then have them sent to a new file...


what will the new file be used for?  


rp
Avatar of JohnnyKnoxville

ASKER

Im making educational software and need to track the user's progress, grade, response time, etc...

I was planning on writing this data to a file at the end of the assignment (or session).  If the user closes the program....I'll like to use some type of terminate event that I can store all the data prior to the app closing.  Then I can have another app that can control the reporting functionality.  How bout XML?  can I store all of the session data and write it to an XML file?  What about shared objects?  just learning as I go.  Not really familiar with flash.

thanks,

knoxxx
It depends whether you have your application online or if you are planning to have it executed locally. If you run it online you will have to go through php or asp no matter what, as you can't save files directly from flash. You can easily write some kind of script that will let you save an xml.
I would not wait until the application finishes, as there is no way to detect when a user closes the browser. You would have to continually update your file.

The same would be if you  run as an application. But there you will need a third party software that will let you save files. Have a look at:
http://www.multidmedia.com/software/flashstudio/
I will be running this as a standalone application.  What is meant by a projector?  Is this just the app window?  If Im running as a standalone app......cant I just store all of the data as shared objects?......and then send it to an XML document?  That way the data will persist even if the application is closed.  I suppose I could just log the data for reports when the user actually completes an exercise.  Im brand new so any help you can provide is greatly appreciated.  Im learning through tutorials as fast as I can. :)


thanks,

knoxxx
If you want to make a standalone application you will not be able to use shared objects. You will have to use a third party tool like the link I posted to be able to save files. You can save the files in whatever format you want (i.e. xml). The only drawback is that you will have a hard time finding such applications for mac if you needed it. The saaving after each exercise is a good idea.
ASKER CERTIFIED SOLUTION
Avatar of rascalpants
rascalpants
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's good to know. I never even tried to used shared objects in standalone apps. I always thought that it wouldn't work....
someone on this board asked for a way to disable(after trial was over) a stand alone app, and the only way that I would think of was to use a shared object...

I would be glad to post that example if you want to see it...  it was originally written for a normal desktop computer, but I was able to use the same techniques for the Pocket PC as well...


rp
Yes, please post the example, it's always good to have such examples
here you go:

http://www.kcnewmedia.com   /dev/so.zip

this is the Pocket PC version, but it will work on a regular PC as well...

rp
PS.  take out the spaces in the above link...

I don't want the search engines to index my files...

rp
Thanks a lot, I'll be trying this out ... :)
Johnny K,

what is the status, man?

rp
Thanks rascalpants.  That was very informative.  I noticed that when you use an XML connector.  The parameter tab shows 'send' , 'receive', and 'send/receive'.  Wouldnt this allow me to send data to an XML document?  If not....it seems misleading.   Thanks for all of the help everyone.


knoxxx
you can receive the document, but there is no way to actually create a document...  

I am definately not the expert on Flash and XML integration, but from what I have read, this is the way it works...

rp