Make Flash Animations, Video, Slideshows, Text Effects, Buttons & Menus. Designer Templates, 250 Effects, plus Components & Video Controls

简体中文 繁體中文 Français Español Italiano 日本 Polski Deutsch SWiSHzone.com
SWiSHzone.com Banner
You are here: Home > Community > Tutorials
Community
FREE TOOLS!
Laboratory
Community Overview
Movies
Components
Effects
Screencast Tutorials
> Tutorials
Official Blog
Forums
Other Forums
Request help
Search Tutorials

 All words
 Any words

 Similar words
 Exact words

Number of Results:
Monthly Newsletter
Get our monthly newsletter for all the latest news
competitions, tutorials and tips > Sign Up Now

SWiSH Max: Hello World in SWiSHscript
Creator: James MacGregor
Website: http://www.swishzone.com
Submitted: Wed Oct 26 2005
Description: This is a step-by-step tutorial for creating a Movie displaying the words "Hello World" in the Debug Panel.
Zip File: Download


Program: SWiSHmax
Build Date: 2005.08.15+

 

This Movie introduces the method of entering scripts, explains use of the onLoad() Event and demonstrates the use of the trace command and Debug Panel.

1) Start with a new project (File | New) and save the file as "myhelloworld.swi".

2) Select the 'Script' Panel, then enter an onLoad() Event for Scene 1, as shown below:

The 'Script' Panel should now look like this:

3) Add a trace command to the onLoad() Event by selecting the onLoad() function, as shown above. Press the 'Add Script' button then select Debugging | trace(...) from the menu as shown below:

Note: It is possible to append a Scripting command by right-clicking on the command you want the new command to appear after, then selecting the Add Script Menu item. Sections of script can also be duplicated and moved using the Cut and Paste Menu options.

The 'Script' Panel should now look like this:

Note: The function and trace statement are shown in red. This is because the trace statement is currently incomplete.

4) Complete the trace statement by adding the string "Hello World" (including the quotation marks). Select the trace statement in the top half of the 'Script' Panel. The bottom half of the Panel should have the heading trace(); as shown in the image above. Click the bottom section of the Panel (the section with the "trace();" heading) and enter the text "Hello World". Once the second quotation mark has been entered, the text should turn blue. Click anywhere outside of the Panel you have just entered the text into. This will cause the script to be re-validated. The entire script function should turn black indicating that it contains syntactically correct script.

The Panels should now look like this:

4) If you are confident in the use of command syntax, you can enter commands directly using the Statements | evaluate; Menu option, as shown below.

This will result in the following window:

The semi colon ';' will be added for you

5) Select the Debug tab amongst the panels displayed on the right hand side. Check your script by pressing the 'Play' button to run your Movie. The 'Debug' Panel should show the following:

6) Save your Movie

Analysis: When the 'Play' button is pressed, the Movie loads. This causes the script in the onLoad() Event Handling Function to be executed. The trace statement containing the string "Hello World" is then executed, causing the string to be displayed in the Debug Panel.



Search | Privacy policy | Contact us | Site Map | Copyright SWiSHzone.com Pty Ltd 1999-2010