ctf速成_速成:共享对象摆弄

ctf速成

alt

Personal Hit Counter Shared Object Example >>

个人命中计数器共享对象示例>>

Messing around with code in Flash MX / MX 2004 can produce some interesting results, some more useful than others, and in this case a quick and dirty personal hit counter for the number of times you have visited the site you implement the code on, along the lines of ‘You have been here xx times’ using the Shared Object.

在Flash MX / MX 2004中处理代码会产生一些有趣的结果,比其他结果更有用,在这种情况下,对于访问您在其上实现代码的网站的次数而言,这是一个快速而肮脏的个人命中计数器使用共享对象的“您曾经来过这里xx次”行。

Whilst displaying the result of the following code may seem a trite overboard, it does have uses and implementations; for example…

尽管显示以下代码的结果似乎有些陈词滥调,但它确实具有用法和实现; 例如…

You could easily trigger functions to be called using a simple switch statement allowing you to conditionally display information based on the number of times a user has been to the site

您可以使用简单的switch语句轻松触发要调用的函数,从而使您可以根据用户访问该站点的次数有条件地显示信息

You could change the navigation structure to suit the needs of the user based upon their click habits; the list goes on…so feel free to experiment

您可以根据用户的点击习惯更改导航结构以适应他们的需求。 清单还在继续...请随时尝试

sObjVisits = SharedObject.getLocal("userVisitsLocal"); if (sObjVisits.data.visits == undefined) { sObjVisits.data.visits = 1; } else { sObjVisits.data.visits = sObjVisits.data.visits+1; } howManyVisits = sObjVisits.data.visits; sObjVisits.flush(); visits.text = "been here "+howManyVisits+" times";

sObjVisits = SharedObject.getLocal("userVisitsLocal"); if (sObjVisits.data.visits == undefined) { sObjVisits.data.visits = 1; } else { sObjVisits.data.visits = sObjVisits.data.visits+1; } howManyVisits = sObjVisits.data.visits; sObjVisits.flush(); visits.text = "been here "+howManyVisits+" times";

翻译自: https://www.sitepoint.com/quickie-shared-object-fiddling/

ctf速成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值