dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Changing code to make menu vertically scroll!

  1. #1
    Junior Member
    Join Date
    Oct 2002
    Posts
    12

    Changing code to make menu vertically scroll!

    Hi ok ive downloaded this menu from this site which is free to use and modify etc.
    The problem is that there's a blue box that follows the cursor as it moves over one of the links (buttons) It's goes horzitionally across the screen, but i actually want it to be a vertical menu, so instead of moving across it does the same thing but downwards.

    The code for the box that follows the cursor is;

    onClipEvent (load) {
    col = new Color(this);
    var tx=this._x;
    loc=tx;
    }
    onClipEvent (enterFrame) {
    this._x += (loc-this._x)/4;
    }


    And the code that is an invisible box which i imagine is the parameters of where the box moves and how fast etc etc. That's

    onClipEvent(load){
    mpoint = new object();
    }
    onClipEvent (mouseMove) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    mpoint.x = this._xmouse;
    mpoint.y = this._ymouse;
    localToGlobal(mpoint);
    _parent.dragger.loc=mpoint.x;
    } else {
    }
    }

    Now i'm not good with code and don't have any clue what needs changing to make it go down instead of across.

    Any help would be amazing.
    Thanks a lot
    Dave

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Posts
    12
    Does anyone know!!!!

  3. #3
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    can you post the .fla?

    usually you would just change the _x propery to _y...but the code you posted is confusing as is the description.

    thanks

  4. #4
    Junior Member
    Join Date
    Oct 2002
    Posts
    12

    h

    Hey here is the fla file.
    Thanks a lot
    Dave
    Attached Files Attached Files

  5. #5
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    ok..this must be an MX version (color object wasnt working, throwing an error really)

    anyways.. heres an easier way to achive this:

    have your grey sqaure, convet it to a movieClip...(give it an INSTANCE name of sliderClip_mc) INSIDE this geySquare clip..on frame 1 put this code:

    code:

    this.onEnterFrame = function() {
    this._y+=(this.newY-this._y)/3; //change the '3' to change speed
    }



    now, on the same time line as your "squareClip".have yoru buttons with this code on them:
    code:

    on(rollOver){
    sliderClip_mc.newY = 187;
    }



    you can change this to on(press)..or whatever you want..if you want it to continuously follow the mouse..let me know

  6. #6
    Junior Member
    Join Date
    Oct 2002
    Posts
    12
    Hi i couldn't get it to work.
    I tried lots of different ways of doing it, but the square wouldn't move at all.
    The grey sqaure was already a movie clip. I went to edit and then added that top code into the 1st frame.
    I then went back to the main menu bit and added the other code to the buttons. Also changed the instance name from dragger to sliderClip_mc without any luck!

    Did you want me to delete the code which was already there in first place when i added yours? (which i did)

    Thanks dude.
    Dave

  7. #7
    Junior Member
    Join Date
    Oct 2002
    Posts
    12
    also here is the original code for the button.
    on (rollOver) {
    dragger.col.setRGB(0xDFDFDF);
    }
    on (rollOut) {
    dragger.col.setRGB(0xECECEC);
    }
    on (release) {
    getURL ("http://www.unsignedtalent.co.uk/phpforum/index.php", "_self", "GET");
    }

  8. #8
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    none of THAT button stuff you just poasted last has anything to do with controlling the sliding of the "square"..that stuff just controls the color..

    post the .fla you tried with MY suggestion..and I'll take a look at it.

  9. #9
    Junior Member
    Join Date
    Oct 2002
    Posts
    12
    Hey dude i hope this where you wanted me to put the code?
    I cant get the box to move for some reason. Ive put it everywhere without any luck.

    Thanks for all your help, its much appreciated.
    Dave
    Attached Files Attached Files

  10. #10
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    you put the code in the FIRST frame of the MAIN timeline..and the old code is STILL inside the greySliderClip...

    here...
    Attached Files Attached Files

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