Placing MC's Dynamically onstage
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Placing MC's Dynamically onstage

  1. #1
    Junior Member
    Join Date
    Oct 2012

    Placing MC's Dynamically onstage

    Hey Guys,
    In need of some help.

    Im Trying to place MCs dynamically from the library using buttons that are onstage into a container MC placed on stage at run time using addChild.
    My problem is on the placement of the MovieClips within the container MC after the user has clicked the appropriate button(s).

    What Im looking for is a way that I can register when a mc has been placed within the container mc onstage, so when a new mc is placed in the container it offsets the placement on the y axis.
    Ive have tried using conditional if statements etc but nothing seems to work as it should, especially when there might be 20+ buttons placing 20+ mcs

    So my question is.does anyone know of any tutorials that might help me with a solution.



  2. #2
    Join Date
    Dec 2001
    York, UK
    Hi Russ,

    Something like this might help... Listens for when a clip has been added to the stage...

    var test:MovieClip = new MovieClip();

    function checkForItem(evt:Event):void{
    trace("this had been added");
    test.addEventListener(Event.ADDED_TO_STAGE, checkForItem);


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