View Single Post
Old 01-31-2012, 03:34 PM   PM User | #3
TheIntern
New Coder

 
Join Date: Jan 2012
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
TheIntern is an unknown quantity at this point
I can't, thats against company policy. And I know it won't exist until I create it, that is why I was asked to create an Exist method to prevent the use of an non-existant object.

What I can say is that the code looks like:

ButtonObject = {
MakeTheButton: function(){code}
TheClickMethod: function(){code}
}

I need to know if the ButtonObject exists yet by passing it, or its name into a function I made. However if I try Exists(object) it breaks as it passes by reference, so as of now I think I can only pass its name as a string.

I did find out about eval('Theobject'), but it looks like most people don't like it, that and if the object doesnt exist it throws a script error of undefined. Which is weird...but anyway
TheIntern is offline   Reply With Quote