看到google analytics的flex 支持,觉得不错,还可以调试,可惜不能拿过来自己部署,在网上开到开源的piwik,部署了一下,觉得不错,在官方上没有看到flex,actionScript的支持,觉得好可惜的,好不容易在网上找到了个人写得piwik的actionScript版本,可惜没有调通。先把代码放上来吧。。。。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="initApp()">
<mx:Script>
<![CDATA[
import org.piwik.PiwikSetup;
import org.piwik.events.PiwikEvent;
import org.piwik.shortcuts.QuickPiwik;
private var qp:QuickPiwik=new QuickPiwik();
public function initApp():void
{
qp.init("http://localhost/piwik/",1,"b6bbf9cd58cf2d88c4b25bbf29692b1f");
qp.getVisits();
qp.addEventListener(PiwikEvent.LOADED, loaded);
}
public function loaded(e:PiwikEvent):void
{
trace(e.data);
trace(e.requestType);
}
protected function btn_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
qp.getVisits();
}
]]>
</mx:Script>
<mx:Button id="btn" label="Button" click="btn_clickHandler(event)" x="360" y="213"/>
</mx:Application>
附件附上了swc包。。。