使用sharedObject来跟踪点击次数

时间:2011-08-04 21:47:41

标签: actionscript-3

如何使用sharedObject跟踪点击次数并将其存储在.txt文件中?我的客户想要跟踪用户的点击,我不知道如何使用sharedObject。任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

如果您将点击数存储在SharedObject中,则点击数据将保留在客户端上。您仍然需要将数据发布到服务器捕获它。您需要在SharedObject中存储的是用户ID,以便您可以识别哪些点击属于哪个用户。

var so:SharedObject = SharedObject.getLocal("mydomain.com"); 
so.data.userId = "unique-id" // this would be a unique id from the server
so.flush(); // this writes the data in the SharedObject