Professional Web Applications Themes

changing a sprites blend in a rollover - Macromedia Director Lingo

I am making rollover button that changes the sprites blend level when the mouse enters. I have about 6 buttons I want to aplly this to and I am wondering if there is anway to change the sprite blend without having to declare which speciifc sprite number it should happen on. I tried to do : on mouseUp me sprite(me).blend = 100 end but director gives an error over the (me) part, + wants me to type in the specific number sprite. but if I have to type in the sprite number I will have to create 6 seperate behaviours ...

  1. #1

    Default changing a sprites blend in a rollover

    I am making rollover button that changes the sprites blend level when the mouse enters.

    I have about 6 buttons I want to aplly this to and I am wondering if there is anway to change the sprite blend without having to declare which speciifc sprite number it should happen on.

    I tried to do :

    on mouseUp me

    sprite(me).blend = 100
    end

    but director gives an error over the (me) part, + wants me to type in the specific number sprite. but if I have to type in the sprite number I will have to create 6 seperate behaviours for each rollover.

    Does anyone have any ideas?

    thank you very much

    fiona xx



    kiaoraFiona webforumsuser@macromedia.com Guest

  2. #2

    Default Re: changing a sprites blend in a rollover

    sprite (me.spriteNum).blend = 100

    look at the me parameter as you (yourself) and if you wanted to set any
    property of your own you might use

    change the eye color of me to blue.

    That would be the old verbose Lingo. Now you would use

    me.eyeColor = blue

    So since spriteNum is a property of a sprite just like eyecolor is a
    property of you you need to specify the spriteNum



    --
    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]
    "kiaoraFiona" <webforumsusermacromedia.com> wrote in message
    news:bj9s72$cj3$1forums.macromedia.com...
    > I am making rollover button that changes the sprites blend level when the
    mouse enters.
    >
    > I have about 6 buttons I want to aplly this to and I am wondering if there
    is anway to change the sprite blend without having to declare which speciifc
    sprite number it should happen on.
    >
    > I tried to do :
    >
    > on mouseUp me
    >
    > sprite(me).blend = 100
    > end
    >
    > but director gives an error over the (me) part, + wants me to type in the
    specific number sprite. but if I have to type in the sprite number I will
    have to create 6 seperate behaviours for each rollover.
    >
    > Does anyone have any ideas?
    >
    > thank you very much
    >
    > fiona xx
    >
    >

    Word of Mouth Productions Guest

  3. #3

    Default Re:changing a sprites blend in a rollover

    Looks like you're missing the spriteNum property:

    on mouseUp me
    sprite(me.spriteNum).blend = 100
    end

    That should work.



    srsidman webforumsuser@macromedia.com Guest

  4. #4

    Default Re:changing a sprites blend in a rollover

    Hi Fiona

    Below is a generic script which allows you to use this same script on as many sprite as you like.
    This script will automatically select the sprite number of the sprite your are applying the behaviour to.
    If you create a new behaviour paste the following script, apply it then to your sprite.

    Property pSprite
    Property pOriginal
    Property pMouseOver
    Property pMouseDown

    on beginSprite me
    pOriginal = sprite(pSprite).member.name
    end


    on mouseEnter me
    sprite(pSprite).blend = member pMouseOver
    end

    on mouseLeave me
    sprite(pSprite).blend = 100
    end

    on mouseUpOutside me
    sprite(pSprite).blend = 100
    end

    on mouseDown me
    sprite(pSprite).blend = member pMouseDown
    end

    on mouseUp me
    sprite(pSprite).blend = 100
    end


    on getPropertyDescriptionList
    memdefault = member(the CurrentSpriteNum)
    propertylist = [\
    #pSprite: [#comment: "Sprite number", #format: #integer, #default: the CurrentSpriteNum],\
    #pMouseover: [#comment: "Mouse over blend", #format: #integer, #default: memdefault],\
    #pMouseDown: [#comment: "Mouse down blend", #format: #integer, #default: memdefault]\
    ]
    return propertylist
    end




    Good look
    Dave
    [url]http://www.davidatkinson.com[/url]



    frasier13 webforumsuser@macromedia.com Guest

  5. #5

    Default Re:changing a sprites blend in a rollover

    thankyou for your help.. it means I dont have to write the behaviour over and over for different sprites.

    I hadnt come across the spriteNum property before , cant imagine how I hadn't but a big thank you for bringing it to my attention
    it seems so simple when you know how!!

    fiona





    kiaoraFiona webforumsuser@macromedia.com Guest

Similar Threads

  1. Changing Text/iframe content with Rollover
    By Andigo in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: February 1st, 11:01 PM
  2. Blend question.
    By NCM_Mike in forum Macromedia Director Basics
    Replies: 1
    Last Post: April 3rd, 10:14 AM
  3. Cursor Rollover With Some Sprites But Not Others
    By MGreen in forum Macromedia Director Lingo
    Replies: 0
    Last Post: September 29th, 04:27 PM
  4. Rollover Help - On a map - changing colors to highlight selection
    By RoyalFunk webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: August 7th, 07:05 PM
  5. Rollover and making another rollover with links
    By 360liquid webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 26th, 12:26 AM

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