A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: AttachMovie General Help

  1. #1

    AttachMovie General Help

    can anyone help me with my dragable windows in flash?

    i have a button with the script

    on (press) {
    _root.attachMovie("homepage","homepage",1);
    _root.homepage._x = 348.9;
    _root.homepage._y = 216.2;
    }

    this works and does what i want it to
    now on the homepage windows which you can drag is a movieclip inside you have another button which allows you to drag that window

    now i did this again with another button/page like bellow

    on (press) {
    _root.attachMovie("staffpage","staffpage",2);
    _root.staffpage._x = 348.9;
    _root.staffpage._y = 216.2;
    }

    this also works but as you see is on a new layer

    now that homepage is on layer 1 and staffpage is on layer 2 i added the script inside the movie clip of

    on (press) {
    _root.homepage.startDrag();
    _root.homepage.getNextHighestDepth();
    }

    to try and bring the back layer forward and to be able to drag it the drag works but cant seem to figure out how to get the depth of the homepage to be on the top off all other pages if you know what i mean if you dont let me know i'll give more info/sample if needed

    can anyone please help?

    Thanks
    Hopies
    The one that smiles when things go wrong, Has thought of someone to blame it on

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    this should do the trick


    on (press) {
    _root.homepage.startDrag();
    _root.homepage.swapDepths(_root.getNextHighestDept h());
    }

    hope it helps
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    thats awesome lol thanks abunch

    My Problem Solved

    thanks again
    The one that smiles when things go wrong, Has thought of someone to blame it on

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    np glad i could help
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    you still there?
    The one that smiles when things go wrong, Has thought of someone to blame it on

  6. #6
    just found out that now

    when i click the button which attachs the movie it now add multiple if i click it multiple time before i added the script of yours it didnt do this may i ask y the _root.getNextHighestDepth keeps adding a new movie clip even tho i am attaching it with the same name
    The one that smiles when things go wrong, Has thought of someone to blame it on

  7. #7
    Help

    read from top to find out more
    The one that smiles when things go wrong, Has thought of someone to blame it on

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