Hi Mirianam
I am not sure that I understend what you want to do with your contrl
button but here are some suggestions.
mirianam wrote:
> Thank you for your response.
> Yes I had figured out that the script had to be attached to the sprites and
> not the casts.
>
> This is what I did:
>
> on mouseDown
> set the visibility of sprite 31 to 1
> end
Rather than setting the visibility on and off you should consider
moving the sprite in and out of the stage area:
on mouseDown me
set the locH os sprite 31 = here you specify the locH you want
set the movieRate of sprite 6 = 1
end
Setting the visibility can cause problems.
> on mouseUp
> set the movieRate of sprite 6 to 1
> end
> on mouseEnter me
> set the member of sprite the currentSpriteNum to member "pause all"
> end
>
> on mouseLeave me
> set the member of sprite the currentSpriteNum to member "pause"
> end
>
> and for "play" I did the opposite ie visibility 0 and movierate 0. I had
> set visibility of sprite 31 to 0 in moviescript - on startmovie.
on mouseUp me
set the movie rate of sprite 6 = 0
set the locH of sprite 31 = - 1000
end
>
> Now the rollovers seem to work.
> Is there anything wrong with doing it like this?
>
> Now I want to make fastforward and fastreverse buttons but I would like to
> make onMousedown set the movierate to 2 but on mouseUp either 0 or 1
> depending on whether the video was playing or paused when the button is
> clicked so that it doesn't get out of sync with the play/pause button.
> I have no idea how to go about doing this. I'm guessing that it's some kind
> of if then script but what?
> Can you point me in the right direction? Thanks
You have to set a flag that checks if the video is palying or not,
add this line to your *on startMovie* script:
set myflag = 0
Then on your sprite script:
on mouseDown me
global myflag
set the locH os sprite 31 = here you specify the locH you want
if myflag = 0 then
set the movieRate of sprite 6 = 1
myflag = 1
else
set the movieRate of sprite 6 = 2
end if
end
on mouseUp me
gloabl myflag
if the movieRate of sprite 6 = 1 then
set the movieRate of sprite 6 = 0
myflag = 0
if the movieRate of sprite 6 = 2 then
set the movieRate of sprite 6 = 1
if the movieRate of sprite 6 = 0 then
set the movieRate of sprite 6 = -1
end if
end if
end if
end
A better way would be to use a case statement:
on mouseUp me
checkMyFlag
end
on checkMyFlag
global myflag
case of (the movieRate) true
2: then set the movieRate of sprite 6 = 1
0: then set the movieRate of sprite 6 = -1
1: then set the movieRate of sprite 6 = 0
set myflag = 0
end case
end
I am sure that there are more elegant ways of doing it but
this should put you on the right track.
(totally untested)
HTH
JohnT
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]