Flex :: Storing Instances Of Classes In Shared Objects

May 26, 2010

Is it possible to store instances of a class in a cookie or in shared objects.

Basically in my application I have an object "Diagram" that the user can create. If they hit save, I want to store the current instance as a cookie and allows them to reload it later.

Alternatively, I could see about getting them to store the saved version on the hard disk. But even then, all I want to save and retreive is my actionscript object.

I've tried storing the object to SharedObject.data.diag, but when I try to retrieve the object from the cookie doing SharedObject.data.diag as Diag returns null.

View 1 Replies


Similar Posts:


Actionscript 3 :: Storing Array Of Custom Classes In A Locally Shared Object (LSO)

Sep 22, 2011

I am having problems storing an array of objects, all of which are the same custom class in an LSO and then reloading that array from the LSO without losing the class type of the objects in the list.

I know how to store a single object of a custom class and load it withe the correct class type using the registerClassAlias() function, but I cannot seem to apply this to arrays of objects.

I am trying to save an array called messageList. Each element is a custom class GameMessage with a property called gameLevel. After I load the LSO I am trying to do something like

trace("0th message is from level " + GameMessage(messageList[0]).gameLevel);

And I am getting an exception of like this:

TypeError: Error #1034: Type Coercion failed: cannot convert Object@90fdfa1 to GameMessage.

I have registered the GameMessage class using

registerClassAlias("GameMessage", GameMessage);

and everything works if rather than a list of messages I try and save/load a single message.

View 1 Replies

Flex :: Architect Extended Cairngorm Classes To Be Shared Across Applications?

Jun 5, 2009

I have created a few Event and Command classes for use in my Cairngorm projects.For example, I created an class that extends URL... that allows me to set callback functions upon completion or failure of the corresponding Command. To accomplish this, I also had to create a new Class that implements com.adobe.cairngorm.commands.ICommand that I extend for all Commands in my projects.Now, I want to use these two classes across all of my Cairngorm applications. What is the best way to do this? Should I just edit the Cairngorm source for CairngormEvent and ICommandand recompile the Cairngorm MVC (is that even possible)? Or add my two classes to the Cairngorm source and recompile the Cairngorm MVC? Or should I just add them to a shared library?I've chose the third option for now, but this requires that I reference the Cairngorm library in both my library and each project. I am wondering if there is a better practice and what the benefits are.

View 1 Replies

ActionScript 3.0 :: Storing Dataprovider In Shared Object?

Mar 31, 2010

I'm having trouble storing a dataprovider in a shared object. Writing the dataprovider object to my local shared object seems to work fine, but when I try to read this out of the shared object, it appears to have been transformed into a generic object. When I try to assign a local dataprovider variable to the dataprovider I've read out of the shared object, I get the following error:
 
"cannot convert Object@3721e6c9 to fl.data.DataProvider"

View 7 Replies

Flex :: Understanding Remote Shared Objects?

Oct 20, 2009

I have 2 questions about remote shared objects in Flex/ActionScript3:1) If I connect to a remote shared objects, but do not handle the SYNC event, will the shared object still receive data from the server? ie. will the server still broadcast data to this client ? This is what I expect

View 2 Replies

ActionScript 3.0 :: Storing Data Locally Not In Shared Object

Jul 9, 2010

I need to store data locally (not in shared obj), can I write xml file directly without dialog box or any other methods..?.

View 2 Replies

Flex :: What AMF Servers Support Remote Shared Objects

Mar 29, 2010

I'm planning on building a Flex based multiplayer game, and I'm researching what will be required for the server end. I have PHP experience, so I started looking at ZendAMF.

Now in this game, I'll need the concept of rooms, and real time updates to clients in those rooms, so it looks like I'll be using remote shared objects (correct, yes?). I'm not seeing where ZendAMF can support this.It seems to indicate that ZendAMF isn't going to do what I want. WebORB for PHP seems to be the only PHP based solution that does messaging, but on that page it doesn't mention "real-time" next to it like the Java based ones below it do.

View 3 Replies

Flex :: Know If The User Allows Storage Of Local Shared Objects (LSO)

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

Actionscript 3 :: Shared Objects Not Working Correctly In Flex - Mobile

Apr 11, 2012

I have a very simple test going with shared objects in flex with mobile I have a person class.

