A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: stop it

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    indianapolis
    Posts
    144

    stop it

    i have a MC and am using startdrag on it so it will move with the mouse, how can i stop it from part of the MC going off of the screen stage? i tried playing with teh bounding box constraints but that didnt work and just makes the MC flicker when i move...

    thanks!

  2. #2
    foo to you foo2's Avatar
    Join Date
    Nov 2006
    Location
    Germany,Europe
    Posts
    180
    Hmm.., that is not easy you can use boundaries but it doesn’t really work with fast moves (FPS). The ‘onEnterFrame’ doesn’t work out of stage. You have to shrink the boundaries.
    PHP Code:
    this.onEnterFrame = function() {
        if (
    _root.mc._x<|| _root.mc._x>Stage.width || _root.mc._y<|| _root.mc._y>Stage.height) {
            
    _root.mc.stopDrag();
        }
    }; 
    Last edited by foo2; 12-06-2006 at 09:31 AM.
    Sorry for my bad english. Feel free to correct my mistakes

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