Here is what I'm using...

   // find root movieclip
   public function getRoot(mc) {
       var rootReference:MovieClip;
       rootReference = mc;
       trace("getting root = " + rootReference);
// find root
       while (rootReference._parent !=undefined)    {
           rootReference = rootReference._parent;
           trace("getting root = " + rootReference)
       }
// return reference to root movieclip
       return rootReference;
   }


Ryan Matsikas wrote:

I would guess your getRoot() function is returning the incorrect root and
trying to attach and then failing.

What's the method look like?

On 2/25/06, judah <[EMAIL PROTECTED]> wrote:
I have two swfs. The first swf loads in the second swf. The second swf
uses a function that *finds* the real _root and then uses attachMovie to
attach a movieclip to it. The second swf works by itself but it does
*not* work when loaded into another swf. Specifically, if I use:

var root_mc:MovieClip = getRoot(this);
var d_mc = root_mc.attachMovie("dndNodeDragger", "d_mc",
DepthManager.kTop++);
trace("d_mc="+d_mc)

I get a reference when it is not loaded into another swf. I could really
use some insight on this.

Judah

--
"Always bear in mind that your own resolution to succeed is more important
than any one thing."

"You can have anything you want - if you want it badly enough. You can be
anything you want to be, do anything you set out to accomplish if you hold
to that desire with singleness of purpose."

- Abraham Lincoln

_______________________________________________
[email protected]
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

_______________________________________________
[email protected]
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



--
"Always bear in mind that your own resolution to succeed is more important than any 
one thing."

"You can have anything you want - if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose."
- Abraham Lincoln

_______________________________________________
[email protected]
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