View Full Version : user.data.name + user.data.name
djungle
07-12-2002, 10:07 PM
Hi,
I'm no Programmer but can anybody tell me if this is possible!?¿¡
I have a form that saves user's info into a sharedObject, the problem is that I don't know how to get the data to add into the file not to overwrite itself!
This here is my code :
on (release) {
user = SharedObject.getLocal("user_info");
user.data.usrName = usrName.text;
user.data.thought4theDay = thought4theDay.text;
user.flush();
_root.gotoAndStop("Menu");
}
Can anyone tell me if this is possible!?! And if it is, possibly give an example of the code do so.
Thanks
Merçi
Gracias
Choukran
Xièxiè
Jesse
07-13-2002, 07:21 AM
How about:
on (release) {
user = SharedObject.getLocal("user_info");
user.data.usrName = user.data.usrName + usrName.text;
user.data.thought4theDay = user.data.thought4theDay + thought4theDay.text;
user.flush();
_root.gotoAndStop("Menu");
}
Which is the same as:
on (release) {
user = SharedObject.getLocal("user_info");
user.data.usrName += usrName.text;
user.data.thought4theDay += thought4theDay.text;
user.flush();
_root.gotoAndStop("Menu");
}
That will concatenate (add) the new text to any exisitng text.
djungle
07-14-2002, 12:28 AM
Thanks for the code Jesse, I see how that will work.
Another question though!
Is it possible to index each additional entry, and and have all entries (from that post) connected?
Ex:
user.data.NameOfEvent = user.data.NameOfEvent + NameOfEvent.text;
user.data.Cost = user.data.Cost + Cost.text;
What I would like to do is be able to select the NameOfEvent in a dropdown box and have the cost and other details of that Event shown (on another frame in their respective text.box)!
Many thanks!
Jesse
07-14-2002, 02:23 AM
Sorry I don't understand that second bit of your question...
djungle
07-16-2002, 04:01 PM
Hi,
Basically I'm working on an Activity Monitoring system for an NGO!
The way it works is : They will enter data such as : "the activity", "date", "cost", "place" etc...
what I am trying to do is to write all the activities and their info into one shared object??? Is there alternatives.
I would like to have a combobox that would look into the shared object for "the activity"...and populate the textfields with the activity's info : "date", "cost", "place" (Is this possible???)
Thanks
Jesse
07-17-2002, 12:50 AM
I would be using arrays in the SO then. That way you can give the array to the drop down box, and when the user selects item 1 from the activity array you know that the price wil be item 1 int he price array and the locationw ill be item 1 in the location array...
djungle
07-17-2002, 01:07 AM
Thanks again Jesse,
Would you be able to show me how to code that array?
Also I'm not sure how to dynamically populate that dropdown box!
Thanks for the help!:)
Django
Jesse
07-17-2002, 01:10 AM
Something like:
on (release) {
user = SharedObject.getLocal("user_info");
user.data.usrName.push(usrName.text);
user.data.thought4theDay.push(thought4theDay.text) ;
user.flush();
_root.gotoAndStop("Menu");
}
I haven't used any of the prefab drop downs in Flash before so you're likely to figure that out as fast as I can.
djungle
08-19-2002, 03:56 AM
I've found the source code I needed.
Colin Moocks address book application is the same type of thing I was trying to do :
http://www.macromedia.com/desdev/mx/flash/articles/addressbook.html
Enjoy.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.