A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Drag and Scale?

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    19

    Drag and Scale?

    I'm trying to create a box that the user can drag around and as it moves to the left of the screen, it scales down.

    onClipEvent (mouseDown) {
    if (this.hitTest(_root._xMouse, _root._yMouse)) {
    this.startDrag();
    }
    }
    onClipEvent (mouseUp) {
    stopDrag();
    }

    But I'm not quite sure how to get it to scale down proportionatly.

  2. #2
    Senior Member
    Join Date
    Mar 2003
    Location
    127.0.0.1
    Posts
    154
    before i say anything, i would just like to comment on your name: very nice screen name =)

    ok - it would be easier to do this much easier than you have already tried. just stick this code in the first frame of the movie

    Code:
    var stageHeight = 500;
    var stageWidth = 500;
    //fill in the above numbers with correct ones
    window.onPress = function(){
        this.startDrag();
    }
    window.onRelease = function(){
        stopDrag();
    }
    window.onEnterFrame = function(){
        this._xscale=this._x/stageWidth*100;
        this._yscale=this._y/stageHeight*100;
    }
    draggin the window to the top left corner will make it go to 0% of orig size now.

    hope this works out with your plan
    -enjoy
    -Steve

  3. #3
    Junior Member
    Join Date
    May 2002
    Posts
    19
    That did the trick! Thanks!!

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