• portfolio
  • flash
  • microbe
  • go
  • blog
  • contact

back to GOSWF page

How to directly pass SGF data to GOSWF?

Passing directly the SGF offers some advantages:

  • it can be easier and faster if the SGF data is small
  • you don't need to put the SGF file on the same server as the GOSWF file (flash security limitation). As a result, you can use the GOSWF located on any server. For example you can use this adress: http://sites.google.com/site/goswf1/goswf.swf. With this method, you can use GOSWF on you blog without uploading goswf file and game files.
    (CAUTION: Please don't use the goswf file on another server without autorization from the owner. You are allowed to use http://sites.google.com/site/goswf1/goswf.swf since it's my google test site)
    (EDIT 2010/02/12: This method was cancelled because it seems that using a google site may cause problem on Internet Explorer)

However, there are some drawbacks:

  • some characters (&, =, ...) may not be interpreted correctly if they interfere with URL-encoding parsing. Replace them with their percent-encoded characters. For example "this is a difficult life & death problem" should be replaced with "this is a difficult life %26 death problem". This is more likely to happen in "comment" tags (C[]).
  • the HTML code may become unreadable, or take a long time to load, specially if you have many SGF games (or a heavy one) in your HTML page.

Well now you are aware of the risks ;-)

So, how to pass the SGF data? Just copy/paste the SGF data in replacement of the url value:

<EMBED src="http://YOUR_SITE/goswf.swf"
flashVars="url=(;GM[1]FF[4]SZ[19]HA[0]KM[0]AB[ca][cb][dc][hc][ic][kc][dd][ed][fd][gd]AW[da][fa][db][hb][ec][fc][gc]C[Advanced](;B[eb];W[ea](;B[ha];W[ib];B[jb];W[ga];B[fb];W[gb];B[ia];W[ja];B[ia]C[Correct.])(;B[ga]WV[];W[fb]C[Wrong.])(;B[gb]WV[];W[fb]C[Wrong.])(;B[ib]WV[];W[ha]C[Wrong.]))(;B[ha]WV[];W[ib](;B[jb];W[ga];B[eb];W[fb]C[Wrong.])(;B[eb];W[fb];B[jb];W[ga]C[Wrong.]))(;B[gb]WV[];W[fb]C[Wrong.])(;B[ga]WV[];W[eb]C[Wrong.])(;B[ib]WV[];W[ha]C[Wrong.]))"

width="440" height="600"
type="application/x-shockwave-flash" >
</EMBED>

notes:

  • you will need version 0.94 or higher to do this.
  • in the above example, variation showing has been turned off because the SGF appears to be a problem. Right-click/show Variation to toggle variation showing "on".

back to Tutorial list