the delegate questions have kinda hijacked the other question i've asked so
i'd like to have a separate discussion here if i can

i've got a method that broadcasts a message to the instancing class but if i
delegate it, it doesn't seem to work

here is my original method with the anonymous function that works correctly:

    private function getXML():Void
    {
        var ref = this;
        xmlDoc.ignoreWhite = true;
        xmlDoc.onLoad = function():Void
        {
            ref.broadcastMessage("ready");
        }
        xmlDoc.load(sPath);
    }


here is what i've tried to do to use the Delegate class instead:

    private function getXML():Void
    {
        xmlDoc.ignoreWhite = true;
        xmlDoc.onLoad = Delegate.create(this, xmlOnLoad);
        xmlDoc.load(sPath);
    }

    private function xmlOnLoad():Void
    {
        trace(this); traces[object, Object] if next line is commented out
        this.broadcastMessage("ready");
    }

i'd love to use this more but it seems there are a lot of hoops to jump
through at the moment

a
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to