package
{
import flash.display.MovieClip;

[Code]....

If I clear out the so it show the [object Person] again, but comment out get the ,,,

Can shared objects even store an array of objects properly. It is the same with the persistanceManager I believe.

View 1 Replies

Flex :: Clear Shared Objects When Browser Closes Abruptly?

Jun 7, 2011

How to clear the shared objects when user closes the browser abruptly?If the user opens the same application in two tabs, and user tries to close any one of the tab, we have to listen only the closed tab event.

View 1 Replies

Flex :: Flash Shared Objects Storage Location Changing Occasionally?

Feb 15, 2011

When running a flash application that I run locallyie I get to it from a browser but with a file pathNow, most of the time the shared objects are stored in%APPDATA%MacromediaFlash Player#SharedObjectsXXXX#localWithNetBut occasionally, it reverts and thinks this application is running on localhost%APPDATA%MacromediaFlash Player#SharedObjectsXXXXlocalhostwhich means all previous saved settings are gone.I'm wondering if anyone knows how flash decides if the application is infact localhost or localWithNet (local with Network access)

View 4 Replies

Flex :: Flash Shared Objects Storage Location Changing Occasionally

Jul 3, 2011

When running a flash application that I run locally i.e., I get to it from a browser but with a file path
file:///C:/Projects/test/bin-debug/Main.html#

Now, most of the time the shared objects are stored in
%APPDATA%MacromediaFlash Player#SharedObjectsXXXX#localWithNet

But occasionally, it reverts and thinks this application is running on localhost
%APPDATA%MacromediaFlash Player#SharedObjectsXXXXlocalhost
Which means all previous saved settings are gone.

How flash decides if the application is infact localhost or localWithNet (local with Network access). Rebooting can sometimes make it revert, but I've also had it stay localhost for a few days then revert.

View 1 Replies

Actionscript 3 :: Understading Flash / Flex Shared Objects And Hashing Technique

Jan 24, 2012

I was trying to observe how some of the top browser game makers are implementing the asset management and also study their animation techniques. So I was trying to crack my browsers cache and share-object paths to peep into the assets.What I have noticed is that all the files are hashed or encrypted with unreadable names and all of them have .sol extension example somethingbigandunredable.png.sol or somethinglesebigandhugtring. swf.sol and so on.I thought they are just suffixed with .sol and just removed the .sol and tried to open the png but its neither showing the previw nor opening in the browser. Same with the swf file.So I was wondering if there is any way to peep into their assets. I am aware of swf decompiler tool (currently using) which can extract only the unecrypted swfs.

View 1 Replies

ActionScript 3.0 :: Storing Multiple BitmapData Instances

Aug 3, 2009

I have a question about optimum resource management. So I am pondering what would be the most efficient way of storing a LARGE number of BitmapData instances in a SWF. The BitmapDatas would be generated at runtime. Only a minority of the BitmapData instances would be on screen at any one time. So far I've conceived three routes; Option one (simply store them in an array - this is then stored in the RAM right?)

ActionScript Code:
var array:Array = new Array();
var bitmapData1:BitmapData = new Bitmapdata();
var bitmapData2:BitmapData = new Bitmapdata();
array.push(bitmapData1);
array.push(bitmapData2);
[Code]...

View 0 Replies

ActionScript 3.0 :: Storing Name Of Classes In Array

May 16, 2007

I am doing an AS3 application. In the beginning of my AS file, I need to embed different textures as the following:
Code:
[Embed (source = "./myImage1")]
public var Image1:Class;

I have to embeed n bitmaps. Then I have to create an instance of each oh thease classes.
I want to store the names of thease classes in an array so I will be able to create an instance of a class by accessing the array.

Something like this:
Code:
var arrayOfClasses : Array = new Array();
arrayOfClasses.push(Image1);
arrayOfClasses.push(Image2);
...

Then I want to go through the array and do :
Code:
var variable : Object = new arrayOfClasses[0];
But this dosen't work! How Can I build an array of classes? Is it doable?

View 5 Replies

ActionScript :: Flex : Mapping Objects To Classes?

Jun 16, 2009

If I've got a bunch of plain old Objects, what's the best way to map them to a bunch of Classes?For example, if I use an HTTPService to pull in some JSON, then deserialize it, I'll have a bunch of objects which look like:

{ type: "person",
id: 42,
name: "David" }

And I want to turn them into instances of a Person class:

class Person {
id:int;
name:String;
}

(also to be considered: how about some standard way of dealing with relationships between objects? For example, if the Person had an additional "spouse" field:

{ type: "person", spouse: 61, ... } // Where 61 is the ID of the spouse
)

View 2 Replies

Flex :: Class - Create Own Classes / Objects?

Dec 7, 2009

When I try to do this in an AS CDATA block, it tells me I can't have a class declared within a class (the MX:Application itself). Makes sense. But where and how do I do it?

View 2 Replies

Actionscript 3 :: - Access Objects Instantiated In Flex App's MXML File In Other Classes

Jul 29, 2011

I've got an object declared and instantiated in my Flex application's singular MXML file: public var CDN:CDNClass = new CDNClass; I would like to access this same CDN object (and its public methods and properties) in another class declared in a separate .as file as such:

[Code]...

But when I try to access the public method parsePlayList in the CDN object in a method in the class defined in the .as file, I get the following error: Access of undefined property CDN The reason I want to do this is to break up the logic of my application into multiple AS files and have minimal MXML files, probably only one.

View 2 Replies

Actionscript 3 :: Central Event Dispatcher Shared Between Instances (not Static)?

Aug 22, 2011

I'm building a flash app (just AS3 with FlashDevelop) and I'm having some trouble keeping things loosely coupled around the event system. I've done a lot of reading about central event systems and static eventdispatchers but they don't quite fit the bill for me. What I'm building is similar to a video player.I have a Player class which is the parent of all the other little parts of the app.The Player class extends Sprite and I've currently designed it so that you could instantiate multiple Player's and put them on the stage.I also have a Controller class which extends EventDispatcher and I dispatch all my events through this class. It's a central event class.

The problem is that I need to pass around a reference to this class so that all the other classes can dispatch and listen through it. Passing around the reference works but it's the exact opposite of loose coupling. I know I could make a static EventDispatcher that all the classes could see but then if I had two or three Player's on the stage they would all hear each others events.How can I create a type of sandbox that will allow all the child classes of a Player instance to be aware of the central dispatcher without passing a reference or making it static?

View 1 Replies

Loading Objects And Dragging Objects To Create New Instances?

Sep 22, 2009

I want to create a flash movie which firstly loads a selection of images/objects into a portion of the frame. After this is complete, the user can then drag these objects onto another area and the object will be created where the user has chosen. The user can then drag another instance of the ojects onto the area.

For example, there is a background of a lake in one area. A selection of boat pngs are loaded in an area below the lake. The user can drag these boats and place them on the lake. They can drag a boat multiple times if they wish.

View 4 Replies

ActionScript 2.0 :: Static Classes Shared Across Multiple SWF's?

Apr 11, 2009

How do Static classes work in projects where child swf's use the same Static class as their parent?

For simplicity... lets say we have some older content swf files that are using TweenLite version 8 ( a common enough Static class.) But the parent SWF is being updated and uses a more recent version of TweenLite (version 10). The child SWF's are loaded into the parent SWF. Do the child SWF exist in there own sandbox and have TweenLite version 8 running and the Parent runs it's own copy of TweenLite 10? Or does the parents clips Static class of TweenLite (version 10) overwrite the children Static class using some sort of magical shared memory space when JIT (runtime) compiling?

View 3 Replies

ActionScript 3.0 :: Runtime Shared Library Store Classes?

Sep 19, 2009

working a project that has 9 swf.a lot of the swf are using the same classes like papervison and tweenlite.is there a way to store classes like papervison in a share library?

View 1 Replies

Professional :: Loading External Swfs Extending From Classes In The Same Shared Codebase?

Jul 25, 2011

I'm currently developing a game in flash and want to be able to divide up my .fla assets in a way that means artists can work on a game menu .fla in isolation from the game.fla and rest of the game code.If I could briefly explain how I've approached this so far, I would be extremelyMy project is setup like this:HighScoreMenu.fla -> document class HighScoreMenu extending GameMenu class.game.fla ->document class game.asgame.as class loads the published HighScoreMenu.swf and manipulates the menu i.e. animates on and off screen via inherited functions in the GameMenu class.

Now this seemed to work to begin with, until my code evolved and upon going to publish my HighScoreMenu.fla flash started complaining about symbols being used in Game.as that were in Game.fla... If I'm only publishing the HighScoreMenu which extends from GameMenu then why is it even looking to compile Game.as

View 4 Replies

ActionScript 2.0 :: How To Use Shared Objects

Feb 28, 2006

I had been wondering how to use shared objects for a long time and thanks a million to this mini-tut:url...I know how. The only thing is it says that to clear a shared object, you must type (used in his example) [code]but what if i wanted to delete a certain block of data on it, for example I have the shared object user.And i don't want to delete all of it, but just one block of data (specifically user.data.doc)[code]

View 5 Replies

ActionScript 1/2 :: Arrays Within Custom Classes - Different Instances?

Jul 13, 2010

I have made a very simple custom class for keeping track of groups of offices for a company. The class has a Number variable to tell it how many different offices there are, and an Array to store the individual offices by name. It looks like this.

class officeCluster{
static var _className:String = "officeCluster";
// variables var numOffices:Number;
var locationArray:Array = new Array();
// functions function officeCluster() {
trace("officeCluster constructor");
}}

