A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Scrolling the "Floor Plan" in each direction

  1. #1
    vidiveni
    Join Date
    Dec 2000
    Posts
    77

    Scrolling the "Floor Plan" in each direction

    I need someone to give me some pointers on how to scroll around the attached movie. It you take a look at the floor plan , this is going to be much bigger and I want the user to be able to move the mouse point up and the plan move down and so on.
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Sep 2004
    Posts
    29
    check out http://members.lycos.co.uk/yuekai/pictures.html

    Make your floor plan image a movie clip. use AS to modify the x and y position of the mc according to the position of the mouse. us if statements so that the mc doesnt scroll off the screen.

    heres the AS of the swf @ the above url
    code:
    stop();
    _root.onEnterFrame = function() {
    photosMC._y = photosMC._y+(0.5 * Stage.height - _ymouse)/10;
    if (photosMC._y < -454 ) {
    photosMC._y = -454;
    }
    if (photosMC._y > 18) {
    photosMC._y = 18;
    }
    photosMC._x = photosMC._x+(0.5 * Stage.width - _xmouse)/10;
    if (photosMC._x < -680 ) {
    photosMC._x = -680;
    }
    if (photosMC._x > 18) {
    photosMC._x = 18;
    }
    }

    Last edited by squarehead88; 09-17-2004 at 11:45 PM.

  3. #3
    vidiveni
    Join Date
    Dec 2000
    Posts
    77

    Thanks

    Thankyou very much , I will try this and let you know how I get on.

    Kind Regards

    Martin.

  4. #4
    vidiveni
    Join Date
    Dec 2000
    Posts
    77

    More help if possible

    Go it working but can't seem to stop in scrolling at the correct point (I.E. at the edges of the movie clip) The dimension of the clip are. W. 1530 H 891.6 X. 409.6 Y. 290.9

    stop();
    _root.onEnterFrame = function() {
    floorPlan_mc._y = floorPlan_mc._y+(0.5*Stage.height-_ymouse)/10;
    if (floorPlan_mc._y<-365) {
    floorPlan_mc._y = -365;
    }
    if (floorPlan_mc._y>365) {
    floorPlan_mc._y = 365;
    }
    floorPlan_mc._x = floorPlan_mc._x+(0.5*Stage.width-_xmouse)/10;
    if (floorPlan_mc._x<-1168) {
    floorPlan_mc._x = -1168;
    }
    if (floorPlan_mc._x>1168) {
    floorPlan_mc._x = 1168;
    }
    };

    So what values do I put in the above for the _y and _x ? I can't work it out !

  5. #5
    vidiveni
    Join Date
    Dec 2000
    Posts
    77

    Feel really stupid

    Still can work out what values to put for _x and _y and in the below
    line why do you multiply by 0.5 and devide by 10 ?

    floorPlan_mc._x = floorPlan_mc._x+(0.5*Stage.width-_xmouse)/10;

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