Ask a Question related to Macromedia Director Lingo, Design and Development.
-
geneonlbk webforumsuser@macromedia.com #1
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
-
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). ... -
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 -
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... -
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... -
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... -
Arturo Toledo #2
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...problems" when I repeated pass the mouse over a text sprite with a hilite> I get the error "This shockwave movie has errors that have causes playback
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
-
geneonlbk webforumsuser@macromedia.com #3
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
-
Andrew Morton #4
Re: mouseEnter / mouseLeave sprite error
> Don´t use blendlevel
Your reason being what? Mine would be that blend is faster than blendLevel, but>
> 1. Use blend
you may have a different reason.
Or just declare spriteNum as a property and use that, because that automatically> 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.
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
-
CJ #5
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...blendLevel, but>> > Don´t use blendlevel
> >
> > 1. Use blend
> Your reason being what? Mine would be that blend is faster thanautomatically> 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> 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
-
Andrew Morton #6
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



Reply With Quote

