Goswf basics: how to install Goswf and use it?
This tutorial explains how to use Goswf on your website, provided that you are the owner of this site. You will need to upload files to your site and thus need a FTP client, and login+password for your site hosting. In such case, you probably know how to upload files to your site. If not, I suggest using FileZilla.
If you have a blog site with no direct access to your hosting (such as blogger), you may need another tutorial.
Installing Goswf
- download the latest goswf.zip file on your computer and unpack it.
- upload goswf.swf file on your website (it can be in any directory, but let's suppose it's in a "data" directory of your site, for example: www.mysite.com/data/).
Display a game, method 1: absolute path (recommended)
- Now you probably want to display a game in a HTML page: first you need to check that the game SGF is on your website (flash security system forbids to load a data file located on a different server). Let's suppose that the game is located here: www.mysite.com/sgf/game1.sgf. Upload the game if necessary.
- Now let's write the proper HTML code for your page:
<EMBED src="http://www.mysite.com/data/goswf.swf"
flashVars="url=http://www.mysite.com/sgf/game1.sgf"
width="440" height="600"
type="application/x-shockwave-flash"></EMBED>
- Now upload your page in any directory of your site. For example www.mysite.com/page1.html.
- That's done! Check your page in a browser.
Display a game, method 2: relative path
- If you don't want to use absolute URLs (starting with "http://www.mysite.com/...") you can also use relative URLs (see below for some reasons to prefer relative URLs). For this purpose, you have to now where the HTML page will be located. Let's suppose it will be located at the root of your site: www.mysite.com/page1.html.
- Now, you only need to specify the path of goswf.swf relative to your page. In our exemple, the relative path is thus: "data/goswf.swf".
- Now, the path of the SGF file, but... CAUTION: the path of the SGF game has to relative to the GOSWF file, not to the HTML page. In our example, the local directory is then the "data" directory, so we must go up one directory to go back to the root site directory, and then go down to the "sgf" directory where the game1.sgf is located. It is written "../sgf/game1.sgf".
<EMBED src="data/goswf.swf"
flashVars="url=../sgf/game1.sgf"
width="440" height="600"
type="application/x-shockwave-flash"></EMBED>
- Upload your page in the appropriated directory or your site, namely: www.mysite.com/page1.html
- That's done! Check your page in a browser.
This method is recommended only if you host your goswf and SGF files on a google site. (see tutorial here)
Troubleshooting:
The most common problems encountered when checking your page:
- if you see no Goswf interface, your goswf URL is probably wrong, or goswf.swf is not at the specified URLs. Type the URL in your browser to make sure that Goswf is properly online.
- if you correctly see Goswf, but the game doesn't load: check the SGF URL by typing the URL in your browser and check that the result is the SGF you expected.
- if Goswf is visible, and if you are sure that something is loaded, but for some reason the game doesn't display: click in Goswf area to put focus on it, and next, type simultaneously on SPACE key and "!" key: it will display a debug console allowing to test different URLs.
- the sgf is correct, but located on a different server. Ex: www.mysite.com/goswf.swf cannot load a game located on another website: www.lotofgogames.com/game_5437.sgf. You have to host both the goswf.swf and the game SGF files on the same website.
Well well, now you are ready for more advanced tutorials!! ![]()
