A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: addChild?

  1. #1
    Senior Member
    Join Date
    Feb 2008
    Posts
    126

    addChild?

    Hi,

    Im trying to addChild to stage inside a container but nothing appears on the stage, what do I need to do, and what do I need to do to the artwork MCs so the AS picks them up?:

    var container1:MovieClip = new MovieClip();

    container1.addChild(artwork1);
    container1.addChild(artwork2);
    container1.addChild(artwork3);

  2. #2
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    First of all, where are the artowork MCs situated at ? If your MCs are in the library then you'll need to do this:

    PHP Code:
    // assuming artwork1 , 2, 3... are the linkage names of your MCs
    var art1:MovieClip = new artwork1()
    var 
    container1:MovieClip = new MovieClip();
    addChild(container1);
    container1.addChild(art1);

    // OR

    var container1:MovieClip = new MovieClip();
    addChild(container1);
    container1.addChild(new artwork1()); 
    By the way, if it wasn't throwing any errors then the source of the problem was container1. You were never adding container1 to the display list with addChild(container1);



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  3. #3
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Everything is added to container1 but you never add container1 to the stage... addChild(container1)

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