Well, i am recording the voice from heaphone and the sound data is stored in ByteArray at runtime, now can i stored as mp3 ?i want to save as mp3 file on the client system.. For that, i think i have to use air application..
I am trying to make a little "database" app. I have several obejcts that need to be saved and loaded (saved data files). These objects are custom MovieClip classes.I will say that I don't know much about ByteArray. What I have attempted was to put all my objects into and array, then use ByteArray.writeObject() and ByteArray.readObject() with that array.I assume that the file saves ok, but when I try and load back the file, I get a 1034: Type Coercion failed error. See the code snips below.
Code: public function ToSave(e:Event):void{ aFile = new FileReference(); //compiled data in the order: league,allTeams,allPlayers,allGames
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.
I have an animated MovieClip and I want to save it to computer as animated swf !is there any way to convert it to byteArray and send it to FileReferenc and save it ?I tried writeObject but it doesn't work !
I have some audio data in a byte array in a Flex app that I would like to save to my model in Django. I assume I would use a FileField, but I can't seem to get it to work. (My project is set up like this.) I've tried looking at this sample code for PyAmf, but I can't quite get the two to combine.
I am working on a game, made with Flash (using AS3) The game has a fast ball and when this ball hits an object it has to make a sound... but the sound starts with delay (so the ball is far away when the sound is played).This sound is edited by me and it hasn't got any silences at the beginning.The method i'm currently using is the simplest one:
public var sonidoPuntos1:sonidopunto1 = new sonidopunto1()
and then...
sonidoPuntos1.play()
I am trying to introduce the file into a ByteArray and then playing it from there...
I've got 3 columns in an SQLite db I built with Firefox's handy SQLite Manager. So, I created 3 columns, an index/reference that's just an incrementing INTEGER for easy reference, a descriptive title of the image (so it can be searchable later) in a TEXT, and a BLOB type that holds the pngs.
I'm trying to add this in an assets folder into my project (as a pre-populated database) and display the blob images, one at a time, in a window one after the other, scrollable by user. This is where I'm running into problems. Eventually I want to be able to encrypt it and add a search tool, but first things first, and that's displaying an image.
I have spent several hours scouring the web about this topic, but there isn't much help out there: Adobe has tips about using SQLite with AS3 (their reference documents and the support section of their website have some overview articles) but nothing refers to reading blob data in depth.
On this site, I've found some references to Adobe Air looking for extra byte information when reading blobs since they have a different syntax to write to the databases created within the program. See: What is the first bytes in a Blob column SQlite Adobe AIR? Blob Sizeinfo?
I have a logo that I made in Fireworks, and it looks decent, but I was wondering if anyone could mimic it with movement. For example, if someone could use actionscript to make it "wiggle" or wave like a flag in the wind, that would be awesome.
Notice how the blue line itself stays at about the same thickness (it barely starts getting thicker), but the shading around it thickens as it goes more and more to the right.
I was browsing the net and came upon this site, which has a really cool blob-like borders effect. I really wanted to learn how to accomplish this effect, here's what I know as of now:
1. I must have an array of points, connect them using curveTo and fill it. For this I have to use this methods: createMovieClip, lineStyle, beginFill, moveTo, curveTo, endFill
2. Then I must have a proximity detector for each point, more or less like: dx = point._x - _xmouse; dy = point._y - _ymouse; distance = Math.sqrt(dx*dx + dy*dy);
And if the mouse is too close to the point make it move away with a certain velocity (but only if the mouse is moving, if it is still, just make the blob wobble for a while, using an elasticity effect). point._vx += point._ax; point._x += point._vx;
Where the acceleration must be a fraction of the distance we calculated before: k = .2; // example point._ax = distance * k;
But we must also have damping so we can have the elastic movement, so: damp = .9; // example point._vx += point._ax; point._vx *= damp; point._x += point._vx;
3. Finally when the mouse is clicked on a blob we must communicate with the others and make them all wobble, by using LocalConnection. How do I make the array with all the points and access them?; how do I impose the proximity detector into each point and make the curveTo's change?
I have a flex application which is hosted on Azure.
I have some data stored in a blob in a private container.
How can I use URLLoader to display the data? If I use a public container , then I am able to read from the blob in my application. However, if the type of the container is private URLLoader fails.
I need to be able to save and load images into an SQLite database using Flex 4.5 for a mobile application. The use case is this:
Inside the view there is a spark Image object with a URL as a source
When user clicks button, the Image is saved to an SQLite db inside a BLOB field.
In a separate Image, the source is set to the ByteArray stored in the db.
The biggest question so far is this: where do I get the ByteArray for a loaded Image? I've tried debugging and inspecting Image, BitmapImage, and BitMapData but there's no sign of the byte array.... perhaps it's inside the ContentLoader? But that's null unless I enable caching.
I've done some research and there are no complete examples for how to handle this. I've written a simple View that anyone can copy and paste into a new project. It will compile without errors and can be used for testing. I will update this code as I get the answers I need so that anyone can have a fully working example of this workflow.The only caveat: I used a synchronous connection to the DB to avoid complicating the code with event handlers, I wanted to keep it as simple as possible.I will only mark this question as answered once it is fully functioning both ways.
UPDATE SEPT. 09 2011: The code below is now fully functioning in both directions (save and load). Here are some of the things I've learned: It turns out that the ByteArray of a spark Image can be found inside the LoaderInfo of the image itself. Like this:
image.loaderInfo.bytes
However, trying to set this ByteArray as the source of another image ( image2.source = image1.loaderInfo.bytes) results in this security error: Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport is false.Which is too bad because it would save so much time and processing power.the workaround is to encode the ByteArray using either a JPEGEncoder or a PNGEncoder. I used the JPEGEncoder which produces much smaller files. Here's how:
var encoder:JPEGEncoder = new JPEGEncoder(75); var imageByteArray:ByteArray = encoder.encode(imageToSave.bitmapData);
Now the problem is saving these bytes to the DB. Saving them as they are now will not work once we read them out, I'm not sure why. So the solution is to encode them into a base64 string like this:
var baseEncoder:Base64Encoder = new Base64Encoder(); baseEncoder.encodeBytes(imageByteArray); var encodedBytes:String = baseEncoder.toString();
So now just save that string into the BLOB field and later read it out. However, you have to decode it from a base64 string to a ByteArray like this:
var encodedBytes:String = result.data[0].imagedata; var baseDecoder:Base64Decoder = new Base64Decoder(); baseDecoder.decode(encodedBytes); var byteArray:ByteArray = baseDecoder.toByteArray();
Now assign the bytearray as the source of your image and you're done. Simple right?if you find any optimizations or alternative ways to do this.I will respond and keep this code updated if need be.
I am having trouble loading .swf files to my flash app off my cloudstorage account on azure. images and videos load fine but .swf files return this error:
SecurityDomain 'http://localhost/' tried to access incompatible context 'http://[---].blob.core.windows.net/content/swf/Lib_En.swf'
I am trying to get a bitmap to spit out just straight black and white for blob detection purposes.. but my image processing function (below) is spitting out black and transparent instead of black and white... can someone tell me what my pee brain is doing wrong
But I keep getting an "Error #2030: End of file was encountered." This is (probably) because the class I'm serializing is too big for the "String" object type in AS3. Is there a limitless object for storing an array of characters (or better yet binary), or am I going to have to make my own class? (like one with an array of strings)
I am currently playing around with a blob code and have a small problem.The problem is that sometimes the blob gets inverted so the white color gets inside the blob itself and makes a white hole in it which I don't really want.
class Blob extends Sprite { private var speed :Number = .01;[code]...........
I've designed a painter program where the user can select different colours and 'paint' a custom design on screen. What I would like to do is incorporate a 'Save' button which takes a snapshot of their drawing which they can then save to their computer.
How do we save file locally in Flash (ActionScript 3) without displaying dialog. I know we can use the following code to save file locally but it prompts Save dialog. I don't want this dialog while saving file locally.
Can we Bypass the save dialog box of FileRefernce.save()? If not, then Is there any workaround to save a file from web application in Flex without asking user where to save file?
i have movie clip with Images and button Save and class MyProject.as how save images with my MyProject.as, with help FileReference.save? what to write in code? how code should look like? tell me good people I want to write everything in a separate class
Is there a way to get rid of the save dialog box in filereference.save()?I want to specify the filename and location rather then letting the user do it.
At my college, they have CS4 (master suite) and at home I've got CS5 (design premium). I can save files in CS5 as CS4 so they can be read at college (by Flash) but I have to do it via the "save as" every time I save. After a couple of times, it get rather irritating. Is it possible for me to save in the usual way (as if it was a CS5 document) without the save as dialog every time I save my work?