A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: making embeded movies' x and y positions = another embeded movies' x and y positions?

  1. #1
    Member
    Join Date
    Aug 2000
    Posts
    57
    ok.. here is my problem..

    I have an embeded movie clip here: _root.invhid

    and another here: _root.chars.inv.scroll.invone - with a button inside that has the following script:


    ================================================== ===

    on (press) {

    startDrag ("_root.invhid");

    tellTarget ("_root.invhid") {
    gotoAndStop (2);
    }



    _root.invhid._x = _root.chars.inv.scroll.invone._x;
    _root.invhid._x = _root.chars.inv.scroll.invone._x;


    }

    ================================================== ===


    "_root.chars.inv.scroll" is a dynamic scrolling movie clip that scrolls up and down, so "_root.chars.inv.scroll.invone" is always going to be located in a different place.. what I am trying to do is make the _root.invhid x and y positions exactly that of _root.chars.inv.scroll.invone so they both display in the same place on the screen...


    Another way I can solve my problem is with the duplicateMovie feature, however, I would need to duplicate _root.chars.inv.scroll.invone to something like this: _root.invonedup and make sure that the duplicate is on top of every other layer...


    my script does not seem to be working at all, as _root.invhid is always starting at the original x and y of itself..


    If anyone can possible help me with this problem I will be eternally greatful..

    thanks..

  2. #2
    Master Poo Flinger
    Join Date
    Sep 2000
    Posts
    318
    your problem is, the on(press) even only works when the button is press, but it has to work when the mouse is moving. select the symbol "inv" on the stage, goto your actions panel and type:

    Code:
      onClipEvent(mouseMove){
        _x = _parent.invhid._x
        _y = _parent.invhid._y
        updateAfterEvent()
      }
    i'm not sure this answers the exact question you had, but this should help you answer it for yourself.

    hope i helped

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Hi Sintwar,
    Not sure i understand it all (without seeing anything)
    maybe you should post a swf or a small fla..
    gparis

  4. #4
    Member
    Join Date
    Aug 2000
    Posts
    57
    whew heh heh

    well guys, thanks for the help, but I realized my stupidity.. I simply solved my problem by adding this to the current loaded frame in "_root.invhid":

    _root.invhid._x = _root._xmouse
    _root.invhid._y = _root._ymouse


    I am making a drag and drop interface for a game, where it will allow you to drag items in and out of your inventory..

    unfortunately, the scrolling effect was making it impossible for me to make it work the way I needed.. So I just needed a way to make it seem like you are actually dragging an item from your inventory from the spot that you drag it from..

    an identical item on the root is the only way I can see to make it so the items don't slide under other items..

    z sorting was just totally not working for this problem..

    oh well.. problem solved anyway...

    thanks for the help though..

    damn I talk too much.. :P

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