I did it!!!
The problem was that SAM was giving a different ID syntax to the SWF file. I simply changed the syntax for the $id variable to reflect the one used by images.
To count clicks for SWFs, edit line 70 in ad.class.php from:
$id = "ad-".$ad['id'].'-'.rand(1111, 9999);
$id = "a".rand(10, 99)."_".$ad['id'];
If you want SAM to display a substitute image in case the browser doesn't have flash, change line 78:
$text = __('Flash ad').' ID:'.$ad['id'];
$filename = substr($file,0,strlen($file)-4).".jpg";
$linkname = substr($flashvars,11,strlen($flashvars)-13);
$text = "href='".$linkname."'><img src='".$filename."' width='".$width."' height='".$height."' / ></a>";
and line 93:
<a id='$id' class='sam_ad' $text
Note: for this to work you have to add a substitute jpg image with the same name and path as your swf file.
When creating the SWF you have to define clickTag in "flashvars" with the destination path, like so: