It's not needed, as the 'int' class has various formatting functions.
These functions can even be called on constants, if you trick the compiler
a little bit by wrapping them in parens:
trace("hex: " + (4097).toString(16));
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4522 542714f4-19e9-0310-aa3c-eee0fc999fb1
I will probably repackage everything I placed under "mx" soon...
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4516 542714f4-19e9-0310-aa3c-eee0fc999fb1
It was always a little special, since it's dispatched from the client, but
I want it to be handled like other messages so that we can recolor
different parts of the message as I do in metasoy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4495 542714f4-19e9-0310-aa3c-eee0fc999fb1
response constants start with E_ and their codes start with e..
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4491 542714f4-19e9-0310-aa3c-eee0fc999fb1
- Use -dynamiclib instead of -bundle as per Apple's recommendation
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4489 542714f4-19e9-0310-aa3c-eee0fc999fb1
Changed the name to _controlledPanel because otherwise it interfered with
subclass _panel variables. (Actionscript won't let variables be masked).
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4483 542714f4-19e9-0310-aa3c-eee0fc999fb1
(Time values are ints and start at 0 when the flash player starts up,
there is a different way to read the epoch millis, returned as a double)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4482 542714f4-19e9-0310-aa3c-eee0fc999fb1
In java, if you override a varargs method you can easily call super, you just
have to do a wee cast:
@Override
public Stuff getStuff (int thing, Object... args)
{
return super.getStuff(thing, (Object[]) args);
}
In abjectscript:
override public function getStuff (thing :int, ... args) :Stuff
{
// This doesn't work, because now 'args' to super is an array
// containing OUR args array as its first element.
return super.getStuff(thing, args);
// We can fix things for super by 'apply'ing the function to
// all the args in one array...
args.unshift(thing);
return super.apply(this, args);
// But it could also be the case that someone is intentionally
// passing an array to this method (many flash library methods take
// varargs but also accept arrays and do this same thing).
if (args.length == 1 && (args[0] is Array)) {
args = (args[0] as Array);
}
return super.getStuff(thing, args); // super must ALSO do the unjimmying
// OR, we could combine the two so that super doesn't have to
// do unjimmying.
}
As a note, there is an 'arguments' object that is secretly placed in every
function call, presumably so that callers can test whether an arg is
the default value because the user didn't pass it in or whether it's
the default because the user happened to pass in the default.
Guess yourself, because that doesn't seem worth adding as a language feature.
Anyway, the 'arguments' is not an array! You can't use it to call super
via 'apply'. It's another associative hash. God bless you actionscript,
you just make so much fucking sense.
So I made a utility method for unfucking vargs.
I bitch a lot, yes, but my bitching takes only a fraction of the time
that was wasted discovering whatever it is I'm bitching about
(this was fun to trace backwards to the source, oh yes), and maybe I
can save others some time as a result.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4477 542714f4-19e9-0310-aa3c-eee0fc999fb1