Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-12-2002, 10:07 PM   #1
djungle
Member
 
Join Date: Jul 2002
Location: Planet Rock
Posts: 74
Unhappy user.data.name + user.data.name

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è
djungle is offline   Reply With Quote
Old 07-13-2002, 07:21 AM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

How about:
ActionScript Code:
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:
ActionScript Code:
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.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 07-14-2002, 12:28 AM   #3
djungle
Member
 
Join Date: Jul 2002
Location: Planet Rock
Posts: 74
Default Index

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!
djungle is offline   Reply With Quote
Old 07-14-2002, 02:23 AM   #4
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

Sorry I don't understand that second bit of your question...
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 07-16-2002, 04:01 PM   #5
djungle
Member
 
Join Date: Jul 2002
Location: Planet Rock
Posts: 74
Default

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
djungle is offline   Reply With Quote
Old 07-17-2002, 12:50 AM   #6
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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...
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 07-17-2002, 01:07 AM   #7
djungle
Member
 
Join Date: Jul 2002
Location: Planet Rock
Posts: 74
Default Array

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
djungle is offline   Reply With Quote
Old 07-17-2002, 01:10 AM   #8
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

Something like:
ActionScript Code:
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.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 08-19-2002, 03:56 AM   #9
djungle
Member
 
Join Date: Jul 2002
Location: Planet Rock
Posts: 74
Post

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/...dressbook.html
Enjoy.
djungle is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.