A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: trying to trace the name of something

  1. #1
    Member
    Join Date
    Oct 2002
    Location
    England
    Posts
    80

    trying to trace the name of something

    Hello

    I have an empty movieclip that's on the stage. I'm then placing a movieclip inside it, like so:
    PHP Code:
    function addTinySection() {
        var 
    tiny:MovieClip = new tinySection();
        
    completeLoader.addChild(tiny);
        
    tiny.name="tiny"+1;
        
    trace(completeLoader.getChildAt(0).getChildAt(2).name);
    }
    addTinySection(); 
    I can trace the child name of the movieclip "completeLoader", but I can't trace any of the children names of "tiny".

    I've attached the example for you to see.

    Cheers
    Attached Files Attached Files

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    PHP Code:
    trace(completeLoader);
    trace(completeLoader.getChildByName('tiny1')); 
    Please use [php] or [code] tags, and mark your threads resolved 8)

  3. #3
    Member
    Join Date
    Oct 2002
    Location
    England
    Posts
    80
    Thanks for the reply but it's not what I'm looking for. I need to get to the children of "tiny"

    I can trace the name of tiny:
    trace(completeLoader.getChildAt(0).name);

  4. #4
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    That's already a reference to the object - you probably just need to cast it:

    PHP Code:
    trace(DisplayObjectContainer(completeLoader.getChildAt(0)).getChildAt(0).name); 
    Please use [php] or [code] tags, and mark your threads resolved 8)

  5. #5
    Member
    Join Date
    Oct 2002
    Location
    England
    Posts
    80
    Great, thanks neznein9!

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