Flex :: ByteArray Manipulation - Storing Binary Data In String?
Jul 28, 2011
I have some binary data and I can't store it in a string, as such I'm using a ByteArray. The problem is that I need some functionality that comes with strings, to be specific I need the charAt, substr, indexOf and substring methods.
View 1 Replies
Similar Posts:
Jun 22, 2009
i have a string which contains all binary data. the binary data represents a custom object in my application.
i want to convert all the data inside the string into binary format and store it in a ByteArray. then I want to read the object from the ByteArray using readObject.
View 2 Replies
Aug 3, 2010
I have an array of objects. Each object has 3 integer fields and 2 binary fields.I've utf encoded the binary data and json encoded the array & sent it to Flex client side.On the client side, decoding data, I've got a String representing the binary data (utf decoded).Now, how can I convert this String to ByteArray? Or how can I read each byte of the String?
View 1 Replies
Sep 12, 2011
I've been asked to implement and MD5 hasher ActionScript-3 and as I was in the middle of debugging how I formatted my input I came across a problem. When I try and output the ByteArray as a binary string using .toString(2), the toString(2) method will perform some short cuts that alter how the binary should look.
For Example
var bytes:ByteArray = new ByteArray();
bytes.endian = Endian.LITTLE_ENDIAN;
bytes.writeUTFBytes("a");
bytes.writeByte(0x0);
var t1:String = bytes[0].toString(2); // is 1100001 when it should be 01100001
var t2:String = bytes[1].toString(2); // is 0 when it should be 00000000
so I guess my question is, might there a way to output a binary String from a ByteArray that will always shows each byte as a 8 bit block?
View 2 Replies
Jul 20, 2009
So, as the title says I was wondering if it is possible to scale bytearray/binary data from lets say 640x480 which is being captured from the stage to 1024 x 768
View 1 Replies
Feb 9, 2012
I would need to save some binary data (bitmap data or similar) as a part of XML file.[code]...
I suppose I must serialize or encode "ba" (binary bytearray data) some way to string before writeing to XML and decode them back during the reading from XML, but I cannot find the correct way how to do it.
View 3 Replies
Oct 2, 2009
How to encode LONG_INT binary representation from AS3 Number data type (using ByteArray)?Need it for implementing data transmission protocol between client and server.
View 5 Replies
Jan 17, 2010
unpacking data from a binary string. I realized it with a php code:
list($empty,$size) = unpack( 'V', fread($socket,4) ); $theresult = fread($socket,$size);
But how can i do this in as3 ? I didnīt find a possibilty to encode "unsigned long (always 32 bit, little endian byte order)". Is there a option like unpack in as3 ?
View 4 Replies
Jun 12, 2009
I have a input text field on the first frame. I want to use the data from that text field in the next frame how do i do that using an array or a string.
View 1 Replies
May 25, 2011
I want to separate the data from the PHP call to Different CollectionArrays So that I can use the data for a bar-graph;
I created a static version of the bar-graph and separated the Collection array manually I don't want this done manually I need to do it dynamically. So what I am trying to understand is where to put the event-listener how to add to a collectionArray then once the collection array(s) are built. use that information to build the bar graphs...
/*
*
36, > 2 years, Compliance
6, 0-90 Days, Compliance
[Code].....
View 2 Replies
Mar 17, 2010
I m trying to write AS3 to take a screenshot of a MC thats on the stage and pass the data to a .cfc method which saves it as a jpg on the server.The current code I have kind of works except the jpg is unreadable.I think it has something to do with not using Flex, AMF, and writing binary files.When I look at the jpg via a hex viewer I think it doesnt have the right jpg header.The jpg begins with:c3 bf c3 98 c3 bf c3 a0 00 10 4a 46. When I think it should begin with:ff d8 ff e0 00 10 4a 46
//AS3 source code[code].......
View 1 Replies
Dec 9, 2008
I'm planning out an app that will (amongst other things) let the user speak into his mic and replay his voiceclip. I don't really need to permanently store the sound, it's enough if I can record it, replay it and overwrite it again if the user records another sound clip.
So far I gather this is impossible in Flash without the use of a mediaserver. Then again if I'm right the only way a media server can help me is by actually streaming the microphone input to the mediaserver, actually storing the sound as an mp3 file or similar, and then serving the mp3 file back to the app. It seems a bit overkill for just replaying short soundclips while the app is up, soundclips which are going to be re-recorded over and over while the user is using the app and trashed when he stops using the app.
Anyway, I recently heard something about how the flash 10 player actually allows you to store an mp3 or dynamically generated sound in a bytearray. It doesn't seem like a great leap to me to assume that if you can generate a sound and stick it in a bytearray, you can store mic input in a bytearray. But I haven't been able to find any info on the latter.
Has anyon experimented with this or found out a nay or yay on (temporarily) storing mic input in bytearrays?
View 2 Replies
Jan 27, 2011
I got this situation:
var vector:Vector.<String> = new Vector.<String>();
vector.push("uno");
vector.push("dos");
[code].....
View 1 Replies
Sep 17, 2009
I'm new to Flex and couldn't figure out yet how to send binary data to the server as the body of a POST request. The HTTPService component doesn't seem to support this. The FileReference doesn't seem to support setting the data via the Flex API.
View 4 Replies
Aug 22, 2006
I'm using a function to call multiple button actions, so I don't have to rewrite code for each button... here's the script:
[Code]...
This is all part of a clip which loads pictures externally... each of the buttons (which are mc's) are named btn0, btn1, etc.
View 14 Replies
Mar 25, 2010
The data provider (ArrayCollection) for my data grid consists of objects with ByteArray (int) fields. How do I make the data field display as int without transforming my data provider?
View 1 Replies
Jul 20, 2009
I'm not familiar with XML text handling yet, but have to create one quiz quickly.I've decided to put feedback into different variables. e.g. fb1_1 for right anwer of question 1, fb1_2 for wrong answer of question 1.I thought to change a string to variable and put the text into a dynamic text "fb" would be something like this:[code]Also is it possible to put all text in one text field and extract a different line of text and put it to a dynamic text field? I tried to put the text into a variable, but it only shows level (level0) and instance name not the text itself. Anyway to get this way to work?
View 0 Replies
May 29, 2009
I really like the string.Format() method and the StringBuilder class in C# quite a bit.
I sucks AS3 isn't as robust (yet, hopefully) with regard to string manipulation.[code]...
So, are there any open source libraries for AS3 that include this kind of functionality (and more, hopefully)?
Currently, in order to have the same result in AS3 would take a lot more code.
I hate relying on C# and other languages to do more formatting and such than they really should when generating XML files and stuff like that.
View 5 Replies
Dec 15, 2010
Im creating flash game that have the functionality to capture/record its gameplay that can be viewed later by the user, like a replay.
As for now Im already able to record the game and write it into a flv format in a ByteArray variable.
What Im working right now is how to send that ByteArray(the video file) to a php script and save it to a web server.
I've run into the URLLoader in flash where it can send the data and php will receive it thru the POST method. Unfortunately, the ByteArray containing the flv data must be first correclty encoded for php to read it. I figured this out from the example in the net where it does the same thing only that it is only sending a JPEG ByteArray instead of a FLV format using the JPEGENCODER.
Is there any existing class like the JpegEncoder for FLV format or any Video formats? Or any work around like creating the encoder my self?
here is my current code to send the ByteArray
//send byteArray to a php script
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
[Code]....
View 1 Replies
Oct 14, 2009
I will like to convert string into binary
here is the code
private function sendCommand(e:MouseEvent):void {
var ba:ByteArray = new ByteArray();
ba.writeMultiByte(command.text + "
[Code].....
I will like to convet command.text in to binary format and send it to server.
View 1 Replies
Jan 18, 2012
i am looking for some kind of library which does CRUD easily using PHP and MYSQL.My goal is to make some app in flash AS3.0 , where i will be receiving some data from user and storing in data base , and perform CRUD opertaions. I dont want to be so much involved in writing php and sl query.My scenario is:
Data types : [ like user_profile data, etc]
add under data types 1 to many fields with various types..
Database tables and realtions etc should be done by my DREAM library, then user when select a Dtat Type, he is presented with related fields to fill up data.
I will be using Flash AS3.0 ( Builder or IDE ) to perform .If only i can find some php library i think AMFPHP can connect flash with php
View 2 Replies
Oct 17, 2011
I am using Flex builder with sdk 3.5. I want to convert binary string to unsigned int.
View 1 Replies
Feb 23, 2011
I'm parsing out a greensock easing function as a string from an XML (as in "Strong.easeOut"), but then I need to store that in a variable as a Function type to call later. how is this done?
everything else i've found has been how to call a function from a string, as in this["functionName"](). i don't even know if using "this" is the correct scope for a static function in another class?
View 9 Replies
Mar 16, 2012
For my calculator i am having trouble storing a number inside a string variable.
[Code]...
Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.
View 5 Replies
Oct 21, 2008
I have a custom socket class designed to connect to a server and talk with it. At one point, the server uses hex data for speed, however Flash seems to not get ANY of this data. In fact, it doesn't get ANY of the data from that point to the next packet.
View 2 Replies
Jul 3, 2007
I wrote an image editor for my cms and wanted to send the image respectively the through the BitmapData's getPixels()-method received ByteArray to a PHP-script that displays and finally saves the image. Obviously I didn't succeed. How do I have to encode my binary data so that PHP is able to read it and how do I have to treat the bytes in PHP? I also tried encoding the image data with the corelib classes from [URL] but it didn't work as well.
View 4 Replies
Mar 16, 2012
For my calculator i am having trouble storing a number inside a string variable.
Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.
Code:
var currentNumber:String ="";
function pressNumber(e:MouseEvent):void{
display_txt.appendText(e.target.num);
currentNumber.append(e.target.num);//error here
}
View 7 Replies
Oct 3, 2011
What is the simpliest way to find an occurance of some sequance of bytes (string) in a long byte array?
UPD: I tried to do
my_byte_array.toString().indexOf(needle_string);
the problem is that in flash/air string consist of utf8 characters, so indexOf will return value different from offset of "string" in a byte array (actually it's zip archive)
View 2 Replies
Feb 18, 2012
To put it simply, I have this string filled with 0's and 1's (terrible right?) What's the quickest way to divide it by 64 and put it into a bytearray? (with the bits as the char's value?)
View 0 Replies
Feb 23, 2012
ActionScript Code:
private var counter:Number = new Number( 0 );
private function sequence(seq:Array):ByteArray
{
[Code].....
Maybe im just too blind to see it. I have this string with 0's and 1's and im just trying to turn it directy into a bytearray. I'll optimise it later, im just getting really annoyed at the fact that this isn't working.. Edit: I even tried working with an array. The data is there it's just not being written into the bytearray properly.
View 2 Replies