Flash :: Dictionary In Sync With A Local Shared Object?
Mar 22, 2011
In one of the classes in my Flex application I have a dictionary, which is periodically updated from other parts of the application. It contains some sort of user preferences and I want to keep it in sync with a local shared object - the dictionary needs to be read during the class initialization and saved to the local storage when an element is changed, added or deleted.
The "Dictionary" object inherits only "Object" and does not have a change event - like the "collectionChange" in ArrayCollection. So I can't sync the dictionary just by listening for an event and manipulating the shared object in the event handler. The other possible solution would be to make the dictionary private and manipulate it using special methods in my class. Something like:
public function setValue(key:String, value:String):void
public function getValue(key:String):String
public function delValue(key:String):void
But using bindings will become a real nightmare and I will have to make changes in many other parts of the application.
View 2 Replies
Similar Posts:
May 10, 2011
I have a Flash.exe projector that stores data in a Shared Object. Anything works fine if I launch it from my desktop. The Flash.exe will be recorded and used from a CD-rom. Will the path of the Shared Object change? Say, will it try to record itself on the cd?!
View 1 Replies
Jan 18, 2011
I am looking for a way to edit .sol-files (LSO/Local Shared Object). I have tried searching quite a bit, but I have not been able to find any program that can edit AS3-files properly. Is there a solution for me out there?
View 4 Replies
May 12, 2011
i have prepared a login screee. using shared object i have saved username and password, now i want to know the sol path. Is there any way to actually retrieve the shared object local path.like C:Documents and Settings[userName]Application DataMacromediaFlash Player#SharedObjectsXXXXXlocalhost ext.sol
View 1 Replies
Dec 19, 2011
I'm having trouble connecting to a remote persistent shared object. When I run from the Flash authoring environment it works. But when I run it from a browser it doesn't. The code attaches an event listener to the sync event, and then calls so.connect(nc).
As mentioned - it works inside Flash authoring only. In both cases the connection to the server is successful. I also tried setting client.readAccess to "/" in the application.onConnect function of the server-side code - but it doesn't help. (Everything was written by me including the server-side application code. I have full control and access to the server).
Also, I can see the remote object exists on the server in the admin console.And as mentioned, when running inside Flash CS5 - the onsync gets triggered after connecting to the shared object.But, the same code under a browser - doesn't trigger the onsync.The SharedObject.getRemote method on the client side returns an object on both occasions.
View 1 Replies
Jun 8, 2004
!--Does anyone know if it possible to save the local shared object(.sol) file at a desired location or to embed it within the flash movie?
2--Is it possible to create an image file at runtime from a flash projector file?
View 1 Replies
Jan 28, 2010
Does anyone know if it's possible to save and access a LSO from an EXE projector on a CD?
Obviously the LSO couldn't be saved on the CD itself - would it be able to save the LSO somewhere on the users hard drive?
View 4 Replies
Oct 13, 2010
I am building an application that uses a Shared Object that is shared (ironically) between 3 separate applications. 1 application listens for updates, and the others update the app. The problem I am having is that I need the main application to be able to detect changes to the Shared Object. Unfortunately there seems to be no events to listen for that are not for 'remote objects'. Because of this I created a timer that gets a new local instance of the shared object every X seconds.I just call the following before I read or write to the sharedObject:[code]This is causing a CPU Hiccup every 3 seconds and bogging down the system. so all this being said, does anyone know of a clean way to refresh a copy of the sharedobject without creating a brand new instance of it
View 2 Replies
Sep 16, 2009
read a local shared object with a servlet even if there is no flash present on a page? I want to set a local shared object like a cookie, and then access it again from a page that doesn't have a flash movie.If I can't do this, is it standard to have the initial flash movie call an external javascript to set a traditional cookie that can later be read?
View 1 Replies
Dec 2, 2009
What are some possible reasons that an LSO will not update/store information when nested within an IFRAME nested in another IFRAME?The mark-up structure was not determined/dictated by me.
View 0 Replies
Oct 3, 2010
I have begun to use Local Shared Objects in my projects but i appear to have got a bit stuck. To be more specific, i have two input fields, first and last names, the user enters his/her first and last names into these fields, the user clicks the "Save details" button and the Local Shared Objects are then set to remember the two names. The text above the first and last name fields change from "Welcome guest" to "Welcome, First Last!". So at this point the whole system works.
The point at which the code fails to work is when the user navigates away from the page where he/she entered the first and last names. The user then returns back to that page and the Local Shared Object has been set to the two input fields which are now blank because of the scene change. The Local Shared Object is set to nothing but is still accepted as a variable and thus makes the text above the two text fields display "Welcome, !".
I understand that what i just wrote may appear a bit compicated, but what i am essentially needing to find out is how to set the Local Shared Objects to the two input values only once when the "Save Details" button is clicked, instead of constantly checking the values of the inputs and changing the Local Shared Objects.
In code:
Code:
save.onRelease //only do this once// = function() {
first_name_txt.text = name_details.data.first_name
last_name_txt.text = name_details.data.last_name
}
View 2 Replies
Oct 4, 2007
Alright, so I have a projector application running, and an SWF on a server. The projector loads the SWF on the server.The projector will save all of the sharedobjects it creates in the local-host folder, whereas the swf on the server will store it in it's own folder "or example. I want to be able to have them both store shared objects in the same folder, so that they can interact with each other through shared objects. Even if I load the SWF from the projector, it still creates it's own folder.
I need to have this because it stores level data for a game I'm making, where all the levels are on the server, and you can download each one individually, and make your own levels, and upload them, so others can play. The data would be loaded from a swf on the server, and then create the S/O on the users computer. Then, the actual game would load this SO and then create the map, based on the data.
View 1 Replies
May 3, 2011
Do you see anything wrong with this?
PHP Code:
package import flash.net.SharedObject; import flash.display.MovieClip; public class Example extends MovieClip var currentStage:int;var SOData:SharedObject; public function Example
[code].....
View 3 Replies
Oct 10, 2003
I would like to know how to save more than 1 score into the text file and not overwriting the previous score so that it can be displayed in the high score list...I'm not sure how to write the array and where to write itwrite a sample code of for example getting 3 scores, saving it and displaying it in the high score board ?
View 2 Replies
Jan 19, 2009
I am facing a problem in accessing Local shared object from 2 diff. swfs. Let me explain the scenario clearly.I am developing a radio widget (in maindomain.com for ex)which has a button to open a html page (placed in contentserver.com) as a popup with specific wt and ht. The html page loads the same SWF file of radio widget from "maindomain.com", means whatever changes we do for the SWF in maindomain will be reflected automatically in the popup also.Here where the problem is:
1. Say I am playing radio station "A" in main window and added this station to favourite list (which is done by storing in Share object). So when i open the popup its reflect there.
2. Now when i change radio station "A" to "B" in the popup and added "B" to favourites and closed the popup.
3. When I refresh the main window, I can get both "A" and "B" in fav, as expected.
4. But if without refreshing in main window when I changed to some new station "C" and then open the popup, it has got only radio station "A" in the fav list.
I am pretty sure this is because of Sharedobject.flush(). The thing I am wondering is, why the station "B" which is also pushed to sharedobject when added to favourite is getting deleted when I flush() the SO.?I googled many forums but not satisfied solution for this. Even I tried to get the Sharedobject.getLocal("SO","/") every time before using data in it. but no use.Is it a Flash limitation accessing LSO from diff SWF?
View 4 Replies
Jan 28, 2010
I need to make a local shared object (or javascript cookie function- below) that I can use to calculate the time since an ad was last loaded. It's an expanding ad, and I only want it to expand once every 2 hours. (Trying to keep the expanding-annoyance to a minimum!) I understand the basics of creating an "lso" but the action script for retrieving the time, placing it as a variable in the lso, and later retrieving it to figure the time is well beyond me. I considered a normal browser cookie, set to delete after the session, bypassing all time calculations... Forcing javascript to create a cookie ONLY when flash tells it to (after the ad has expanded) is tripping me up and creating a function to check for the cookie on the first frame to decide whether or not to continue is also beyond my simple animation skills.
View 0 Replies
Oct 30, 2005
can a shared local object (.sol) store nested arrays? like:
myArray = new Array([a, b, c], [1, 2, 3]);
View 5 Replies
Aug 28, 2007
I am trying to have a local shared object in flash to detect whether a user is a new user or a returning user. If they are a new user I want to do newUser function and if they are a previous user I want to do a previousUser function. This should all be happening on an onEnterFrame.
Here is my code I have so far:
//shared object - cookie
newUser_test = SharedObject.getLocal("newUser");
newUser.text = newUser_test.data.title = "new user";
newUser.text.onEnterFrame = function () {
newUser.text = "new user";
} newUser.text.onEnterFrame = function(){
newUser.text = newUser_test.data.title = "previous user";
newUser_test.flush();
}
View 3 Replies
Dec 8, 2009
I'm playing with Local Shared Objects, and I was able to save and load simple data types like strings and integers. Pretty cool.
I want to Save/Load a Bitmap Object but I'm having problems. I think I got a Bitmap Object to save but when I loaded it back in, it was basically a blank bitmap. I located the actual .SOL file on my computer and opened it up. It had some basic Bitmap info like scale, rotation, visible, width, height, etc, but NOT the actual bitmap.
So I realized that I need to be saving/loading a BitmapData object instead of just Bitmap. BitmapData holds the actual bitmap pixels, I think. Anyway I saved out a BitmapData object. When i tried to load it back in, I get a type coercion error: "Type Coercion failed: cannot convert Object@df355b1 to flash.display.BitmapData". I dont get it because this error didnt occur for Strings, ints, or Bitmap Objects. Whats happening?
Also, I looked again at the .SOL file after saving out the BitmapData object, And I dont see any pixel data there. The bitmap I'm saving is 800x800 so the .SOL file should be pretty big but its just a tiny file so I know the pixels havn't been saved properly.
Here is the code I'm using (Simplified - error handling removed, etc)
Code:
// save
var mySo:SharedObject = SharedObject.getLocal("mysharedobjecttest");
mySo.data.testA = 14;
mySo.data.testB = "hello this is a test";
[Code].....
View 14 Replies
Mar 14, 2011
I am trying to write a piece of code to retreive data from a SOL file : this is my code :[CODE]//get External interfaceimport flash.external.*;
[Code]...
How can that be ? what can I do ? What am I doing wrong ?(bear with me, as I said, I'm kind AS newbie).
View 4 Replies
Jun 8, 2004
!--Does anyone know if it possible to save the local shared object(.sol) file at a desired location or to embed it within the flash movie?
2--Is it possible to create an image file at runtime from a flash projector file?
View 1 Replies
Mar 26, 2008
I am programming a web based application with Actionscript 2.0 classes for flash 8, and I want to save user data using the local shared object.As the data is potentially rather complex I would prefer to store it in an instance of a custom class that I then stick in an array property of the local shared object data property.However, when I try to do this, if I retrieve the stored object it seems to have lost all its instance methods. If I do a for in on it, I can see the private properties to which I have assigned my data, but as they are private I cannot retrieve them.how I can store an instance of a custom class in a local shared object without it being corrupted in this way?
View 4 Replies
Oct 29, 2010
I am encountering a problem in my app only when it is run in flash player 10.1.85.3. Some earlier player versions I have tried are working fine.From what I can tell it seems related to the following:
Quote:
from here: h[url].....
When searching for objects (not strings) in Dictionary objects using the 'in' operator, if the object is not found in the Dictionary object, it will be searched for in the delegate objects. With 10.1, the toString operator will be called on the Object if not found in the Dictionary. This can cause problems with Proxy objects who need to define the callProperty function or it will generate a RTE. ...what it means "it will be searched for in the delegate objects"?
View 1 Replies
Mar 13, 2009
I created a very simple experiment to attempt to access the same shared object in Flash Player and AIR.
A Flash SWF creates a local shared object.
A AIR application (being tested from CS3 or installed) opens the same shared object.
The data does not persist. Is this theoretically possible?
View 1 Replies
Jun 4, 2010
case: user clicks button and flash goes frame 2 what I want is that flash knows, that user has pressed the button once earlier. So flash goes straight to frame 2 if th user refresh the page. I ques I have to do this with local shared objects? How do I do it? Or should I use php/javascript?
View 8 Replies
Nov 17, 2011
So I am writing a program which uses Dictionary to store objects. For example
var dictionary:Dictionary=new Dictionary();
var myObject = new myObject(var1, var2, var3);
dicionary["key"]=myObject;
where var1, var2, and var3 are simply means of assigning values to variables in myObject.can I access values or functions that are found in myObject? In myObject class I have some getters and setters. Can I use a getter to get the value of var1 for example.
dictionary["keys"].getVar1()?
View 1 Replies
Nov 25, 2010
There is a small feature I have implemented that makes uses of the Local Shared Objects to work properly.
I wish to be able to help the user self-diagnose if he is unable to use the said feature because he refused access for this computer to writing local shared objects and give him instructions to work around the issue if it applies to him.
I'm looking for something similar to the muted property of the Microphone class [URL] or the Camera class.
View 1 Replies
Jul 23, 2006
Is it possible to set the local storage limit for shared objects using action script rather than the Flash Player context menu?
View 2 Replies
Mar 1, 2011
I'm often seeing others using a Dictionary object in their AS3 code that simply maps objects by String keys and wondering if there is any advantage at all of using a Dictionary over a simple Object if String keys are used. Anyone know any details on this? I would suppose that since an Object is more lightweight it should be faster and preferable over a Dictionary if used with String keys.
View 1 Replies
Mar 17, 2011
This is the accompanying thread for the tutorial "Loading a different image each time using Local Shared Objects".Here you can post comments, questions and suggestions related to the tutorial.If it's not completely related to the tutorial, please start a new thread.You may subscribe to this thread (in the "Thread Tools" dropdown menu) in order to receive a notification when the tutorial goes live.
View 1 Replies