开发者

Run a function on first run of a air application

开发者 https://www.devze.com 2023-02-25 01:44 出处:网络
I want to call a function only when the air application is run on a system for the first time after installation. I开发者_如何学Cs there something I can check to determine this?

I want to call a function only when the air application is run on a system for the first time after installation. I开发者_如何学Cs there something I can check to determine this?

Thanks in advance!


I think the best thing to do is use the SharedObject interface and store a value that tells you that you have done something already. Something like this, perhaps?

var so:SharedObject = SharedObject.getLocal("appName.breadcrumb");
if(!so.data.initialized) {
    doYourStuff();
    so.data.initialized = true;
}

Does that work for you?

0

精彩评论

暂无评论...
验证码 换一张
取 消