views:

627

answers:

2

I have a swf that I need to attach the flex builder debugger to. I have full access to the source code, and can make a debug build of this swf.

However, this swf is being loaded by a non-debug build of another swf which I don't have source code to, and can't make a debug build with.

Is this possible?

I've tried mocking this up with two very simple swfs, and while it works fine when both are debug builds, when the outer swf is a non-debug build, while I can get the debugger to connect, I don't get trace messages, breakpoints don't work, and it seems to lock up the flash app.

Any thoughts? Is there something obvious I'm missing?

+1  A: 

Interesting, what happens if you compile an almost empty SWF that just loads in the non-debug SWF (that loads the debug enabled one) ? i.e DEBUG > NON-DEBUG > DEBUG ... does the non-debug level cancel debug messages for its 'children' ?

I reckon what you want is to use flex debugger for stack traces etc. but it's good to use a custom logger within your SWF, this is specially handy if you want somebody remote debug a version on-line etc. There's a few to google but the latest from the top of my mind is ThunderBold.

Theo.T
This is an interesting thought, at least from the perspective of figuring out why it's not working. Not sure how much easier that will make my actual debugging problem if it does work though:) I mostly want to use breakpoints - I already have remote logging, but it's tedious to debug that way.
Scotty Allen
+1  A: 

Further to Theo's idea, you will probably need to reference the classes in the debugging container. Then, as long as you load the non-debug swf into the same (or a child) application domain (AND the non-debug swf does the same) then you will be able to break into the inner-debug swf.

You can reference classes like so (it's a smell, but even Flex does it internally):

import com.pkg.ClassToDebug; ClassToDebug;
import com.pkg.AnotherClassToDebug; AnotherClassToDebug;
// ... etc

package com.what.ever
{
    public class ApplicationClassInDebugContainer
    {
    }
}
Richard Szalay