Local Shared Objects and multiple SWFs: mutexes necessary?

I will have multiple SWFs on a single web page, each reading
and writing the same SharedObject, which may be up to 100K in size.
Will I need to create some sort of mutex scheme to ensure that one
SWF isn't writing while another is reading, or do all SWFs on a
page essentially run as a single-threaded application?

>1) I don't think a SharedObject.flush is synchronous.
I believe it is, as long as you're not attempting to write
more data than the user has set for the Local Storage limit.
http://livedocs.adobe.com/flex/3/langref/flash/net/SharedObject.html#flush()
You'll note that flush is described this way: "Immediately
writes a locally persistent shared object to a local file", and if
it returns "SharedObjectFlushStatus.FLUSHED" that means that "The
shared object has been successfully written to a file on the local
disk". So I'd say that the normal operation of flush() is
synchronous. However, the SharedObjectFlushStatus.PENDING state
means that we've exceeded the limit set by the user, and are
waiting for them to allow or disallow it. I believe (strongly) that
that's the only case in which a netStatus event is sent.
Do you read this differently?
As far as multiple SWFs running as cooperative or preemptive
multitasking processes, I'd really like to know the answer, but it
probably doesn't matter. The more I read and think about this, the
more it seems to me that Adobe has to prevent simultaneous reads
and writes to a single Shared Object from taking place, as one use
of it that I've read about is to share data between SWFs. For
example:
http://www.devarticles.com/c/a/Flash/Communication-and-Security-with-the-Flash-Communicati on-Server/1/

