Actionscript 3 :: Possible To Compress The Base64 String?
Jul 3, 2011Out of a drawing I'm generating a PNG and upload it as a Base64 string via PHP to my server. Is it possible to compress the Base64 string in AS3?
[code]...
Out of a drawing I'm generating a PNG and upload it as a Base64 string via PHP to my server. Is it possible to compress the Base64 string in AS3?
[code]...
I have to load a large xml in flash and I'm trying to send it compressed. To do that I tried to zlib compress the string and send it base64 encoded. In flash I turn the string into a byte array and use its uncompress() method. So far I tried:ZLIB.NET
byte[] bytData = System.Text.Encoding.UTF8.GetBytes(str);
MemoryStream ms = new MemoryStream();
Stream s = new zlib.ZOutputStream(ms, 3);
[code]....
I have converted a jpg image to Base64 string and saved somewhere. Now How can i convert this Base64 encoded string to bitmapData in flash as2?
View 1 RepliesI'm trying to create a list with icons. There're a lot of examples but seems all of them are using embedded images.My problem is how can I create the list with icon from base64 png string at runtime?
View 1 RepliesI'm trying to compress my swf file to 50k from 350k does anyone know how to do it, ive tried exporting the file as a movie then importing it as a video into a new file.
View 5 RepliesI'm using this code to embed an image into my flash file:
[Embed(source="images/grass01.png")]
As you all know, if you embed an image, it comes in without any compression at all.
Is there any way to compress this image without having to do it manually? (I have hundreds of images that will be embedded).
I came across this link [URL] but I assume this is a flex only thing, as I get an error if I try putting the compression variable in my embed tag.
I'm using this code to embed an image into my flash file:[Embed(source="images/grass01.png")]As you all know, if you embed an image, it comes in without any compression at all.Is there any way to compress this image without having to do it manually? (I have hundreds of images that will be embedded).I came across this link URL...but I assume this is a flex only thing, as I get an error if I try putting the compression variable in my embed tag.
View 1 RepliesI need to compress some files in a zip or any other wich will be selected for the client for downloading.
View 5 RepliesI know Flash 11 has native support for handling LZMA compressed swfs, is there a way to use LZMA compression with AMF objects?
View 1 RepliesI have a FileReference that is being uploaded. But before upload, I call the compress() method on the ByteArray of the FileReference i.e. fileReference.data.compress().
But I observe that the uploaded file is the raw file and not the compressed file.
Is this a Flex bug or expected behavior? The data field in the FileReference is read-only. Does that come into play?
In Flex, I have a GUID that I receive as input in the following format "as a string. How would I convert this to a string of Base64 encoded values?
Please note that we have to account for leading zeroes in each section of the GUID, for example, "0091AFBC-8558-482A-9CF6-64F1745E7AC1"
In javascript, I have a variable which holds a pdf in base64 (the pdf is generated in flex and passed to js). I want to open it in the browser (ie I want the browser to display the open/save dialog box letting the user open or save the pdf).
I am using Data URI which works fine in some browsers, but is not supported in IE 6/7:
function getPdf(pdf) {
window.open("data:application/pdf;base64," +pdf);
}
How can I get this PDF to open in IE6 and 7? I've read about MHTML as an alternative to data uri but I don't think it can do what I need, or can it? For now I just need to open pdfs but in the future I will probably need to add support for xls (MS Excel) files too. Currently I'm using Flash's Filereference.save to let the user save the pdf to the disk then he can open it, but the client is insisting on giving the user a choice to open it automatically rather than forcing him to save it first.
The keyword is "sometimes".
I recompiled a Flash 8 project in Flash CS3 recently and noticed that some of the sound effects sounded like a painful chippy mess. It sounded like the mp3 bitrate was at the lowest Flash outputs (16kbps). I compiled again, and all the problems went away. Then I compiled again and different sounds went chippy!
Fine, whatever. Maybe it's a glitch between project versions.
This week I built a project from the ground up in Flash CS3 with AS 3.0 . The chippy compression is still there and happens most of the time. Both my global and local compression settings for sound clips are mp3, 160kbps, Stereo.
I`ll be dealing with this few hours now, so I manage to optimize compiled swf file for only 5kb, and I need to achieve 15.
So, what are the options to prevent unnecessary file size?
I have recently been using Charles the debugging app. And noticed a very chatty app named skyrocket (a very very cool slide presentation app) sending a lot of data across the wire. It is built in flex by the looks and I was wondering why they had chosen to send their data using base64 and not amf. Is it because they don't want to be locked into the flash platform? Or could there be another reason. Is it to store it as XML in the database as they don't want to be dealing with amf when handing data to other services/clients (iPhone etc).
View 2 RepliesI'm using AS3 to base64 encode a JPG and pass it to Javascript. I'm attempting to use AJAX to pass that base64 encoded string to PHP and have PHP decode it. (I know I could send it back to Flash and Flash could decode it and send it to PHP, but I'm trying to eliminate the need for Flash on the decoding end).It appears that AS3's encodeToBase64String() function and and PHP's base64_decode() function do not use the same algorithm, as PHP evaluates it as a base64 encoded object, but does not seem to output it properly
View 4 RepliesWhat would be a best Class for base64 encryption/decryption in Action Script?
View 3 RepliesI am referring to Send image from flash to Asp.net for sending image captured by a webcam to an asp.net page. However I need to download base64 encoder to proceed. The link the user provided for downloading it seems to be broken. Can anyone tell me how I can download the base64 encoder?
View 2 Replies'm trying to convert a movieclip to base64 and send it a server.
I've checked everywhere and I realized I can do it with an external PHP page that will communicate with the flash file and will send the MC as BASE64 JPG using POST.
Unfortunately, my client asked me to do that WITHOUT ANY EXTERNAL FILES (so I can't use the PHP page). Only the final SWF should be used.
I've tried to convert the project from AS2 to AS3, but it seems to be almost impossible.
Is there any way to convert the MC to JPG without the PHP page?
This is important since if it's growing too fast there won't be enough space.
View 1 RepliesUsing an unobtrusive technology (HTML5, Flash, Java Applet) which runs in the browser, is it possible to handle compressing of files before being uploaded to the server? I'm building software which will be consumed by a lot of slow connections and by non-computer-savvy users and circumventing an application install would be very beneficial for them.
View 1 RepliesI have a string of of base64-encoded PNG image that is suitable to use as a src (source) attribute in a <img> tag. However I need to transfer this image to Flash applet where I need to create (show) the image fast. Is there a way to simply use the data string and somehow create an image (inside a Flash movie) from it?
View 1 RepliesI'm developing a flex application that displays a list of images along with some metadataThe images are less than 500kb. They are stored in the database as base64 encoded stringsretrieved using PHP, send over to flex as XML (which creates a fairly large XML output file)Now my problem is that, while I can display upto 2-3 images easily, anything more than 3 or sometimes 2 images will cause the images to be corrupt. Sometimes the whole app fails.I am guessing this is due to the large size of the generated XML. I know I am doing something wrong here. I want to know what is the proper method for storing/retrieving a lot of images in a flex application.
View 2 RepliesI have a issue here with unzipping the .zip files that i have in combobox.i select 1 .zip file and after selecting the particular .zip file Button should unzip it and put the contents in another combobox.
[Code]...
I have an actionscript 2 code that uses base64 to encode/decode incoming data. problem is that data is binary and includes null (0 characters), actionscript 2 fails when handing null to charCodeAt.I figured what I need is an actionscript 2 lib that can do base64 encoding/decoding on an array rather than a String.
View 1 Repliesim using an open source program called Festival that generates text to speech, and in ubuntu i call its method text2wave that converts text into a wave file. I am looking into converting short paragraphs to wave files, but the problem is that each wave file ends up being approximately 1.2MB in size. The wave file is recorded at 16khz, and while recording at 8khz halves the size of the wave file (sacrificing sound quality), the wave file is just simply too large. These paragraphs have to be served many times to the clients and our server can not support that much bandwidth. Is it possible to compress the file on the server, and decompress it in my flash script (on the client side) and play the wave?
View 1 RepliesSo I'm using AlivePDF to generate a 6 page PDF with a range of text and graphics. It's a fairly large PDF, prob 4mb when saved. I need to be able to pass the PDF along with a few other variables to a PHP script that uploads the PDF and then sends an email.
Because I need to pass the PDF data along with other information, I've been using a standard POST request with URLVariables, only I Base64 encode the PDF ByteArray before sending to avoid any sort of corrupt data. This works fine, except the Base64 encode operation takes ~8 seconds, and sometimes longer on a slower machine, causing a timeout.
I work on a Flex application that creates compressed files and uploads them on a server. The files are created with ByteArray.compress method, which is zlib compression. I can decompress them using Python API on the server but I prefer to keep the files compressed there. I want to be able to download and decompress the files later, however WinZip and WinRar fail to decompress them. When I google for zlib utility, I only find zlib dll library. I need a simple application for Windows (and/or Linux)
View 1 RepliesI need to perform encoding of a wav file into base64...
View 2 RepliesI recompiled a Flash 8 project in Flash CS3 recently and noticed that some of the sound effects sounded like a painful chippy mess. It sounded like the mp3 bitrate was at the lowest Flash outputs (16kbps). I compiled again, and all the problems went away. Then I compiled again and different sounds went chippy!Fine, whatever. Maybe it's a glitch between project versions.
This week I built a project from the ground up in Flash CS3 with AS 3.0 . The chippy compression is still there and happens most of the time. Both my global and local compression settings for sound clips are mp3, 160kbps, Stereo.
Flash 9.0
Mac OS X 10.5.4