Here's some code from Main that should give you an idea of how to do it.  You instantiate the profiler object on the timeline of your movie, and then do some hacking to do the communication from the Main object.  It's not pretty, but it works.  I meant to write a tutorial about this, but haven't had the time.  And maybe it would be time better spent to update ASProf to AS 2.0...

class Main{
    private var profiler: Object;
    public var myApplication: Application;
    ...

    public function Main(tgtParam: MovieClip){
        profiler = tgtParam.profiler; //profiler is defined in master swf
        tgtParam.main = this; //put pointer to this on _root
    }
   
    public function startApplication(){
        myApplication = new Application();
        profiler.profile("_root.main.myApplication.someMethodToProfile");
        profiler.profile("_root.main.myApplication.someOtherMethodToProfile");
        profiler.begin("profile");
    }

   public function endApplicaiton(){
        profiler.end();
        trace(profiler.getFlatGraph());
   }

On 5/23/06, Chris Bare <[EMAIL PROTECTED]> wrote:
> I've been using ASProf with MTASC and AS2 Projects.  It seems to work okay.
>
> If you're using the code code injection technique, just include ASProf in
> your master FLA, and then pass a reference to it to your main class.
>
> -Adam

I just started looking at ASProf, so I'm not sure I'm following. Are you
saying to pass ASProf as a parameter to your main class when you instantiate
your main class?
Then how do you register the objects to profile? I tried several different
syntaxes, but couldn't get it to profile my objects.
--
Chris Bare
[EMAIL PROTECTED]

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to