PDA

View Full Version : Creating an Object from text input



yellowjacket
October 16th, 2002, 07:32 PM
I'm trying to build an object object from input text. I can load the information into a variable using LoadVar with no problem but when I load that information into an object ( object {};) Flash does not recognize the object as on object.

Any ideas?

Yellow jacket

sbeener
October 16th, 2002, 08:17 PM
object is a key word and is the basic building block for a large amount of flash. name it something else.

yellowjacket
October 16th, 2002, 10:34 PM
I guess that my example is not clear. I am using the object initializer which has the syntax of object {};
and I am trying to get my input string e.g.

instr={prop1:value1,prop2:value2...propn:valuen}

into an object so that I can reference

instr.prop1, etc, and get the value of the properties

Does this make sense?

pom
October 17th, 2002, 05:03 AM
Well, if I understand what you're trying to do, you want to loadVars into an object, right?
myLV.onLoad=function(){
myObject={};
myObject.prop1=this.value1;
// etc.
}This should work, I think.

pom :cowboy:

yellowjacket
October 17th, 2002, 09:47 AM
That's it!

thanks

Yellowjacket.