all groups > flash (macromedia) > october 2003 >
You're in the

flash (macromedia)

group:

Text string to SharedObject


Text string to SharedObject pwiop
10/29/2003 11:28:38 PM
flash (macromedia):
Hi folks

I am just begining to explore Fmx2004pro after having used F5. I am particularly entrigued by the ability of the SharedObject to store user input text, however I have not managed to achieve this (mind you I have only been trying for about 10 minutes).

Could anyone explain to me how I can achieve this, or, point me in the direction of a tutorial explaining this.

I mainly use Flash to develop CD based learning material and have been frustrated by it's inability to write to an external txt file. I am hoping that the shared object will be my salvation

Cheers guys

paul


Still Not happening for me!!! pwiop
10/30/2003 4:39:36 AM
The information was interesting but I see still unable to achieve my goal. Each time I try to retirieve the text I save I get and 'Undefined' message.

Ok so Im a lazy so and so but could someone spell it out for me, as in tell me how to do it

Thanks in hope and anticipation

paul

Re:Still Not happening for me!!! pwiop
10/30/2003 8:58:33 AM
Is it possible that it cannot do this??

paul - again

Re: Text string to SharedObject urami_
10/30/2003 9:10:25 AM

[quoted text, click to view]

http://www.macromedia.com/support/flash/action_scripts/local_shared_object/
check for samples the technote link :
"See TechNote 16194 for a demonstration of a local shared object."

[quoted text, click to view]

Check http://www.FlashJester.com , there is a tool call Jsave that allow to do it .


Regards

urami_*



<lsym>

There's no place like 127.0.0.1

Re: Still Not happening for me!!! pwiop
10/30/2003 10:34:17 AM
Hi Urami, not sure exactly who you are but you certainly solve a great deal of Flash probs,good work mate.

I did look at the example and it is pretty good but what I am trying to achieve is slightly different.

Once the user has entered their text I want them to be able to click a save button and then continue hrough other areas of the flash piece.

then, when they return to the flash pice they should be able to hit a load button which restores the text from the shared object.

Every way I try this I get an ' undefined' message, either in the text box itself or in a warning box.

I shall continue to experiment.

By the way I assume many of you guys are in the USA, Im in Australia. Its often tricky to keep up in real time lol

thanks again for the advice


paul


Re: Still Not happening for me!!! urami_
10/30/2003 5:06:15 PM

[quoted text, click to view]

sure possible ...

did you check the technote ?
http://www.macromedia.com/support/flash/ts/documents/local_so.htm

go to
http://www.macromedia.com/support/flash/ts/documents/local_so/local_so.swf
type some text .... than do not touch any buttons just reload the page.....
it will remember your input and even count how many times you have been there.
This is perfect sample on how to store data to drive .



Regards

urami_*



<lsym>

There's no place like 127.0.0.1

Any other suggestions anyone??? pwiop
10/30/2003 11:00:39 PM
I've still not been able to send text input by the user to a sharedobject and retrieve it, has anyone else managed this problem?

cheers

paul

Re: Any other suggestions anyone??? tralfaz
10/30/2003 11:46:21 PM
[quoted text, click to view]

The shared object is local to the user's own hard drive. You can't read it
back from the server. Is that what you are trying to do?
tf


Re: Any other suggestions anyone??? pwiop
11/2/2003 10:10:45 PM
My Flash piece is CD based and loaded onto the end users machine.
There is no web based activity apart from links to websites

What I am trying to do is;

Have a text field that captures the user input, typing in some short notes for example.

Having typed in their name ther should be a button that saves this information to the sharedobject residing on their machine

On returning to the piece, there is a button that allows the user to retrieve the information they saved to the sharedObject, ie, the notes they typed

HOWEVER, when I set this up, I get a message that says 'not defined'. This appears in either the text field set up to display the retieved information, or, in a pop up message.

And bugger me if I do not know what is going on. I have used the sharedobject to save the position of a draggable object which on returning to the piece and clicking a button returns to the position the user dragged it.

I have also succesfully replecated the Macromedia demo of the shared object alluded to further back in this forum.

But I just cannot get it to do what I want it to - bloody odd

cheers paul

Re: Any other suggestions anyone??? pwiop
11/2/2003 11:52:31 PM
For anyone who may be interested I sussed out my problem for the user to be able to enter text and recall it at a

later date. Thus;

On the stage create two text boxes (input), one named 'myInput' the other called 'myRecall'. The 'myRecall'

button also has the variable 'recalledInfo' associated with it.

Create two buttons 'btSave' and 'btRecall'

Create a frame to hold the actions and add the following code

stop();
//instantiate shared object
shareThis=SharedObject.getLocal("savedtxt");

//create save function for the save button - this refers to the text field's name NOT the variable
btSave.onRelease = function(){
shareThis.data.theTxt=_root.myInput.text;
shareThis.flush();
};
//create recall function for the recall button - this refers to the text field's variable NOT it's name
btRecall.onRelease=function(){
recalledInfo=shareThis.data.theTxt;
};

Boomshanka, this does it for me

paul - happy man

AddThis Social Bookmark Button