A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: [disc] debugger

  1. #21
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    sounds cool jonmack. i had a look at bits stuff and the others and they look cool.
    i want to have the absolute minimum embedded code so all you'll have to do is add one line to frame 1 of your movie;
    Code:
    loadMovie("debugger", _level9) // or any level
    that's it. i figure i can store the watched variables and breakpoints in the global object of the movie so you don't have to set them up every time you run the movie.
    i think the handiest thing will be debugging in the browser. i know mm has some sort of debugging in the browser but i can't find the doco and it requires special setup.
    having a completly separate window would be cool but there are some things that will require a really tight integration (like drawing a line between the watched variable and the bounding box of the movie it points to) and again, i don't want ANY other setup than that simple one line.
    once i publish the debugger API you can write a case checker function if you like.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  2. #22
    Untitled-2.fla
    Join Date
    Jul 2002
    Posts
    391
    looks good Blink, you may want to look at the luminicbox debugger, here's the translated version

  3. #23
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    thanks token dude.
    i have a big question now. i'm trying to inject a vector into functions within movie clips so that i can profile the .fla (like a list of functions and events and the total time spent inside them).
    now i can save off a pointer to a function and inject my vector function into the mc no worries. the problem is the vector function doesn't know what function it's profiling. i'm sure this can be solved with some oop weirdness like addding values to that particular instance of the vector function but i don't know how.
    any ideas/help???
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  4. #24
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,356
    now i can save off a pointer to a function and inject my vector function into the mc no worries. the problem is the vector function doesn't know what function it's profiling. i'm sure this can be solved with some oop weirdness like addding values to that particular instance of the vector function but i don't know how.
    If I understand your question, this would be solved by interrogating the call stack in .NET or Java. I'm honestly not sure how you could do it in Flash... If you find a good solution, please let us know. Thanks!

  5. #25
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    ok here's what i did;
    Code:
    var v = eval(p);
    v[i] = function(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9) {
    	var context = { vector: m, name: n, elapsed: 0 };
    	var start = getTimer();
    	context.vector(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
    	context.elapsed += getTimer() - start;
    };
    where;
    p : is a constructed string that is built when traversing the movieclip heirachy so it's gonna look like "_level0.mc.mc". it is the instance name of the movieclip that contains this function. i do it this way so i can compare pointers to mc's against actual mc's to avoid infinite recursion
    i : is the name of the function (returned using the for i in mc command)
    v[i]: this is my replacement function for the function in the mc. i create a NEW function and insert and data i need into the local "context" object.
    m: is the address of the found function
    n: is a string containing the name of the function (for presentation purposes)
    elapsed: is a field for accumulating the elapsed time (for profiling)
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  6. #26
    Senior Member webgeek's Avatar
    Join Date
    Sep 2000
    Posts
    1,356
    I completely missunderstood your question, sorry! It looks like you have a pretty slick solution though.

  7. #27
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    see bellow
    Last edited by BlinkOk; 07-18-2005 at 08:28 AM.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  8. #28
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    ok it wasn't overwriting. i'm stoopid.
    i did manage to get it to work but i think the overhead might be a little too much so i'm askin for suggestions. the basic code looks like this;
    PHP Code:
    // v is the mc we are searching for functions
    v.traps = {}; // create an object that will contain pointers to the origional function
    for (i in v) { 
    // if it's not a function, ignore it
     
    if (typeof(v[i]) != "function")
      continue;
     
    v.traps[i] = v[i]; // save a pointer to the origional function in the traps object
     // install the new vector or wrapper function
     
    v[i] = function(p0p1p2p3p4p5p6p7p8p9) {
       var 
    i;
       
    // search the containing mc for the name of this function
       
    for (i in this) {
        
    // use the traps object to call the origional function
        
    if (this[i] == arguments.callee
         
    this.traps[i](p0p1p2p3p4p5p6p7p8p9);
       }
      };

    if anyone has any ideas on how to remove the search (within the installed vsctor function) or any thing else for that matter. i would really appreciate it.
    if anyone wants to muck around with it i can post the fla's
    thanks
    blink
    Last edited by BlinkOk; 07-18-2005 at 07:45 AM.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center