ActionScript 3 :: Object Serialization To Strings Before Feeding To Smartfox
Aug 20, 2010
I'm building a realtime action multiplayer game in Flash which is using too much bandwidth because it sends message objects as XML (as required by the Smartfox server). I'm now trying to cut down on that by serializing my objects to strings before feeding them to Smartfox. I've tried JSON but it doesn't work. Is there another serialization method that is compacter, for example that encodes numbers in Base64 instead of decimals? I don't care about human-readability in this case.
View 2 Replies
Similar Posts:
Jan 15, 2008
When i use this in a htmltext box:
<img src="podimg.gif" width="64" height="64"> Text
THe image appears on the line below the text.Nothing i have tried gets them in line, like this:
Text
I am trying to make a chat application with smartfox server. The chat app is fine, but getting emoticons working in a textbox seems impossible.
View 4 Replies
Sep 29, 2010
I am trying to create an object dynamically by looping through a database table, I need to create an object for each record found, [code]...
View 2 Replies
Feb 3, 2010
I have these movies already existing in my actionscript code: inner_mc AND gallery_mc.So - I attach my library movie clip: called "link_box", and name it link_box0 and so on through the loop.
-->
for (i=0; i<numimages; i++) {
inner_mc.gallery_mc.attachMovie("link_box", "link_box"+i, i);
Now I want to create a new movieclip called thumbnail0 and so on, to the newly attached movieclip.
This is my attempt: this.movieHolder = inner_mc.gallery_mc.link_box+i.createEmptyMovieClip("thumbnail"+1, i+1);
When i try:trace(this.movieHolder ) it says undefined for all times it loops through.
Whats the syntax to combine strings and variables so that the result is seen as an object name ?
View 4 Replies
Aug 24, 2009
I work on AS3 one week, and then take a break for a few weeks, then work on it a day, take a break, etc.. So I forget some of the basics, and need refreshers. I think I need to stop taking breaks.
Problem: I push multiple strings into an array, and some of the strings are the same.
Code:
var myArray = new Array();
myArray.push (Snivvle);
myArray.push (Kirupa);
myArray.push (Snivvle);
I want to find out which element positions "Snivvle" hogs up. We can see that it would be using element 0 and 2, and if we do an "indexOf" we would only get to see element 0, and doing a "lastIndexOf" we would only see element 2. How do I find out ALL of the element positions "Snivvle" is located in, so that it returns: element 0, element 2.
View 2 Replies
Aug 23, 2009
So me and a friend have recently found ourselves as contributers to an upcoming student exhibition at our university.We have decided to run a project we call "Live Journal"; the idea is that it takes a large group of blogs and online journals and reformats the content into an old fashion letter/journal before projecting them for the viewer (and updating every 10 or so seconds). My friend is organizing the space and presentation and i'm stuck with all that lovely coding!
View 1 Replies
Dec 2, 2010
i was commissioned to animate .swf that will run in a loop in the background of a website, but when certain buttons are pressed it triggers elements in the loop. The loop is 199 frames and loops seamlessly, but the problem im having is how to navigate through the timeline without it skipping frames in the loop, so that the new elements that enter into the scene are in sync with the rest of the moving parts.
The way i have planned on doing it is setting it up so that on frame 199 it jumps back to frame 1, then when the button is clicked it will carry on playing until the end of the 199 frames and the move on to frame 200 where it will play the loop with the new elements in.
View 0 Replies
Jul 7, 2008
I am pulling in some lyrics from an xml file, and Im wanting to store them in an array, so I can access them from time to time, after the initial xml code has been fired.
Code:
var lyrics:Array = new Array();
var lyricNum:Number;
function getLyrics(xmlData)
{
[code]....
trace(lyrics);//this won't pick up the array - Why when I have placed my variable outside of the for loop in the root code!?I have laid my case in the code where the traces reside.why I cant access the array after the for loop has been processed - it says it is undefined.
View 4 Replies
Feb 7, 2008
I'm forgetting the correct syntax here. I've got a function that I want to feed an array of movie clip names into, like so:
Code:
var clipArray:Array = new Array();
function revealDetails(clipArray):Void {
[code].....
View 2 Replies
Apr 21, 2010
My flash files are in the root directory, while I have seperate HTML pages in different folders. I want the Flash project to react slightly differently depending on what web page the project was opened from.
View 3 Replies
Jun 29, 2010
A client is asking for a slideshow to embed into a web page. The slideshow will have a thumbnail bar with arrows on either side to switch to the next or previous batch of thumbnails.This slideshow needs to be linked to an external file that will contain pictures submitted by visitors to the site. The pictures will automatically generate thumbnails that will call a large version of the image when clicked on.My current knowledge about flash and AS3 coding does not enable me to do this. I wouldn't be surprised if it's not possible at all. It sounds like something that needs to be handled by a content management system.
View 2 Replies
Aug 10, 2004
i am working on a flash portfolio that is supposed to be fed from a MySQL database. Until early today everything worked just fine, but then i had to change the structure of my database. initially i had just 2 tables, news and work... now i added links, photo, digital etc, and dropped work. and it just doesn't work anymore... it's strange as i did nothing to the news section for example...
i have included the fla, the php scripts that send the XML to flash as well as a query of my database in the following zip archive..[URL]..
View 2 Replies
Jun 15, 2010
I'd like to easily convert a string of say "dog=Sam&cat=Garfield&mouse=Cheese" into an object of strings.
The object would contain the variable "dog" equal to "Sam", its variable "cat" will be "Garfield", and of course "mouse" the string "Cheese".
There are a number of ways to parse this, but what is the simplest way? I know when you use a URLLoader object, you can give it a dataFormat of URLLoaderDataFormat.VARIABLES and then it automatically converts the data into an object.
View 7 Replies
May 19, 2011
I'm using the Halo AdvancedDataGrid component, in which the default itemEditor for each column is mx.controls.TextInput.
For example, the data provider is:
[CODE][Bindable][code]............
If a String from the dataprovider Array is preceded by an asterisk - as is the case for banana in this example - the String needs to be surrounded by square brackets and be displayed in a grey colour.
I tried to do the following: [CODE]
A colleague told me about using the AdvancedDataGridColumn's labelFunction attribute. I tried that but was unable to do the following assignment (the id of the column is 'tag'):
[CODE]tag.itemEditor.htmlText = formattedText;[/CODE]
I get error "Access of possibly undefined property htmlText through a reference with static type mx.core:IFactory.I tried to both explicitly extract the TextInput itemEditor (like I did for the override set data) AND use the labelFunction, but I couldn't get both to be in the correct scopes.
View 1 Replies
Jun 26, 2009
if you look at the code:: barn is an instance of an MC on stage. I have a few buttons stored in an array which i want to attach scripts with a for loop. Why does adding an item from the array not work when placed inside the function call?
[Code]...
View 2 Replies
Aug 10, 2004
i am working on a flash portfolio that is supposed to be fed from a MySQL database. Until early today everything worked just fine, but then i had to change the structure of my database. initially i had just 2 tables, news and work... now i added links, photo, digital etc, and dropped work... and it just doesn't work anymore... it's strange as i did nothing to the news section for example...i have included the fla, the php scripts that send the XML to flash as well as a query of my database in the following zip archive... [URL]
View 2 Replies
Jan 11, 2010
I am trying to set up a communication between a flash client and a C# server. I would like to know if Flash allows me to perform XML serialization in the way that C# does. This is because I would like to use the XMLserialization class in C# for passing of data. If this is not possible, what other methods are available for communication?
View 1 Replies
Aug 10, 2009
I have to dynamic text boxes; one is for articles and the other is supposed to bu for navigation of the articles. I have a variable set up for the article dynamic text box and I want the navigation part to be filled in via text file. so I need to find a way for the information that's fed in to the navigation part to functions as buttons and when they are clicked a variable should pass though flash telling is what story to display. for instance if you click stereohype then storyvar == stereohype. see what I mean? I could do it all in flash but i'm trying to make it where I don't have to touch the flash file after it's completed and everything can just be manipulated via text files with html php xml you name it, what ever works.
View 1 Replies
Dec 18, 2009
What is the process for feeding XMLList values to a URLRequest method?
Say I have an array:
ActionScript Code:
var imageURLS:Array = ["images/image1.png", "images/image2.png", "images/img3.png"];
[Code].....
Way I see it is the traces above are the same, where am I wrong?
View 3 Replies
Jan 11, 2010
I am using AS2 in flash CS3. I am trying to set up a communication between a flash client and a C# server. I would like to know if Flash allows me to perform XML serialization in the way that C# does. This is because I would like to use the XMLserialization class in C# for passing of data. If this is not possible, what other methods are available for communication?
View 3 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
Jul 30, 2011
I have an actionscript class that serializes and unserializes data compatible with php's serialization functions. I expanded it to support binary data but now the unserialization does not seem to work. For example, this data is not unserialized correctly:
[Code]...
View 1 Replies
Jun 28, 2010
Another observation on serialization:Make sure that you have registered ALL classes that may be written by the writeObject() method.By 'registering' I mean using the registerClassAlias() call.Most noticeably this goes for subclasses.For example, if I write an object to the streamwith
ActionScript Code:
writeObject(question)
and question is an object of class MCQuestion, which is a subclass of class Question,
[code].....
View 0 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
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
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
Feb 22, 2011
The game is written in Flash, and I plan to develop the server in node.js because (a) it would be a cool project for learning node.js, and (b) it's fast, which is important for games.The server's architecture is based on messages sent between the server and client (sort of like Minecraft's server protocol). The message format I have so far is a byte (the packet type), two bytes (the message length) and that many bytes (the message data, which is a mapping of key-value pairs). Problem is, I really don't want to develop my own serialization format (because while I probably could, implementing it would be a pain compared to using an existing solution).Unfortunately, I am having problems finding a good candidate for the message data serialization format.
ActionScript's own remoting format might work, but I don't like it much.SON has support in node.js (obviously) and in ActionScript, but it's also textual and I would prefer binary for enhanced speed.MessagePack looked like a good candidate, but I can't find an ActionScript implementation. (There's one called as3-msgpack on Google Code, but I get weird errors and can't access it.)BSON has an ActionScript implementation, but no node.js support besides their MongoDB library (and I'm planning on using Redis).
View 4 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
May 5, 2011
i need to serialize AS3 strong typed Objects, send them to a C# Application and then be able to derserialize them as Hashtables/Dictionarys or so because i have no corresponding C# Class. I then will make some changes to that Hastable and need to be able to send them back to the as3 App. I tried using JSON (see this question with bounty Typed AS3 JSON Encoder and Decoder ?) as i already got JSON serialization to Hashtables in C#. It does not work because AS3 has no support for typed JSON.
I also looked in XML and found asx3m http://code.google.com/p/asx3m/ which is strong typed in as3 but i can find a solution to serialie and deserialize this to proper hashtables in c#.
View 1 Replies