Now, it is my understand that when I create different instances of the class, they will each have their own version of "numOffices" and their own version of "locationArray". When I run traces of "numOffices", this seems to be true. For example,
trace(manufacturingOfficeCluster.numOffices);
trace(servicesOfficeCluster.numOffices);
yields
5
4

In the output panel, which is correct. However, there is trouble with the locationArray. It seems that as I assign different values to it, regardless of what instance I specify, there is only ONE array- NOT one for each instance. In other words,
trace(manufacturingOfficeCluster.locationArray[1].theLocation);
// theLocation is a String. The locationArray itself holds Objects.trace(servicesOfficeCluster.locationArray[1].theLocation);

Is anyone aware of any issues partaining to using Arrays within Class instances? I've been able to work around this by creating multiple arrays within the class and using a different one for each instance, but this seems very sloppy.

View 4 Replies

ActionScript 3.0 :: Collision Detection Between Two Instances Of Two Different Classes?

Jul 18, 2010

Say I have a public class named "player" and a public class named "enemy". Instances of each have been added to the stage in the maintimeline.

How do you check a collision between these instances?

View 2 Replies

ActionScript 2.0 :: Possible To Instantiate Instances Of User Classes

Feb 22, 2007

I'm wondering, is it possible to instantiate instances of user classes in the same way as you can instantiate the Object class? For instance, assuming that Vector is a user imported class:[code]I've tried that syntax or similar, and it throws me a syntax error. Is there another way to word the same idea?

