Professional Web Applications Themes

Sliding menu - Macromedia Director Basics

Hi I have 5 copies of one cast member (box) on the stage. I would like to boxes to slide up when mouse is over it ( one box moves at the time when mouseuover, not all in once ) and when mouse leaves, box should slide back to its main position. At the begining my boxes coordinates (x,y) are Box-1) 193 , 357 Box-2) 324 , 357 Box-3) 455 , 357 Box-4) 586 , 357 Box-5) 717 , 357 and every boxes´ new position is so that x is same as on the main position and y is 267. ...

  1. #1

    Default Sliding menu

    Hi

    I have 5 copies of one cast member (box) on the stage.
    I would like to boxes to slide up when mouse is over it ( one box moves at the time when mouseuover, not all in once ) and when mouse leaves, box should slide back to its main position.

    At the begining my boxes coordinates (x,y) are
    Box-1) 193 , 357
    Box-2) 324 , 357
    Box-3) 455 , 357
    Box-4) 586 , 357
    Box-5) 717 , 357

    and every boxes´ new position is so that x is same as on the main position and y is 267.

    Could someone give me specific brief what kind of Lingo-script shoud I use to get this thing work, and where should I write it (to boxes, movie scrip or both...)

    I saw slideright menu and trie to figure out the function of the script but failed.



    Thank you



    Musteri webforumsuser@macromedia.com Guest

  2. #2

    Default Re: Sliding menu

    Two days ago you asked the exact same question under the title "Sliding
    Objects". What part of the answer did you have difficulty with?

    --
    Rob
    _______
    Rob Dillon
    Team Macromedia
    [url]http://www.ddg-designs.com[/url]
    412-243-9119

    [url]http://www.macromedia.com/software/trial/[/url]
    Rob Dillon Guest

  3. #3

    Default Re: Sliding menu

    I think what you're looking for is this:

    property pMyStart

    on beginSprite me
    pMyStart = sprite(me.spriteNum).locH
    end

    on exitFrame me
    if rollOver(me.spriteNum) then
    sprite(me.spriteNum).locH = sprite(me.spriteNum).locH + 5
    else if sprite(me.spriteNum).locH <> pMyStart then
    sprite(me.spriteNum).locH = sprite(me.spriteNum).locH - 5
    end if
    end

    Attach this script to all the boxes. At the beginning of each sprite (beginSprite) they record their start positions into a property variable (pMyStart). Then on each exitFrame they check to see if the mouse is rolloed over themselves (rollover(me.spriteNum). If it is, it moves 5 pixels to the right, but if not, and the sprites locaton isn't = to it's start location (pMyStart), then it moves itself back 5 pixels.

    Hope that was what you were looking for.



    srsidman webforumsuser@macromedia.com Guest

  4. #4

    Default Re: Sliding menu

    I did not get any answer for that question

    -M-



    Musteri webforumsuser@macromedia.com Guest

  5. #5

    Default Re: Sliding menu

    Well, here's a copy:

    By slide up and down, I'm guessing that you want the animation to
    happen in steps and not as one single jump from one location to the
    other. If that's the case then you could use a simple rubber band type
    animation:

    ----------
    property thisSprite
    property startingLocV
    property endingLocV
    property totalSteps
    property eachStep
    property animateMe
    property customCursor

    onGetPropertyDescriptionList
    myPropList = [#endingLocV:[#comment:"enter the ending location for
    this sprite:",#format:#integer,#default:267],
    #totalSteps:[#comment:"set the number of steps for this
    animation:",#format:#integer,#range:[#min:1,#max:20],#default:5],#custom
    Cursor:[#comment:"pick a cursor:",#format:#cursor,#default:280] ]
    return myPropList
    end

    on beginSprite me
    thisSprite = me.spriteNum
    sprite(thisSprite).cursor = customCursor
    startingLocV = sprite(thisSprite).locV
    eachStep = integer((startingLocV - endingLocV)/ float(totalSteps))
    animateMe = 0
    end

    on endSprite me
    sprite(thisSprite).cursor = 0
    end

    on mouseEnter me
    animateMe = 1
    end

    on mouseLeave me
    animateMe = 0
    end

    on prepareFrame me
    if animateMe then
    if sprite(thisSprite).locV > endingLocV then
    sprite(thisSprite).locV = sprite(thisSprite).locV - eachStep
    end if
    else
    if sprite(thisSprite).locV > startingLocV then
    sprite(thisSprite).locV = sprite(thisSprite).locV + eachStep
    end if
    end if
    end
    ----------

    adapt as necessary

    --
    Rob
    _______
    Rob Dillon
    Team Macromedia
    [url]http://www.ddg-designs.com[/url]
    412-243-9119

    [url]http://www.macromedia.com/software/trial/[/url]
    Rob Dillon Guest

  6. #6

    Default Re: Sliding menu

    Thank you Rob!

    -M-



    Musteri webforumsuser@macromedia.com Guest

Similar Threads

  1. AS movement, sliding menu
    By Carixpig in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 15th, 03:23 AM
  2. making a sliding menu with graphics
    By Coolsnille in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: February 11th, 09:20 PM
  3. making a sliding menu with graphics
    By nokiagal in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: February 11th, 09:11 PM
  4. Help with sliding menu - please
    By ROKKSTAR in forum Macromedia Flash
    Replies: 2
    Last Post: December 14th, 12:18 AM
  5. Semi-Transparent Sliding Menu?
    By fourthtower in forum Macromedia Flash Sitedesign
    Replies: 3
    Last Post: November 27th, 08:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139