dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: check local storage

  1. #1
    Member
    Join Date
    Jun 2002
    Location
    deventer, the netherlands
    Posts
    38

    check local storage

    hi there,

    I need help on the following:

    I have to make a check if it's possible to use the 'SharedObject' on the users machine. But the user may not be bothered with the flashsettings-dialog.

    confused: who can help me out???

    mark:
    amazing! getting paid for flashing

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Read up on the ".flush()" method. You can set a size which is the minimum size you need and the status will tell you if you can save it.

  3. #3
    Member
    Join Date
    Jun 2002
    Location
    deventer, the netherlands
    Posts
    38
    yep, tried this:

    mydata_so = SharedObject.getLocal("data");
    var x = mydata_so.flush(1);

    this returns 'pending' and still shows the dialog window.

    I know it can also return just 'false', but how?
    amazing! getting paid for flashing

  4. #4
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Ah right, no you cannot do it invisibly, this from Macromedia:
    The following values are returned:
    • a If the user has permitted local information storage for objects from this domain, and the amount of space allotted is sufficient to store the object, this method returns true . (If you have passed a value for minimumDiskSpace , the amount of space allotted must be at least equal to that value for true to be returned).
    • a If the user has permitted local information storage for objects from this domain, but the amount of space allotted is not sufficient to store the object, this method returns "pending" .
    • a If the user has permanently denied local information storage for objects from this domain, or if Macromedia Flash MX is unable to save the object for any reason, this method returns false .
    Macromedia, shared object

  5. #5
    Member
    Join Date
    Jun 2002
    Location
    deventer, the netherlands
    Posts
    38
    I was afraid so, thanks anyway.

    I have build this check in a intelligence-test. Every given answer has to be saved on the users machine, but if this is not possible it will be sent to the server. At the end of the test all answers are sent to the server. But the user may not be bothered with the dialog window....

    anyone...? work around...?
    amazing! getting paid for flashing

  6. #6
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Not ideal I know, but within the parameters of what can be done easily, you could try the following:
    [list=1][*]Do a SharedObject.flush(); By not specifying a size, it won't popup the dialog as it only needs to check if it is allowed or not.[*]If it returns "false", SO is not allowed, send to server.[*]If it returns "true", check for size with SharedObject.flush(x); where x is the minimum you need.[/list=1]
    Actually, most IQ tests I have seen are multichoice, so you only need to store a question ID and answer ID for each one, not a lot of data, so you could probably skip stage 3 and just assume there is enough space ...

  7. #7
    Member
    Join Date
    Jun 2002
    Location
    deventer, the netherlands
    Posts
    38
    thanks for your help.
    I think it works now... I now have to check on other machines.

    thanks again

    mark
    amazing! getting paid for flashing

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