A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Swap depth makes my movie clip/button go to the next scene

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    3

    Swap depth makes my movie clip/button go to the next scene

    I have a button inside a movie clip which makes the picture movable as well as comes to the top, but when I change scenes the last picture dragged goes to the next scene. How do I make it a drag able and comes to the top. This is my code:
    on (press) {
    startDrag(_root.gage);
    }
    on (release) {
    stopDrag();
    }
    on (press) {
    _root.gage.swapDepths(1);
    }
    Please help!!!

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    In the script where you gotoAndStop the next scene, add this:

    _root.gage.stopDrag();
    _root.gage.removeMovieClip();
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #3
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Its still staying with the scene. and its turning red too

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    As you haven't provided an *.fla, i made an example from scratch and its working here. I press the button , the movieclip is being dragged, then i press spacebar to go to the other scene, and then the movieclip stop dragging and gets removed.

    So, you have to post your *.fla to see what's wrong overthere.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  5. #5
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Im trying to upload it. The transition between scenes is due to buttons. When it gets to the scene its gotoandplay so the scene will start.

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