Flex :: Deep, Generic Serialization Of Objects?
Jan 24, 2011
Is there any way, without having the creator of the object implement any special functions (no specific serialization functions) (however, they can use annotations), to have Flash serialize a generic, possibly deep (objects within objects within objects, etc, etc, etc) object?
View 2 Replies
Similar Posts:
Mar 4, 2012
I'm using Zend AMF to send my remote objects to Flex. I've defined a Constant class and created getASClassName() method. Then I've created Action script class in flex.
Objects are send successfully, but they are deserialized to generic Objects in Flex instead of specific ones. EDIT: On network monitor in Flex I can see that AMF value is set to com.my.project.valueobjects.Constant. Although array from event.result contains Objects.
[Code]...
View 1 Replies
Aug 4, 2011
I will try to give as much detail as I can. I am creating an CRM application using Flex(Cairngorm 2)/Java/Hibernate. The basic problem I am having is this: I have a Customer class in Java that has an ArrayList of Address classes. I have a Customer class in Flex that has an ArrayCollection of Address classes. When I make the remote object call for a Customer I get back a Customer object in Flex, but the ArrayCollecion objects have a data type of Object instead of Address. If I try to call for a List of Address classes I get the same result. If I try to call for a List of Customer classes I get a list of Customer classes in Flex. Using tomcat 6 with the following jars:
[Code]...
View 1 Replies
Mar 26, 2010
What is serialization support like for the new Vector class? I have a Vector.<GameMove> which I'd like to serialize into a ByteArray. GameMove is a custom class. I presume it's necesssary to call registerClassAlias() on GameMove, but do I also have to register Vector.<GameMove>? It's it it's own distinctive type, or is it kinda composed of those two types?
View 2 Replies
Jun 11, 2009
I'm using BlazeDS to remote some Java objects that I'm consuming in a Flex application. I'm getting a type coercion error with one of my classes that I can't for the life of me figure out. I have other classes that are working fine using the same data types, and I've gone over my mapping a dozen times. I'm following all of the necessary conventions for getters and setters as far as I know...
Anyhow, my question is: how can I debug this problem? Running the Flex app in debug mode spits out some generic errors to the console that don't really help much (TypeError: Error #1034: Type Coercion failed: cannot convert Object@5d1d809 to valueObjects.SomeClass.).
View 5 Replies
Apr 27, 2010
Is it possible to receive custom generic typed objects through AMF? I'm trying to integrate a flex app with an existing C# service but flex is choking on custom generic typed objects. As far as I can tell Flex doesn't even support generics, but I'd like to be able to even just read in the object and cast its members as necessary. I basically just want flex to ignore the <T>. I'm hopeful that there's a way to do this, since flex doesn't complain about typed collections (a server call returning List works fine and flex converts it to an ArrayCollection just like an un-typed List).
The custom C# typed class
public class TypeTest<T> {
public T value {
get; set; }
public TypeTest () {
}}
The server method returning the typeTest
public TypeTest<String> doTypeTest() {
TypeTest<String> theTester = new TypeTest<String>("grrrr");
return theTester;
[Code] .....
Irritatingly if I change the result handler to take parameter of type Object it works fine. How to make this work with the value object?
View 2 Replies
Jul 30, 2008
I just want to combine two objects and their properties together.
For instance if I have...
Code:
var appleObj:Object = new Object();
appleObj.type = "apple";
var orangeObj:Object = new Object();
[Code].....
View 5 Replies
May 14, 2004
Alright so... I really don't know the best way to approach this. I had a LOT of code that I thought could be generalized into a function. I don't know how to explian it... here is the code:i attached it...I know it's a lot of code... I just... I don't know what to do with it anymore! When it was in a bunch of small functions, it worked (sort of) just seemed reallly messy and annoyed me.Oh btw its causing the hero to jsut go to 0,0 and then a hit symbol appears there, and then nothing happens, the hit doesnt even dissappear.
View 7 Replies
Feb 3, 2010
want to simplify coding and wondered if there was a way to write a script that could be used on multiple objects without having to write it to address each object individually. I am building a simple menu where I want the menu link to rise and scale up when the button for it is rolled over and then return to its original position when the mouse rolls off. I know I can write this per button and per item, but wanted to see if there was a way to write it once and then apply the action to everything. EX. My menu consists of 5 items (and respective buttons) home_mc (home_btn), menu_mc, dining_mc, contact_mc, specials_mc.If I write the code
home_btn.addEventListener(MouseEvent.MOUSE_OVER, homeOver);
home_btn.addEventListener(MouseEvent.MOUSE_OUT, homeOff);
function homeOver(MouseEvent) {
[code].....
View 5 Replies
Oct 31, 2009
I am able to add key/pair data into the associative arrays, like;
Code:
var arrColors: Array = new Array();
arrColors.push({color: "aqua", code: "0x00FFFF"});
arrColors.push({color: "beige", code: "0xF5F5DC"});
arrColors.push({color: "brown", code: "0xA52A2A"});
// and so on
But, if I want to do the same with the array of generic objects, like;
Code:
var obj: Object = new Object();
obj["key"] = "value";
How can I add more data into it, because push() function does not seem working with this type of array.
View 2 Replies
Oct 31, 2009
I seek correction and guidancem from you experts, on the Associative arrays and the arrays of Generic Objects. I created the following working code and I believe it is an Associative array:
Code:
var arrColors: Array = new Array();
arrColors.push({color: "aqua", code: "0x00FFFF"});
arrColors.push({color: "beige", code: "0xF5F5DC"});
arrColors.push({color: "brown", code: "0xA52A2A"});
// and so on
Now, I want to create an array of Generic Objects for the same items, as below:
[Code]...
View 5 Replies
Jun 23, 2011
I've knocked together a Java/BlazeDS server which creates a generic GridBean object. This GridBean contains:[code]I then created a Flex app that uses a RemoteObjectServiceWrapper to call my java server, grab the GridBean, create some DataGrid columns from the columnDefs and then set the dataProvider as the list of objects. Ok so far, everything renders.Now, what I'd really like to do is: set up some kind of event handler on the flex side so that if my item/object is edited in the datagrid, I fire a message off to java saying 'edited this field on this item'. The end goal is to have a nice generic way to render any list of objects from Java in a flex datagrid.
View 1 Replies
Apr 9, 2010
I have been trying to test my application to make sure that all the important classes can serialize/reload themselves properly (especially those which implement IExternalizable):
[Test]
public function testMyObjectSerialization():void {
var myobj:MyObject = new MyObject();[code]....
And I would like to be warned when I try to serialize a strongly-typed object which does not have a [RemoteClass] set (because that almost certainly represents a bug in my code).So, is there any way to configure the AMF serializer to give warnings?Also, it seems like this might be possible using services-config.xml... But the documentation seems to imply that services-config is channel-level, and I'd really like it if my unit tests could run without talking to the server (and I'm not using LCDS, so a bunch of the services-config wouldn't apply to me anyway).
View 1 Replies
Aug 13, 2010
I have a Panel in my application which contains 2 buttons and 3 canvas components at certain posstions...now I want to store the current state of panel in some file or database...and afterwards I want to load the same panel again in my application when I come back and run the application. I tried to convert whole panel into ByteArray object using its readObject() and writeObject() methods...but when I read the ByteArray and add the panel in my application using addChild() method it doesn't add anything and there was no error or fault...
writeObject creates ByteArray that I am able to print but when i get it back and add child, I am not able to get the panel and it's children.
[Code]...
View 2 Replies
Oct 25, 2010
I recently came into a situation when sending a nested object from Java to Flex via a HashMap the Objects were null. More precisely:final Map< Integer, List<String>> tempMap = new HashMap<Integer, List<String>>();would send the keys as integers but the values were all null.But when sending the same with String keys:final Map<String, List<String>> tempMap = new HashMap<String, List<String>>();the objects came thru.Are there any restrictions in BlazeDS serialization when using complex types as keys?
View 1 Replies
Aug 31, 2010
I was wondering if it is possible to do custom serialization of Arrays/ArrayCollections in as3 via amf. To be more specific, i want to be able to pool objects on the client so that im not instantiating new objects every time i make a RemoteObject call. I tried using IExternalizable but that only lets me serialize the objects myself not instantiate them. The flash player is still instantiating objects itself and them letting me set the object state via readExternal.
View 3 Replies
Oct 26, 2011
I've been looking at various questions in StackOverflow and in other sites, but I have not seen a library that a) generates actionscript code given XSDb) serializes to and deserializes from XML using the generated classes. In Java world this is JAXB. I have a set of large XSDs, based on which a web service is producing XML output. I don't want to write actionscriptclasses by hand, that'd be huge piece of work. Having source code in actionscript since writing code based on runtime binding of xml/json to objects is much more error prone compared to having proxy like classes.
View 1 Replies
Jul 15, 2010
I'm trying to use the native flex serialization/deserialization process to save/load state of a workspace in flex. In order to save or load a file I have to use my servlet, which just bounces back the bytes from the input stream to the output stream. Here's a basic outline of my Flex code:[code]So my problem here is not with the saving of the workspace. That works great. My problem is with the loading of a workspace. The event.data that I write to the byte array is not reconstituted into a MyWorkspace object even though it is exactly what I wrote to the file.There has to be a way of making a MyWorkspace object from the data, but I can't figure it out.
View 2 Replies
Nov 2, 2010
How can I programmatically click the browser's Back button from within my Flex application. I'm using deep linking to allow the user to navigate back/forth inside my application. I want this to work when BACKSPACE is clicked inside the application as well, but Flex captures BACKSPACE and the browser doesn't get the event. I don't want to implement browsing history myself within the application, naturally. Can I send BACKSPACE to the containing browser?
View 1 Replies
Jan 1, 2010
The better you understand what you are doing, the better you will do it. I want to get Deep into Flex . I did some simple Event-Handling and The better you understand what you are doing, the better you will do it.
But i have i big question: What does the Compiler do ? What happens with the MXML file ?
lets say we have a simple code ( code from blogflexexamples):
[Code]...
View 3 Replies
Apr 12, 2012
Is deep copy possible in flex 4.5?
View 1 Replies
Jul 21, 2010
I have a Flex app I built. It uses the BrowserManager class to listen for changes in the # part of the URL. When a change is made to the hash my application updates accordingly so you can link directly to a state of the application. Also inside my programming when a user clicks something, all I do is use the BrowserManager to update the # and then my listener will apply the correct changes once its finished. I believe this is the best practice way to doing this in Flex.
I have some issues though. When using the Back button in FF or IE, it gets "stuck". for example if the hash is like #state4 clicking the back button will take you to #state3 then #state2 but sometimes get stuck where you can be on #state3 click the back button, see it flicker to #state2 real quick then change back to #state3 preventing you from going back any further in your history.
[Code]...
View 1 Replies
Aug 14, 2011
I want to handle multiple operations on a UI Component (button ,textfield, swfs,custom objects etc) in like scaling,skewing ,color,rotations etc etc and save them too. Earlier the actions were done
using a single tool and single mxml file but now the tool is separated into different tools. Was wondering how i can design / use something like Toolmanager class to handle actions etc?
Also the tricky part is that some objects can have more operations defined for them Like 'object1' has 3 operations that can be performed on it and 'object2' has 5 operations defined on it.
We are using MVC design pattern but no frameworks as such. What are the different design patterns that can be used to do this? Edit: To be more precise i want implement this in AS3 OO way.The application is similar to drawing application which supports addition of various images,text,audio,swfs etc. One added user can perform various operations of the objects..like adding color,scaling skewing,rotation etc etc and custom effects and after that export the drawing as PNG.Likewise some effects that are applicable to text are not applicable to images and vice versa. and some effects can be common.
View 2 Replies
Jul 12, 2011
I have a properties file called projecteditorsample.properteries located at /resources/ilog/en_US/projecteditorsample In Order to load the File from an mxml located at /src/modules/ilog/ I tried:
[Code]....
View 1 Replies
Aug 7, 2009
I have this bit of code, and it's not working as I expected. btnContainer is a VBox that contains a ton of buttons (toggle=true); and I want to reset them to un-toggled at a certain point.
for (var btn:Object in btnContainer.getChildren()){
if (btn.isPrototypeOf(mx.controls.Button)){
btn.selected = false;
}
}
With the above code, "btn" shows up as just the index during each iteration of the loop (0,1,2,3,...), and the conditional never evaluates to true.I also tried this:
for (var btn:Button in btnContainer.getChildren()){
btn.selected = false;
}
This works fine, except that there is also a label inside btnContainer; so it throws an error when trying to cast the label as a button.
View 2 Replies
Jun 14, 2011
As you all know, Vector support type checking by added Type parameter.
var v:Vector.<String> = new Vector.<String>();
I wonder if I am able to create a custom class that have Type parameter, something like this
var myClassInstance: MyClassDefinition.<String>;
View 1 Replies
Mar 27, 2012
I want to create a generic component in flex. This component deals with different ArrayCollections dynamically (I want it in that way). So I thought to pass the arrayCollection and the type of that arrayCollection as arguments to the component.
Like,
var list:ArrayCollection<ClassA>;
init_Comp(list, "ClassA");
If it is possible, I can read it like this,
var newDynamicInstatnce: typeOf("ClassA") = list.getItemAt(0) as typeOf("ClassA");
Finally I have a Dynamic Instance type of that I pass. Is this possible in Flex or Is there a better way?
View 1 Replies
Dec 3, 2010
I am trying to make a generic list control that has x buttons in it so that users can remove items from the list by clicking the x button. However, this list control needs to support item renderers while still standardizing the layout of items placed next to x buttons.
So I figure the best approach would be to extend the list control and use a renderer that draws the x button and combines that with what ever renderer the user supplies. Unfortunately I cannot figure out how to do that.
I tried overriding newInstance method from the IFactory interface and used that to create an HBox that contains my button and inserts the newInstance result from a user supplied renderer, however it wasn't complete. It displayed as I expected, but the mouse over effect only worked on the user supplied renderer portion and not the entire HBox that my custom renderer made.
View 3 Replies
Aug 24, 2010
Does anyone know how to get actionscript to render a null date value '000:00:00T00:00:00'? I am calling a web service that expects date fields in the SOAP xml. I need some of these dates to serialize as null and I can't see how to produce null. The closest value I can get is '1899-11-30T00:00:00Z'. Below is the code I am using:
[Code]...
View 3 Replies
Jun 24, 2011
Does there exist a Flex view component that you could just pass it a custom object with all public fields/properties that it could reflect over and produce a basic UI view using flex components. Is it possible to use something like the Spark DataGrid with one item laid out vertically. It would only have to support:
[Code].....
View 3 Replies