switching between movies
Mark Talluto
userev at canelasoftware.com
Wed Aug 25 12:53:30 EDT 2004
On Aug 24, 2004, at 8:17 PM, Cubist at aol.com wrote:
> For whatever mysterious reason, some of my code vanished into the
> ether --
> I mean, where did the "end switch" go, for cryin' out loud!? Let's see
> if I
> can get it right this time...
>
> on keydown thekey
> put thekey
> switch theKey
> case 1
> put "B" into OldPlay
> put "A" into NuPlay
> case 2
> put "A" into OldPlay
> put "B" into NuPlay
> end switch
>
> stop player OldPlay
> put the currentTime of player OldPlay into Atime
> hide player OldPlay
> set the currentTime of player NuPlay to Atime
> show player NuPlay
> start player NuPlay
>
> pass keyDown
> end keydown
>
> Does *this* work better or worse than the original code?
This is very clean. The only thing to remember is that you need
"breaks" to close out each "case". The other issues is that if a user
clicks on any other key besides a one or a two, you will get an error.
The speed issues feels the same as the code I posted.
--
Best regards,
Mark Talluto
http://www.canelasoftware.com
More information about the use-livecode
mailing list