hey all

so - i've got a Singleton class (Session) that is storing user info.
i've got all my addItem and getItem methods going and all is normal
and fine.

however, in an effort to be more "familiar" to ASP/VBScript developers
who will be using these classes in the future, i'd like to make a way
to do something like:

var session:Session = Session.getInstance();
session("foo") = "bar";

which would set the item "foo" equal to "bar". i can't see that
there's a way to do this kind of non-method calling of the class
instance. however, i CAN do:

session["foo"] = "bar";

and Flash happily (frighteningly?) starts using my class instance as
an associative array. i can even update my getItem function to check
both the instance object array and the associative array and return
the appropriate value. works like a charm.

but it seems _terribly wrong_.

i thought about a static variable of my main controller class, but
don't know if it will function the same - scope and access-wise.

it's late and i may be missing something simple, but... thoughts?
ideas? harsh criticism? is this "okay"? is there a better way to
handle this (short of just saying "this is the API. deal with it!")?

thanks
g.

ps - if anyone reading this cares, i released version 2 of my
AFTERTHOUGHT real-time Flash log reading app yesterday. check the blog
link below for more info.

--
weblog: broadcast.artificialcolors.com
blazePDF: www.blazepdf.com
band: www.cutratebox.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to