A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Actions on duplicated mc's?

  1. #1
    Junior Member
    Join Date
    Dec 2002
    Location
    _root.home.room.chair
    Posts
    23

    Actions on duplicated mc's?

    Hi.

    I've been trying but i can't seem to figure out how to attach actions to a movie clip that is created using duplicateMovieClip as there is no clip on the stage to add actions to. Can anybody help?


    Thanks a lot


  2. #2
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    place the actions inside the movieclip itself then. Are you duplicateing a mc from the library? if so just do that.

  3. #3
    Junior Member
    Join Date
    Dec 2002
    Location
    _root.home.room.chair
    Posts
    23
    If i put the actions in the mc that i want to duplicate, will the new mc's that are created do the same as the one it was made from?

    Thanks


  4. #4
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Should do Because it duplicates an exact replica Therefore any code and graphics inside the mc are duplicated too. But be carful with you code inside the duplicated mc. You cant use _x it has to be _root.moviename._x or _paerent and many other ways. Relative paths.

  5. #5
    Lunatic Baukereg's Avatar
    Join Date
    Nov 2000
    Location
    Lowlands
    Posts
    853
    I've never worked with parent. I always uses:

    name = _name;
    _root[name]._x += 5;

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Location
    San Diego, CA
    Posts
    669
    yeah, _parent is the quick way to address the outermost timeline of wich the code is stored inside an MC. As well, make sure that your code inside the dup. clips isnt too intensive... youll notice when you start dup. many w/ that code it will slow down.

    Good Luck,

    -Tyler

  7. #7
    Junior Member
    Join Date
    Dec 2002
    Location
    _root.home.room.chair
    Posts
    23
    Thanks everybody. I got it working!


  8. #8
    Junior Member
    Join Date
    May 2002
    Posts
    0
    Originally posted by hooligan2001
    But be carful with you code inside the duplicated mc. You cant use _x it has to be _root.moviename._x or _paerent and many other ways. Relative paths.
    wait... you cant?
    so if the actions are inside the duplicated mc on a frame you cant use _x, can you use this._x. that might be why my game is screwing up.

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Originally posted by jtnw
    wait... you cant?
    so if the actions are inside the duplicated mc on a frame you cant use _x, can you use this._x. that might be why my game is screwing up.
    I think you can.
    As far as I know there is no difference in using _x or this._x.

    Not very sure what hooligan meant.

  10. #10
    Junior Member
    Join Date
    Jan 2003
    Posts
    29
    Usually I dont code on frames. Id much rather have it on a mc in the enterFrame. So what people tend to do is have a mc inside of they're normal one. Ill use this analogy

    Ive got kirby character. And inside of him I create a blank mc called brain. On the brain's enterFrame I have all my movement code for kirby. Well when I press Left, I dont want the brain's _x to move to the left. I want the whole thing to move. So in the brain mc instead of _x-=10 I can do _parent._x-=10.

    Hopefully this explains it =D

    Nugget
    xMCNUGGETx

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