I'm quite new to Flex so please forgive my newbieness. I'm
not even sure how to phrase a search for the solution to my
question, so I'm sorry if this has been discussed before:
I have a form with 2 states that a user is to fill out and
submit to my server (step 1, step 2, no problem, I've got that
far). I want to have the contents of each field saved into a local
shared object as the user fills out the information (again, no
problem I've got that figured out) as it's a lengthy process and
the user can close their browser and come back to where they left
off at a later time without having to re-enter everything.
I'm saving the information in the shared object using the
object's id as a key. Example: mySharedObject.companyName =
Where I'm getting stumped is when the user comes back to the
the form, and the previously entered data is drawn from the shared
object, how can I reference the original form object from the
shared object's key? Part of my problem is that some of the text
forms are contained within another container (such as a canvas), so
it's not as simple as iterating through the objects in the
application and assigning the saved values based on a comparison of
the objects id.
Any guidance in the right direction would be greatly
You might have to store that path information in the lso.
For example, the "key" might be
You woul dhave to parse that string:
aPath:Array = key.split(".") ;
and at each step, get a referenct to the corresponding
So at your main app level, you might do:
var target:UIComponent = this[aPath];
target = target[aPath];
But actually, that is kind of crazy.
Instead, put your data in some known structure at the main
app level, say an associative array, then in each component, when
it instantiates, maybe the creattionComplete event, call up to the
main app and retrieve the values you want.