A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Heiarchies?

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    2

    Heiarchies?

    How does it work?

    If I create a character and a background, how can I merge them together?
    The reason for it is so that all the finished animation and background is separate from any pans on the stage.

  2. #2
    Flash Game Developer mesmerize's Avatar
    Join Date
    Dec 2005
    Location
    United Kingdom, near Leicester.
    Posts
    485
    Whilst your question is vague, what you would do is hold them both in a container movieclip.

    Code:
    var container:MovieClip = new MovieClip();
    container.addChild(finishedAnimation);
    container.addChild(background);
    addChild(container);
    This would require you to have previously defined finishedAnimation / background. If you had not done, you would remove them from your stage and in your library tick "export for actionscript", give them a name and then:

    Code:
    var finishedAnimation:yourAnimName = new yourAnimName();
    var background:yourBackgroundName = new yourBackgroundName();
    Leaving you with:

    Code:
    var container:MovieClip = new MovieClip();
    var finishedAnimation:yourAnimName = new yourAnimName();
    var background:yourBackgroundName = new yourBackgroundName();
    
    container.addChild(finishedAnimation);
    container.addChild(background);
    
    addChild(container);

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