A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to create & code a function which is used ONLY once - EVER! … at first Start Up

  1. #1
    Senior Member
    Join Date
    Apr 2008
    Location
    Rotorua / New Zealand
    Posts
    117

    How to create & code a function which is used ONLY once - EVER! … at first Start Up

    Hi there,

    I'm looking for some code where 'How to create & code a function which is used ONLY once - EVER! .... at first Start Up of AIR App.??? this I need to download the first set v1.0 of Xml base data files in an AIR Application and after that this particular function should never EVER be addressed again!

    Any help would be appreciated regards aktell

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Well, you can use a Shared Object, to store a boolean in the users computer and each time the air app runs, it check if the variable exists and doesn't execut the function. But if you need it to be 100% ONLY ONCE run forever, then you have to use XML, FileStream or SQLITE to save the variable Server-Side.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #3
    Senior Member
    Join Date
    Aug 2012
    Posts
    115
    is not as simple as never calling function again!!!

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I came up with another idea, but i have not tested it to be sure it works.
    It consists in having a text file and a .bat file (windows batch), with a long text numeric or text variable, or a combination of both, then flash will check if the textfile with that variable exists, then it will execute the function. After that, it will run the .bat file, and the .bat file will remove/delete the textfile, so when the air aplication is run again, as it will not find the textfile or the variable, the function won't be faired again.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center