mouseEnter / mouseLeave sprite error

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default mouseEnter / mouseLeave sprite error

    I get the error "This shockwave movie has errors that have causes playback problems" when I repeated pass the mouse over a text sprite with a hilite behavior. I have tried the movie without audio and the problem persists. The hilite works fine for a while then fails as the mouse repeatedly passes over the sprites. It happens even when the mouse is moved slowly or even paused between passes.

    [url]http://www.unisource.dns2go.com/sunmaid/default.htm[/url]

    Behavior script:

    on mouseEnter me
    tMember = sprite(me.spritenum).member
    sprite(me.spritenum).blendlevel = 255
    tMember.forecolor = 4
    palette
    end

    on mouseLeave me
    tMember = sprite(me.spritenum).member
    sprite(me.spritenum).blendlevel = 127
    tMember.forecolor = 0
    end





    Referring URLs
    [url]http://www.unisource.dns2go.com/sunmaid/default.htm[/url]




    geneonlbk webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. mouseLeave question
      I want to have it so the mouseLeave handler only takes effect on a sprite when leaving from only one direction(from the right, left, top, bottom). ...
    2. Child Scripts not responding to MouseEnter or MouseLeave
      Hi, I am having a problem where my child scripts are not responding to MouseEnter or MouseLeave events, any help would be great. Thanks
    3. On mouseEnter, bring my sprite to the front - help!
      Hello I have some mouseovers that all sit on top of each other. I need to be able mouseEnter one of them and bring it to the front (so that it...
    4. Moving Randomly Moving Sprite To New Location on mouseEnter
      Hi All, This is way over my head. I am currently using Director 8. I have a randomly moving sprite(call it X) on stage (I accomplished this...
    5. Change sprite color on MouseEnter
      Hi, I have this script which changes color of sprite and type of cursor when the mouse is at the sprite. It works pretty ok but I am a beginner so...
  3. #2

    Default Re: mouseEnter / mouseLeave sprite error

    Don´t use blendlevel

    1. Use blend

    2. Make sure that the tMember is a correct member type for the forecolor
    function

    3. Try not using the me.spriteNum... . instead place a on beginSprite
    handler and declare a property called pSprite = me.spriteNum

    Then use pSprite as the sprite number wherever else required.

    Arturo


    "geneonlbk" <webforumsuser@macromedia.com> escribió en el mensaje
    news:bqks62$abm$1@forums.macromedia.com...
    > I get the error "This shockwave movie has errors that have causes playback
    problems" when I repeated pass the mouse over a text sprite with a hilite
    behavior. I have tried the movie without audio and the problem persists. The
    hilite works fine for a while then fails as the mouse repeatedly passes over
    the sprites. It happens even when the mouse is moved slowly or even paused
    between passes.
    >
    > [url]http://www.unisource.dns2go.com/sunmaid/default.htm[/url]
    >
    > Behavior script:
    >
    > on mouseEnter me
    > tMember = sprite(me.spritenum).member
    > sprite(me.spritenum).blendlevel = 255
    > tMember.forecolor = 4
    > palette
    > end
    >
    > on mouseLeave me
    > tMember = sprite(me.spritenum).member
    > sprite(me.spritenum).blendlevel = 127
    > tMember.forecolor = 0
    > end
    >
    >
    >
    >
    > Referring URLs
    > [url]http://www.unisource.dns2go.com/sunmaid/default.htm[/url]
    >
    >
    >
    >

    Arturo Toledo Guest

  4. #3

    Default Re:mouseEnter / mouseLeave sprite error

    Thanks Artura -

    corrected code to hilite a text sprite:

    property spriteNum
    property tMember
    property pSprite

    on beginSprite me
    pSprite = me.spriteNum
    end
    on mouseEnter me
    tMember = sprite(pSprite).member
    sprite(pSprite).blend = 100
    tMember.forecolor = 4
    end

    on mouseLeave me
    tMember = sprite(pSprite).member
    sprite(pSprite).blend = 50
    tMember.forecolor = 0
    endText


    geneonlbk webforumsuser@macromedia.com Guest

  5. #4

    Default Re: mouseEnter / mouseLeave sprite error

    > Don´t use blendlevel
    >
    > 1. Use blend
    Your reason being what? Mine would be that blend is faster than blendLevel, but
    you may have a different reason.
    > 3. Try not using the me.spriteNum... . instead place a on beginSprite
    > handler and declare a property called pSprite = me.spriteNum
    >
    > Then use pSprite as the sprite number wherever else required.
    Or just declare spriteNum as a property and use that, because that automatically
    makes it available and avoids storing exactly the same information twice:

    property spriteNum

    on beginSprite
    put "I'm sprite " & spriteNum
    end beginSprite

    Also, I tend to assign the sprite reference to a property like this:

    property spriteNum, self

    on beginSprite
    self=sprite(spriteNum)
    end beginSprite

    And similarly for storing a direct reference to the sprite's member.
    So geneonblk's code would look like this:-

    property spriteNum, self, pMember

    on beginSprite
    self=sprite(spriteNum)
    pMember=self.member
    end beginSprite

    on mouseEnter
    self.blend = 100
    pMember.forecolor = 4
    end mouseEnter

    on mouseLeave
    self.blend = 50
    pMember.forecolor = 0
    end mouseLeave

    Andrew Morton

    Andrew Morton Guest

  6. #5

    Default Re: mouseEnter / mouseLeave sprite error

    I'm trying to understand this script.
    Why do you need self and pMember?
    couldn't you just use self for both blend and foreColor?
    I tried it and it highlights the bounding box instead of the text so I see
    it doesn't work.
    Can someone explain why? What is the difference between pMember and self?
    thanks
    cj
    "Andrew Morton" <akm@in-press.co.uk.invalid> wrote in message
    news:bqn40f$s0h$1@forums.macromedia.com...
    > > Don´t use blendlevel
    > >
    > > 1. Use blend
    >
    > Your reason being what? Mine would be that blend is faster than
    blendLevel, but
    > you may have a different reason.
    >
    > > 3. Try not using the me.spriteNum... . instead place a on beginSprite
    > > handler and declare a property called pSprite = me.spriteNum
    > >
    > > Then use pSprite as the sprite number wherever else required.
    >
    > Or just declare spriteNum as a property and use that, because that
    automatically
    > makes it available and avoids storing exactly the same information twice:
    >
    > property spriteNum
    >
    > on beginSprite
    > put "I'm sprite " & spriteNum
    > end beginSprite
    >
    > Also, I tend to assign the sprite reference to a property like this:
    >
    > property spriteNum, self
    >
    > on beginSprite
    > self=sprite(spriteNum)
    > end beginSprite
    >
    > And similarly for storing a direct reference to the sprite's member.
    > So geneonblk's code would look like this:-
    >
    > property spriteNum, self, pMember
    >
    > on beginSprite
    > self=sprite(spriteNum)
    > pMember=self.member
    > end beginSprite
    >
    > on mouseEnter
    > self.blend = 100
    > pMember.forecolor = 4
    > end mouseEnter
    >
    > on mouseLeave
    > self.blend = 50
    > pMember.forecolor = 0
    > end mouseLeave
    >
    > Andrew Morton
    >

    CJ Guest

  7. #6

    Default Re: mouseEnter / mouseLeave sprite error

    > Can someone explain why? What is the difference between pMember and self?

    pMember is a reference to the member whereas self is a reference to the sprite.

    [A sprite is an instance of a member, but you cannot always use the same
    properties of each and sometimes you can set a property of either but only one
    will work.]

    Andrew

    Andrew Morton Guest

Posting Permissions

  • You may not post new threads
  • You may 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