A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] [F8] Determine Number of MC in a MC

  1. #1
    Army Web Designer
    Join Date
    Jun 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    140

    [RESOLVED] [F8] Determine Number of MC in a MC

    Is it possible to determine the mount of MC objects that are nested in another MC?
    Jason Beaudoin
    Web Designer
    Canadian Army

  2. #2
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    function countChildClips(tarMc:MovieCliip){
    var numOfChildren:Number = 0;
    for (var mc in tarMc){
    if (typeOf(mc) == "movieclip"){
    numOfChildren++
    }
    }
    return numOfChildren;
    }
    //call it as such
    trace(countChildClips(targetClipInstanceName))

    Check my syntax, but that is the general idea.
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  3. #3
    Army Web Designer
    Join Date
    Jun 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    140
    Thank you very much!!
    Jason Beaudoin
    Web Designer
    Canadian Army

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