I was building a library of whacky slide show effects that quickly
lost my interest, though it is still impressive to look at.
For the demo I had a form that allowed me to switch the effect class
on the fly by typing it in (so I didn't have to hard code a bunch of
option tags).
Other than that ... I think you're right, it's pretty hard to imagine
that you can know the string but not the class itself.
Ryan Florence
[Writing TextMate Snippets] ( http://blog.flobro.com/ )
On Nov 10, 2009, at 8:08 PM, Aaron Newton wrote:
I have a hard time imagining when you don't have that option.
Maybe if the user gets to choose from a form input...
On Tue, Nov 10, 2009 at 4:17 PM, Ryan Florence
<[email protected]> wrote:
I was doing this once upon a time and then realized it is just as
easy, if not easier, to pass the class around instead of a string
that represents it.
Of course, sometimes you don't have that option.
Sent from my iPhone
On Nov 10, 2009, at 6:25 PM, Jon Hancock <[email protected]>
wrote:
thanks, that does the trick!!!
On Nov 10, 6:14 pm, Aaron Newton <[email protected]> wrote:
new window[classNameString]();
assuming it's at the glogal namespace.
On Tue, Nov 10, 2009 at 3:10 PM, Jon Hancock <[email protected]>
wrote:
I have a string which represents a name of a class defined using
mootools Class.
I can't figure out how to create an instance based on this string
name.
The following does not work:
new (classNameString)();
Any ideas?
thanks, Jon