mmm still don't get the delegate concept....

On 2/15/07, Muzak <[EMAIL PROTECTED]> wrote:

Look into the Delegate class --> mx.utils.Delegate


import mx.utils.Delegate;

class YourClass {
   private var __rawHTML:String;

   public function grabHTML():Void {
       var html_data:LoadVars = new LoadVars();
       html_data.onData = Delegate.create(this, this.htmlDataHandler);
       html_data.load("http://somesite.ca/some.html";);
   }

   private function htmlDataHandler(rawData:String):Void {
       this.__rawHTML = rawData;
       this.doSomething();
   }

   private function doSomething():Void {
       // do something with __rawHTML
   }
}

regards,
Muzak

----- Original Message -----
From: "Andrew Murphy" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, February 15, 2007 2:48 AM
Subject: [Flashcoders] Problem with cascading functions within a class


Im programming a class which includes something like following methods:


// grab some .html

public function grabHTML():Void {

           // loads the .html

           var html_data:LoadVars = new LoadVars();

           // once the .html is loaded

           html_data.onData = function():Void {

                       // run doSomething()

                       doSomething();

           };

           html_data.load("http://somesite.ca/some.html";);

};

// does something after the .html has been loaded

public function doSomething():Void {

           trace("doing something");

};











Unfortunately the second function doSomething never happens.  Can anyone
clue me in as to what Im doing wrong..?



Thank you. :)



-[a]-




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.39/686 - Release Date:
14/02/2007
7:54 AM

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Omar Fouad - Digital Emotions...
-
Love is always patient and kind. It is never jealous. Love is never boastful
nor conceited It is never rude or selfish. It does not take offense and is
not resentful. Love takes no pleasure in other people's sins...but delights
in the truth. It is always ready to excuse, to trust, to hope... and to
endure... whatever comes.
----------------------------------------

لحب صبور دائماً وهو أبداً ليس غيور
الحبّ أَبَداً ليست متبجّح ولا مغرور
وهو أَبَداً ليس وقح أَو أناني
ولا يعاتب
ولايستاء
لحبُّ لا يسعد
بذنوبِ الناسِ الآخرينِ
لكن المسرّاتَ في الحقيقةِ
هو جاهز دائماً للإعْذار،
للإتِمان، للتَمنّي
وللتَحَمُّل
مَهْما يحدث
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to