10 likes | 185 Views
JavaScript Movie Player. Launch() - This sets everything up on load of web page (1st image, play mode). Fwd() - Sets status variable to 1 for play & calls AnimateFwd. Rev() - Sets status variable to 1 for play & calls AnimateRev. Stop() - Clears TimeOut id and sets
E N D
JavaScript Movie Player Launch() - This sets everything up on load of web page (1st image, play mode) Fwd() - Sets status variable to 1 for play & calls AnimateFwd. Rev() - Sets status variable to 1 for play & calls AnimateRev. Stop() - Clears TimeOut id and sets status variable to 0 for stop. AnimateFwd() - Finds next image & changes the source of image depending on play mode. AnimateRev() - Same as AnimateFwd but finds next image by decreasing image # Animate() - Creates all the buttons and functions associated w/ buttons so that things happen at appropriate time. Launch() is run onLoad of page. All the HTML page consists of is a single call to Animation(). Then the others are called when a button is pushed by the user. There is a setTimeout statement in AniamteFwd and AnimateRev that recursively calls each one after the given delay. If play mode is looping, then it doesn’t stop until Stop button clicked, which calls stop function. GoToImage() - Goes to a specific image # specified by user - changes source of image. Nothing happens until the user clicks one of the buttons on the page. Launch() simply sets up defaults for play mode and current image so that when a button is pushed it can start changing images and not wait for all imfo to be provided. ChangeSpeed() - changes the delay time between frames by either incrementing or decrementing delay ChangMode() - Sets the playmode variable to the value in the pulldown on the form.