Similar Messages

  • Problem Assigning Local Shared Object

    I have created a swf that increments a dollar amount every
    five seconds. My clients want this dollar counter to be consistent
    between HTML pages. That is where the local shared object comes in.
    I can create it fine, and even read it (I know this by a trace() I
    used). But for the life of me I can't get the value from the shared
    object passed to the dynamic text field as soon as the swf is
    loaded. It always starts at the beginning increment of 0.192!
    I'm pretty sure what is messing me up is either the function
    that formats the number to a dollar format or the function that
    increments the dollar value up every five seconds and saves that
    value to the shared object.
    Using the code below, you can create a flash file with a
    dynamic text labeled 'money' and the actionscript copied into the
    first frame on the timeline.
    Any help would be great appreciated!

    aasimmomin wrote:
    > Hi,
    >
    > I have 2 files *.swf files. The first one is creating a
    shared object while
    > the second one reads the created shared object.
    > The files works perfectly on my local machine and on my
    server, but the second
    > file is not able to read the shared object on the
    client's server.
    > Although both files work perfectly well on the client's
    local machine.
    >
    > I have checked and found that there is no synchronizing
    problem between the
    > writing and reading of the shared object.
    >
    > Could there be some settings on the client's server
    which may be missing?
    do not post same question to multiple forums, post in one and
    stick to it.
    http://www.adobe.com/support/forums/guidelines.html
    Adobe forums posting guidelines
    When posting messages...
    - in DON'T Section :
    Don't cross-post or double-post. Posting a message to more
    than one forum (i.e "cross-posting" is
    unnecessary, and creates extra traffic for you and others to
    read through. If you've already posted
    a question, please don't repeat your posts in order to get
    more attention- this makes it very
    difficult for others to see if and/or where your question was
    answered.
    Regards
    Urami
    Happy New Year guys - all the best there is in the 2006 :)
    <urami>
    http://www.Flashfugitive.com
    </urami>
    <web junk free>
    http://www.firefox.com
    </web junk free>

  • Local Shared Object not working in Firefox 2

    I'm using a local shared object in my flash animation so that
    the animation plays only once per user visit. It works fine in IE
    6/7, but doesn't work at all in FF (the movie still plays when I
    refresh the homepage, or come back to the homepage from another
    page).
    This is what I'm using:
    var my_so = SharedObject.getLocal("animationPlayed");
    if (my_so.data.played == undefined)
    my_so.data.played = true;
    my_so.flush();
    else
    gotoAndStop(258);
    } // end else if
    clearLSO_btn.onRelease = function ()
    my_so.clear();
    stop ();
    And this is the site:
    http://qualitycateringforkids.com/default.aspx
    Any ideas?
    Thanks
    RK

    Both of these load no problems in my FF3

  • Can no longer clear Local Shared Objects (Persistent Identification Element)

    The equivalent of a cookie in Flash is the "Persistent
    Identification Element" which is also called a "local shared
    object." The Adobe TechNote titled "How to manage and disable Local
    Shared Objects" at url
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=52697ee8
    provides a link to control deleting Local Shared Objects. That link
    contained in the TechNote is "Website Storage Settings panel":
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.htm l
    Until today, that was a good link that enabled me to clear
    the local shared objects. Today, however, the link leads to a
    totally different page of miscellaneous Adobe matters.
    Does anybody know the correct link to clear my Flash player
    of the local shared objects?
    Thanks very much.

    Your Template code is incomplete / corrupted. 
    That's why you can't edit it.
    Try opening your .dwt file in a plain text editor like NotePad.  Remove the editable regions from code.  Save.  Open in DW.
    You will need to SaveAs Template (same name as the one used by your child pages).  Add editable regions to match the ones in your child pages.  Save.
    Nancy O.

  • LOCAL SHARED OBJECT in CAIRNGORM

    Hi,
    I am new to Cairngorm framework.
    I want to use Local shared object in Cairngorm framework,I am confused where i have to create and where i will get data and how i can add to lso.
    If any example or suggestions  to use Local shared object It is helpful for me.
    Thanks in Advance.
    Regards
    Naresh

    Hi,
    I am also new to flex.
    But here is what I think.
    You may want put it into servicelocator since sharedobject is not part of you cilent datamodel.
    Use delegate to update your modellocator with value from sharedobject.
    Hope it can help.
    If you solved the problem, pls also post it and we can learn together:)
    Best

  • Can Local Shared Objects Be Moved to a New Computer?

    We are awaiting the arrival of our new computer. My 8-year old son is concerned that when he plays his favorite Flash games on the new computer, the games won't remember his previous score or level in the game.
    I understand that this information is typically stored in Local Shared Objects. Therefore, my question:
    Can the LSOs on our existing [Windows XP] computer be moved to our new [Windows 7] computer? If so, do I store them in the same location in Windows 7 as they are stored in Windows XP?
    Thanks for your advice.
    The Daddy

    I think these data are stored in one of the following locations (in Windows XP):
    C:\Documents and Settings\[username]\Application Data\Adobe\Flash  Player\AssetCache
    and/or
    C:\Documents and Settings\[username]\Application Data\Macromedia\Flash  Player
    Easier than to type the full access path for these two folders would be to use the %APPDATA% environment variable; you would type the following into Windows Explorer's address bar:
    %appdata%\Adobe\Flash  Player\AssetCache
    and/or
    %appdata%\Macromedia\Flash  Player
    Now in Windows 7 these are in a slightly different place:
    C:\users\[username]\AppData\Roaming\Adobe\Flash Player\AssetCache
    and/or
    C:\users\[username]AppData\Roaming\Macromedia\Flash Player
    which would be, using the environment variable:
    %appdata%\Roaming\Adobe\Flash Player\AssetCache
    and/or
    %appdata%\Roaming\Macromedia\Flash Player
    What I would do is to copy the full contents of both folders from XP to 7, before installing Flash Player on the new machine.
    Let us know if this worked.

  • How to bundle a .FLA and multiple .SWF files in one .EXE?

    Hi,
    I have a .FLA file which uses loadMovieNum() to load various
    .SWF files when each one is called by the user clicking on a
    button. Each .SWF file also uses loadMovieNum() to call a second
    .SWF file. When I publish the .FLA file as a .SWF file it all works
    beautifully.
    Now I need to package the entire project into a Windows
    projector .EXE file for offline use on a computer without the Flash
    Player. When I publish the main .FLA file as a .EXE file, the .SWF
    files still load, although they blink before fully loading and
    displaying steadily.
    What I would really like to do is to bundle all the .SWF
    files into the .EXE file so when I send the finished project to the
    end user, they only have to deal with one file, rather than a
    folder with the .EXE file and multiple .SWF files.
    Is there a way to do this?
    I am using Flash 8 Professional.
    Thanks,
    Cam

    Since this isn't going to be web-based, why not include all
    the external swf files into the same Flash file and then use
    attachMovie?
    This will allow you to create one .exe file that would
    contain EVERYTHING. Since you aren't worried about loading speeds,
    you don't have to load the movie clips, but can simply create one
    large Flash file.

  • CP5 and multiple swfs reporting

    OK the title is kind of choppy....  Here is the scenario.  We are still working with our homegrown LMS and CP5 reporting quiz results to it. Now my boss wants to know if we had a course on Lab Security Requirements and there were 15 labs each with their own security requirements could we set up one course and the student just take the sco for the 5 labs they use and have CP5 report to the LMS which labs security requirements the student took and if he'd passed or failed each labs quiz. Currently we are using the aggregator function in CP5 to build the courses from the database.
    Thank you,
    Susan

    >1) I don't think a SharedObject.flush is synchronous.
    I believe it is, as long as you're not attempting to write
    more data than the user has set for the Local Storage limit.
    http://livedocs.adobe.com/flex/3/langref/flash/net/SharedObject.html#flush()
    You'll note that flush is described this way: "Immediately
    writes a locally persistent shared object to a local file", and if
    it returns "SharedObjectFlushStatus.FLUSHED" that means that "The
    shared object has been successfully written to a file on the local
    disk". So I'd say that the normal operation of flush() is
    synchronous. However, the SharedObjectFlushStatus.PENDING state
    means that we've exceeded the limit set by the user, and are
    waiting for them to allow or disallow it. I believe (strongly) that
    that's the only case in which a netStatus event is sent.
    Do you read this differently?
    As far as multiple SWFs running as cooperative or preemptive
    multitasking processes, I'd really like to know the answer, but it
    probably doesn't matter. The more I read and think about this, the
    more it seems to me that Adobe has to prevent simultaneous reads
    and writes to a single Shared Object from taking place, as one use
    of it that I've read about is to share data between SWFs. For
    example:
    http://www.devarticles.com/c/a/Flash/Communication-and-Security-with-the-Flash-Communicati on-Server/1/

  • Sharing SharedObjects between multiple .swfs

    Relatively simple problem; I have a project that I think may be more manageable if I break it up into multiple small .swf files rather than having a gargantuan mega .swf.
    Now, I know that I could use a root .swf and load data from the others, but I think that it'll be a lot easier to debug and update if I'm using separate self-contained .swfs, so this is the direction I'm currently investigating.
    However, the .swfs won't really work unless I can have user-data persist between them, so I'm wondering if I can load a SharedObject saved by another .swf file? Are there any important caveats that I need to be aware of?
    In particular, can anyone give me sample code that would allow me to do this with both an online and offline copy of the files; i.e - if I run the same set of .swfs from haravikk.com, and locally, I want them to still be able to share data with one-another. In this case though I won't need to worry about sharing data between a local copy and haravikk.com, just so long as the files themselves can pass data within whatever domain they're loaded it should be fine.

    To do this I still need to make sure that all .swfs are retrieving/flushing their SharedObjects to the same domain though, right?
    I'm curious, is there a good way to work out what the right domain is dynamically?
    For example; say I have "Menu.swf", and "About.swf", both store in the same folder "MySite", so the files are located at "MySite/Menu.swf" and "MySite/About.swf" respectively. To avoid tying the files to a particular domain-name (so it can still work offline) I'd like to grab the current location of the .swf, and remove the file-name so that I have a domain containing just the enclosing folder.
    Is there a best way to do this? Basically so I can have my .swf files using a consistent domain for storing/saving, while still supporting relocating the files, so they will work offline if I copy them to my local machine for example.

  • Are Cross Domain Flash Local Shared Objects (LSO aka Flash Cookie) possible

    Hi,
    I found several solutions for creating Flash LSOs from JavaScript (for example: http://www.nuff-respec.com/technology/cross-browser-cookies-with-flash )
    If Page (www.hostA.com/index.html) and the .swf file are from the same site, everything works fine.
    Now I'm trying to load the page form www.hostA.com/index.html, which includes www.hostB.com/flashcookie.swf (different sites). But then I cannot read or store the LSO.
    I have tried several configurations (crossdomain.xml,  Security.allowDomain("...") ), but nothing works.
    Is this kind of cross domain access to a LSO possible?
    Can a flash based advertisement delivered by a 3rd party save a LSO on my disc?
    Thanks
    -stephan

    I 100% agree!  We have an application that the Government requires information to be stored on the users computer as part of Multi-Factor-Authentication.  We originally wrote it as a browser application and when everyone and their brother started deleting browser cookies because of security concerns, we totally re-wrote it as a Flash application to take advantage of permanent storage.  This new "feature" in Flash Player is causing much concern because thousands of users will need to start answering lots of security questions every single time they use the application (ie: daily) and our staff is having to handle technical support questions that shouldn't exist.  Right now it's only IE that's causing the issue, but I'm sure every browser and Internet Security program will soon be adding this to their products.  There should at least be a way for the USER to white-list a specific Domain so Flash could exempt those sites from ANY external program trying to delete ALL Shared Objects/Local Storage/Flash Cookies.  The USER should be given that choice.  This would satisfy the extra privacy you are putting in there and still allow information to be stored from sites that require it.
    John

  • Where does flash stores the local shared object data

    HI All,
    I'm using shared object to store local data:
                    var so:SharedObject = SharedObject.getLocal(storageName);
                    // Store the data
                    so.data.userName = userName;
                    so.flush();
    Where does it actually saved on my hard disk (in windows vista operating system).
    10x,
    Lior

    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=lsos_087_3.html
    The term local refers to the location of the shared object.
    In this case, Adobe Flash Player stores the SharedObject file locally
    in the client's home directory.
    When you create a shared object, Flash Player creates a new
    directory for the application and domain. It also creates an empty
    *.sol file that stores the SharedObject data. The default location of
    this file is a subdirectory of the user's home directory. On Windows,
    this directory is the following by default:
    c:/Documents and Settings/username/user_domain/Application Data/Macromedia/Flash Player/web_domain/path_to_application/ApplicationName/objectName.sol
    If you request an application named MyApp.mxml on the local host, in the Flex context, and within a subdirectory named /sos, Flash Player stores the *.sol file in the following location on Windows:
    c:/Documents and Settings/username/user_domain/Application Data/Macromedia/Flash Player/#localhost/flex/sos/MyApp.mxml.swf/objectName.sol

  • Director Flash 8 xtra breaks shared object and onSync

    This one has driven me insane for days, but at least now I
    know what the problem is. It's really a Director-Flash8 xtra-FMS
    problem, but I figure the best chance for a solution is posting it
    here.
    The problem is this: The Director Flash 8 xtra update messes
    up remote shared object connections to FMS applications. The
    Management Console debugger does not show any SO properties ("no
    data"), and only the "clear" onSync event fires. The old Flash 7
    xtra worked/works fine. To illustrate, I've tested the following
    code in the Director message window with both the v8 and v7 xtra
    (if you know Actionscript and not Lingo, it's still easy to figure
    out what happens here). It basically creates and connects a remote
    shared object on FMS:
    rrr = newObject("SharedObject")
    nnn = newObject("NetConnection")
    sss = "rtmp:/apptest01" -- app on locally running FMS
    er = nnn.connect(sss)
    put er
    -- 1
    fff = rrr.getRemote("tester", nnn.uri, true)
    put fff
    -- <flash object>
    er = fff.connect(nnn)
    put er
    --1
    -- so it's all good until here. onSync callback works with
    "clear", etc, but...
    fff.data.foo = 55.5
    put fff.data.foo
    -- 55.5... but only shows in Mgmt Console when using the v7
    xtra...
    -- when using the old flash7 xtra,
    -- debugging the FMS app and onSync events works correctly,
    -- but when using flash8 xtra,
    -- debugging the FMS app shows "no data" for this shared
    object. foo = 55.5 should be there.
    -- also, onSync events no longer fire after the initial
    "clear".
    If I translated this into actionscript and ran it in Flash 8
    vs Flash 7, etc, would I get the same problem? I'll try that next,
    but it took me a while to get this far. Is it simply a matter of
    permission or firewall setting? Or is it something just broken with
    the Director flash 8 xtra?
    Thanks

    As of just last week, Adobe can replicate the problem and is
    "working on it". I don't anticipate a shockwave-flash-xtra update
    to come out of this, but perhaps they can identify some other
    work-around. If you can avoid using "success" onSync events and
    don't need shared object debugging, then FMS works with
    Director/Flash 8 xtra... but this may be a symptom of yet more bugs
    that I haven't seen.
    I'm stopping development on my FMS/Director project until
    this is resolved... I may need to crack open the old Multi User
    xtra.

  • Shared Objects and IOS 5.0+

    So, I need a straight answer. Can I use Shared Objects for my game, or will apple fail me for using them?  Will Shared Objects be backed up with iCloud?
    Thanks,
    diss.

    Boat,
    From what I have found if your IPA/APK/SWF is the same name then shared objects data should retain.
    So if version 1 of your app was
    AppleApp.ipa published from a swf by the name of AppleApp.swf
    then when you update on your final publish save your swf and .ipa under the same name
    Dont do this
    First version is
    AppleAppV1.swf published out to AppleApp.ipa
    Second version is AppleAppV2.swf published out to AppleApp.ipa
    The swf is what the shared object is associated with so keep that the same from update to update.

  • One shared object among multiple applications

    How would I enable a shared object to be used by more than one game? I have tried doing SharedObject.getLocal("ID","/"), but they still seem to have seperate shared objects, both of these applications have seperate domains (com.domain.app).

    try it.  but i suspect those will look like different domains.
    you could use:
    com.mydomain.games/game117 for your game117's main swf
    and
    com.mydomain.games/game2245 for your game2245's main swf

  • Shared object and different application servers - how to resolve this issue

    Dear SDN Members,
    We are occuring a big problem. We create a shared object in a program and after we call in an another one. In central system architecture, it is working well. But on a distributed architecture (4 application servers), we have a dump some times. In fact, the read of the shared object can be occured in the AS 4 but the share object has been created in AS1.
    How to manage this problem to avoid this dump ?
    Dupplicate the shared object in the application servers ?
    Encapsulate different calls with RFC link to only one AS ?
    Any parameters on server or share objects ?
    Thanks a lot for your help,
    Points will be given to right or good answers.
    Br,
    Aurélien

    What is the dump you are getting ?
    AFAIK, "Shared Memory"(SHM) is an area defined in the app server. I am not sure if you can access SHM of a different app server (as in your case trying to access SHM of AS1 from AS4). [http://help.sap.com/abapdocu_70/en/ABENSHARED_MEMORY_GLOSRY.htm]
    In this case you can opt for "DataBase Clusters". Relevant ABAP statements: [IMPORT|http://help.sap.com/abapdocu_70/en/ABAPIMPORT_MEDIUM.htm#!ABAP_ALTERNATIVE_4@4@]/[EXPORT|http://help.sap.com/abapdocu_70/en/ABAPEXPORT_DATA_CLUSTER_MEDIUM.htm#!ABAP_ALTERNATIVE_4@4@] FROM/TO DATABASE.
    Hope this helps.
    BR,
    SUhas

Maybe you are looking for