This content has been marked as final. Show 7 replies
what type of objects are "evt_obj.target" and "evt_obj.target.text"?
It looks as if the target is an textfield instance (so you should give it a name that indicates it is a textfield).
Are you saying you get the value of "evt_obj.target.text" but "evt_obj.target" returns undefined? I would say this is impossible if both values are requested at the same time. An objects instance variable can not be accessible before the object itself is existing.
Hi, thanks for your answer.
The evt_obj.target is a dynamically created input text field instance. Its instance name is returned and saved into a shared object as it should be when traced. After closing the movie the value of the instance, retrieved from the shared object is returned as undefined. The value of the input text is stored and returned correctly. I just wondered if anyone had come across this before.
Well solved the problem by using String(eval(evt_obj.target))
Still would like to know why it wont work when saved directly, must investigate when I have more time ;)
if you know what the eval command should be used for, you should also know why it is working this way and not the other way.
Take a look at the AS Dictionary part for the "eval" function and you will see that there is a big difference between
So if "target" is only some textual information but not a reference to an object instance it is quite obvious that it didn't work without using eval. So you can either use eval or you simply store a real reference in the variable instead of onyl a textual id. BTW: The second approach without the eval would be the better way to go, since you are fully context indepent if you have a fully qualified reference to an object instance.
Hope this helped a bit to understand what caused the problem initialy
Thanks for your reply. I know what the eval function does and therefore did not use it to start with. The second approach you mention is the one I was using to start with and was returned as undefined from the shared object. So using eval was the only way out.
I think you didn't get my point. But well, as long as it works for you using eval, everything is ok and the problem is solved :-)
maybe it is a language misunderstanding ;) but many thanks for your interest