ShockWave ========= Shockwave is the means by which that content is delivered to Web browsers. It's a conversion process. Shockwave compromises two components: 1. Shockwave plug-in 2. Afterburner - compresses Director movies at a ratio of greater than 2:1 to a .dcr format. The files must be created using Macromedia Director (.dir .dxr). Alternatives to Shockwave: Animated GIFs, Java, Real Audio, and movie file formats. The markup for inserting a .dcr into an HTML page: TEXTFOCUS parameter: - Specifies when to accept input from the user . onMouse - Won't recieve input until the user clicks on the movie OnStart3 - As soon as the movie loads Never - Never <IMG SRC="default.gif> - If the browser doesn't support shockwave it will display the default.gif image Each image should use the exact same palette. - The default palette. - A custom palette. Director ======== Score Window - Enables to create responses to events such as jumping to a specific frame. Sprite - A cast member in one of the 48 channels available in the Score window (bit map, vector graphic, text, button etc.). Puput - Overides the default controls of the Score. Create a button image in channel 1 and add the folowing code to the frame script: on exitframe puppetsprite 1, true end Now the Score will release the channel to be a puppet. You must have something in the sprite channel in the Score to initiate a puppet. Lingo ===== Scripts ------- A script is a group of statements. The code is grouped into handlers: on some_event ... end Frame Scripts ------------- Placed in the Score in the frame script channel. on enterframe ... end on exitframe ... end "enterframe" and "exitframe" will also fire when looping the same frame. Movie Scripts ------------- on startmovie ... end on stopmovie ... end - If the movie loops continually "on stopmovie" will never fire. on custom_handler ... end Cast Members Scripts -------------------- In the cast member window you can add a script to any cast member that can be placed on the stage. on mousedown ... end on mouseup ... end Sprite Scripts -------------- The script will fire when the sprite is clicked in a certain frame. Different scripts can be used in different frames. The scripts are not attached to the Cast member. Syntax ------ Variables --------- Global ------ Stay in the memory as long as the movie runs. global global_var set global_var = some_value Local ----- Only availible in a handler. set local_var = some_value Custom Handlers --------------- Put the custom handler in the movie script to make it availible to the whole movie. on my_handler ... end Call the custom handler from anywhere in the movie. on mousedown ... my_handler end Passing and Returning Values ---------------------------- on my_handler1 some_argument ... end on my_handler2 some_argument set local_var = some_argument + 7 return local_var end If the handler returns a value you must use a parentheses. on mousedown my_handler1 5 set local_var = my_handler2(5) end Assignment ---------- There're 3 equivalent statements: 1. set var_name = some_value 2. set var_name to some_value 3. put some_value into var_name If..Then..Else -------------- if true_condition then ... else ... end if Loops ----- While Loops ----------- repeat while true_condition ... end repeat For Loops --------- first_num can be eather larger or smaller than the second_num. repeat with var_num = first_num to second_num ... end repeat Internet Lingo Functions ------------------------ GotoNetMovie "http://www.../my_mov.dcr" GotoNetMovie "my_mov.dcr" - Loads another shockwave movie. The last gotoNetMovie call will cancel the prevoius one if it hasn't finished loading. Both the original movie and the loaded one must have the same dimentions (height/width) to prevent blank area or cropping of the loaded movie. GotoNetPage "html_link" - Loads an html page. GetNextText "text_file.txt" - Downloads a text file. NetDone() - Checks if the last operation is over or not (returns 0/1). Put it in a different frame than the operation itself and call this frame repeatadly until 1 is returnd. Don't loop NetDone inside a single frame or you'll always get 0. NetTextResult() - Returns the last text file that finished downloading using GetNetText. NetStatus "message" - Places the "message" at the status bar of the web browser. NetLastModDate() - Returns the last modify date of the most recent file that was used in a network operation. External Parameters ------------------- Passing external arguments from html to the movie: ExternalParamValue("sw1") - Returns the value of the parameter named "sw1". ExternalParamName(n) - Returns the name of the n'th parameter ExternalParamCount() - Returns the amount of external parameters The List of Valid Argument Names: swURL, swText, swForeColor, swBackColor, swFrame, swColor, swName, swPassword, swBanner, swSound, swVolume, swPreloadTime, swAudio, swList, sw1, sw2, sw3, sw4, sw5, sw6, sw7, sw8, sw9 Misc Functions -------------- Updatestage - Redraws the stage. ------------------- cursor 200 - Turns the mouse cursor invisible. castnum - The handle of a sprite.