View 2 Replies

ActionScript 3.0 :: Document Classes And Library Instances

Jul 14, 2009

1. I've got a Main Document class, that loads external swf each with its own document class (they are pages and pieces of the site).

2. The Main class makes use of some movieclip simply instantiated from the GUI library. It all goes fine.

3. The external swf have references to the Main class, and here start problems: when I compile them, I get an error for every library mclip used by Main. See the attachment. A simple trace(Main) is enough to start getting all that errors.

A partial solution is to uncheck Strict Mode in publish settings

View 10 Replies

ActionScript 2.0 :: Calling MX Prototype Classes And Instances?

Jun 3, 2004

i'm rockin' with creating prototype classes, however, i've run into something i can't explain when i am trying to call my prototype classes--in this case, i have a prototype class called interfaceClass, which contains several class functions--i've also created an instance of the class, called 'ui':

interfaceClass.startGame=function(){
trace("startGame");
ui.resetGame();

[code].....

View 2 Replies

Using Same Shared Objects Across Multiple FLAs?

May 4, 2010

I am creating a small game for a project im doing it is only ten levels long but I wish to include feature such as saving etc. I have one some research on Shared Objects and it seems to be the best method. The idea I wish to execute is to have at the end of a level after reaching the levels goal have a piece of code that runs and saves that the next level has been unlocked. This seems relatively simple. However i have done things awkwardly i think, instead of creating the whole game within a single fla. each level is a seperate file, eg. level1.fla, level2.fla etc. Is it possible to use the same shared object across multiple .fla's?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved