ActionScript 3.0 :: Using Json Files With FZip?

Aug 18, 2009

I was wondering if anyone has tried to zip up json files and load them in AS3 with the FZip library.My json files are syntactically correct (when I load them with URLLoader they load fine) but when I try to JSON.decode() them after I have loaded them from FZip, I get this error.

Error: Unexpected  encountered
at com.adobe.serialization.json::JSONTokenizer/parseError()
at com.adobe.serialization.json::JSONTokenizer/getNextToken()

[code]....

View 2 Replies


Similar Posts:


Javascript :: Using Fzip Lib Under Adobe Air App

May 4, 2010

I'm currently working on a project for Adobe Air (1.5.3) and I need to unzip a file, copy some of its contents to another file. Then I saw people talking about the Fzip ([URL]) lib. The problem is that I don't know how to "import" or use this library with Javascript and Adobe Air, since Javascript doesn't have the import directive.

View 2 Replies

Actionscript 3 :: Create A Docx Using FZIP - Adobe AIR

May 8, 2011

Using the office open XML format by microsoft I was able to create the files needed for a clean Word document. These files are all XML files. What I do is write the XML content to a different bytearray for each file.

I then add the bytearray's to the FZIP library [url] and create a docx file using the following code:

CODE:

Ok this creates a new docx file in my documents. If I rename the .docx to .zip and unzip it it will follow the exact structure needed for Word documents (example: [url]

In this example "Untitled Document" was originally "Untitled document.docx" (then renamed to .zip and extracted)

So you can see everything works fine untill... you try to open the "Untitled document.docx" in Word. It will say the file is corrupt.

WHAT DOES WORK HOWEVER... After extracting the docx file (like in screenshot) when you select all the files/folders inside the Untitled Document folder and ZIP those, then rename ZIP file to docx (see result: [url]) it works fine in Word and word reads the file correctly.

NOTE: If you try to zip and rename the Untitled Document folder again it will become corrupt again as well.

So my question: What could be the problem that the word file is corrupt when zipped using FZIP in actionscript 3 but works fine when you ZIP the files after extracting your corrupt file.

View 2 Replies

Json :: Unable To Encode Flex Grid Data Into JSON On Sorting Columns?

Nov 28, 2011

Created an editable flex grid which exposes a method called getGridData() to javascript. I am using the JSON.encode() method of the [url]....library to convert the grid object's dataProvider into JSON before returning it.

ExternalInterface.addCallback("getGridData", getGridData);
public function getGridData():String
{[code].....

However, when I sort a column in the user interface, the encode method is failing throwing the following error

Property usingCustomCompareFunction not found on mx.collections.SortField and there is no default value.

View 1 Replies

AS2 :: Post JSON Data From Flash With The JSON As The Body Of The Request?

Nov 5, 2010

I'm working on a Flash AS2 application that needs to post JSON data to a web service.In previous projects, I've used LoadVars.send() or LoadVars.sendAndLoad() successfully to manage this:

var send_lv:LoadVars = new LoadVars();
send_lv.data = JSON.stringify({some json object});
var response_lv:LoadVars = new LoadVars();
response_lv.onData = function(rawdata) {

[code]....

In somepage.php, I can grab that JSON data using $_POST['data'].However, on this project, the developer of the web service requires the JSON content to be the BODY of the request (i.e., not a name/value pair). Is this possible with LoadVars?

View 1 Replies

Actionscript 3 :: Json - Decode JSON - JSONParseError: Unexpected H Encountered

Oct 14, 2011

I'm new to JSON. This is the .json I want to decode but I always get this error:

[Code]...

View 1 Replies

Actionscript 3 :: Json - Counting Elements In JSON Array Which Is In An Object

Feb 23, 2012

I have a pure ActionScript 3 problem, but the simplified test case I've prepared is in Flex 4 for better visibility (the source code is below): Since Flash Player 11 / AIR 3 support JSON natively, I've decided to move a multiplayer game, which used XML for communicating with server, to JSON. But I have a frustrating problem, that given two Objects like

[Code]...

View 1 Replies

Actionscript 3 :: Json : Parsing JSON Data?

Sep 28, 2011

I am sending a request to a server, and in return I get a long block of JSON.

{
"response":"success",
"assignments":{
"17733":{
"asnid":"17733",

[code]....

Is there a way to do this? I checked if the property was enumerated and it returned true, but I cant find a way to access this data.

View 1 Replies

Actionscript 3.0 :: Json : How To Post JSON Data

Dec 13, 2011

I have to work with webservices in Actionscript. I found the following code that allows me to use JSON URLs that implement only the GET method. However, it doesn't work for POST methods (doesn't even enter the "onComplete" method). How can i "POST" JSON data using Actionscript 3.0?

package
{
import flash.display.Sprite;
import flash.net.URLRequest;

[code]....

View 1 Replies

ActionScript 3.0 :: Json - Use A JSON API In Flash?

Jan 15, 2012

I was wondering if someone could explain or point me in the direction of how to implement an API that uses JSON in ActionScript 3.0. What I specifically want to know is how would I grab specific information. The following is how I do it in XML but I don't know how I would do something similar in JSON as in getting the equivalent of an XML tag. For example with the twitter API I'd like to grab the text [URL]

[Code]....

View 1 Replies

Actionscript 3 :: Corelib Can't Decode JSON String With JSON.decode()?

Sep 9, 2011

I am working on an inDesign Extension in flex where I am encoding an object to JSON and then later trying to create an object from the JSON String.

The Class I am encoding with JSOD.encode()
public class ManualProductLink {
private var _productID:String;

[code].....

View 1 Replies

Flash :: Send JSON From This To PHP?

Jun 4, 2010

I'm trying to send array of data from Flash to PHP to sending e-mail. I'd like to do that because I must change the php page everytime my form site changes because of client's choice.[cod]e...

View 1 Replies

Php :: What Is Deserialize & Serialize In JSON

Jul 23, 2010

I'm new in JSON, but now I need to use JSON for my Flash ActionScript 3.0. So I found one lib for JSON and I have seen the terms Deserialize & Serialize what does that means.

View 1 Replies

Flex :: JSON Array - How To Get UID

Aug 6, 2010

api_result = '{"response":[{"uid":1969258,"first_name":"Walle","last_name":"Woo"}]}';
var myobj:Object = JSON.decode(api_result);
So, how I can get uid, first_name and last_name from "response" array?

View 1 Replies

Php :: Displaying JSON In Flash?

Nov 16, 2010

I'm trying to pull data into flash using JSON but i keep getting this error

JSONParseError: Unexpected < encountered
at com.adobe.serialization.json::JSONTokenizer/parseError()
at com.adobe.serialization.json::JSONTokenizer/getNextToken()

[Code]....

View 3 Replies

Php :: Unable To Decode JSON

Dec 1, 2010

I 'm passing a JSON encoded URL to php generated through my flash program Here is the what i get when I do a trace

[Code]...

View 4 Replies

Actionscript 3 :: JSON To XML Conversion

Dec 20, 2010

There are options to do it using Java and JS. And these options can be clubbed with AS3 but is there something out-of-the-box in native AS3 to do it.

View 3 Replies

Flash :: Get And Parse JSON In Actionscript?

Apr 11, 2012

What I want to do is make a get request to this URL: [url]... which should return some JSON and then parse out certain information from it.

How would I go about doing this in Actionscript 3? I'm more concerned with figuring out how to get the data to feed to a JSON parser rather than parsing the JSON, since there seem to be plenty of questions about parsing JSON. The reason I want to do this in AS3 is that I have a 3D flash visualization set up and I want to get this data, parse out the relevant bits, and then display the parsed bits in the visualization.

View 3 Replies

Pass JSON To A Flash Movie?

Jul 8, 2009

What is the best way to pass JSON to and from a Flash movie?Currently to communicate between javascript and Flash :I'm using 'flashvars' to pass data to the flash movie when it initially loads I'm using 'ExternalInterface' at runtime to transfer single values, such as booleans at runtime I want to move to the next level and do this with JSON now.

Initially I just want the ability to send JSON to the flash movie on instantiation, but later i will need to send data back and forth.I just want to do it right first time and avoid any compatibility or 'gotcha' issues if there are any. i dont even know if i can pass a whole object to Flash, or if i need to serialize it as a raw JSON string.

View 2 Replies

Flex :: JSON: Ignore Certain Properties Name?

Nov 10, 2009

Is there some library for flex, that will let me: define properties to fully exclude from serialization define classes to serialize without the property names (as if they were an array)

View 1 Replies

Iphone :: Flex - Use AMF Instead Of JSON (for Web Services)?

May 29, 2010

Although iPhone support JSON natively, AMF is a binary protocol and it supposes to use much less bandwidth. Do you think using AMF is a good idea?Just found this AMF library in cocoa (Objective-C):Here's the famous benchmark that shows AMF is smaller and faster than JSON + gzip in Flex:

View 5 Replies

Xml :: Getting Static Data For Flash App With JSON?

Jul 9, 2010

I've flash app and i've static data (like ~18.0KB) for it which aren't changed often so I was wondering how to better get them. The static data may be in XML or JSON. One of my ideas was to put the static data in .js file within a function which would return them in JSON list and the other one was to return them in XML (as I like to work with XML more in Flash) somehow. But I'm not sure if it possible to put XML stuff in JS file to return them when function is called.. Or is XML pages also cached in browser and I will get the same performance result which I would get with cached JS files?

View 1 Replies

ActionScript 3 - How To Read JSON Using Flash

Aug 27, 2010

To read JSON using as3, are there any built in methods? It would be better if we get some code samples.

View 1 Replies

Hierarchical Tree In Flex Through Json

Dec 27, 2010

hi i have to create Hierarchical tree in flex through json. Please let me know if there is any type of help

View 1 Replies

Prototyping In Flash - Using JSON For Web Services?

Mar 19, 2011

I know most people hate 100% flash-based websites, but I was recently forced to use flash for a college assignment. After creating a fully-featured ria in less than 2 weeks with every feature I could imagine, i've regrettably fallen in love with this beast (which I previously refused to touch with a stick) due to the power of AS3 and the ability to sprinkle it everywhere :-

I now want to port a commercial desktop application of mine (which has been largely unsuccesful) to the web and feel flash/flex is an excellent candidate. While creating a html/css/js version would be ideal (working browser shortcuts, for a start), i'm certain it'll take a year to create in cross-browser html/css/js what would take just ~3 months in flash. Obviously as the (paid) desktop product was unsuccessful, i'd want to minimize the risk/investment in the (free) web application.

I plan on using JSON for web services, so it shouldn't be a huge pita to port in the future.Is this a good strategy for launching a web app you're not yet 100% committed to? Or will the fact i'm using flash doom me from the start? Has anybody else done this? If so, how did your userbase respond to the 100% usage of flash, and did you get around to porting it to standard web technologies?

View 1 Replies

Actionscript 3 :: Decoding JSON Data From PHP?

Apr 28, 2011

I am able to pull JSON data from PHP into my Flex application just fine with the following bit of code:

[Code]...

View 2 Replies

Actionscript :: Use Json To Control It On Another Page?

May 3, 2011

How would you connect a flash with the js on another page?

For example, if I had a flash game opened on one computer, but the user can only interact with the game with js on another computer.

View 2 Replies

ActionScript :: Parse JSON Dates With It?

May 11, 2011

I have dates in JSON which are generated from ASP.NET pages using the JSON.NET library. [code]...

How do I parse these with ActionScript from Flex 3 Professional? I'd like to have this in a native data format.

View 3 Replies

Php :: Load JSON Data With URL Loader?

Aug 4, 2011

I am new to action script 3.0. o understand how can I load data with URLLoader.So, I have an aplication like:

var PATH:String = "http://www.somesite.com/myFirstPage.php?a=10&b=20";
var urlRequest:URLRequest = new URLRequest(PATH);
var urlLoader:URLLoader = new URLLoader();

[code].....

View 4 Replies

Flex - How To Load A Json File

Sep 8, 2011

I have a json file on my server.[URL].. If I type the url into a browser I get a page not found error.

If I set the url of a http service to the path of the json file the httpservice wont load it.

Is it possible to load a json file in this way or does the json file have to be the result of a server page request eg: [URL]..

View 1 Replies







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