ActionScript 3.0 :: Transcoding AMF - Turn Vars Into AMF Encoded Binary Strings?
Mar 5, 2009
It is my desire to transmit some data encoded in Action Message Format (AMF3) over a socket to and from Flash. I need to know two things:
1) How to read AMF3 data off a Flash Socket object. I'm assuming it will come through as an array of bytes and that array of bytes must be decoded into actual Actionscript Strings/Arrays/Objects or whatever.
2) How to turn Actionscript vars into AMF encoded binary strings.
I'm trying to write a flash program that will import JPEG's and embed them into an XML string for storage. However, i'm having some trouble with casting them back into Bitmap objects, after encoding and decoding the strings in Base64.
I've used the external Base64 encoding class created by Steve Webster, which seems to work great in encoding and decoding the files, but i'm clearly doing something wrong in my code. I'm not sure how exactly I should be converting the decoded bytecode back into an image object, and get flash to display it. Should it be a bitmapData? do I have to code it via setting the pixels manually? Or can I simply just cast it as a Bitmap object?
here's a snippet of my code to show what I mean - At the moment this will return an error. Other things i've tried seem to return the object as a memory reference, rather than it's actual data.
(trace statement) decoded.readObject() = ���� Error: Error #2030: End of file was encountered. at flash.utils::ByteArray/readObject()"
I'm wondering if theres a way I can turn a variable of strings (separated by commas) into an array?I'm using the loadVars object to import variables from a text file that I'd like to import to flash as an array.For example if the variable I import from the text file looks like this:&myVar=charlie,dog,cat,test&I'd like to get it into an array in Flash like thismyArray = new Array["charlie","dog","cat","test"];
I have this textfield in wich i load some vars when a button is clicked. How can i make a sort of button of the loaded vars? So if i click on the first title; i go to the right txt-file!?
Here's the code so far:
code: //vars instellen //titels var title1:String = "Maan Fotografie"; var title2:String = "Vertigo-/zoomeffect-fotografie";
any one had a function that made strings url friendly. like for example it would turn "Beastie Boys" into "Beastie%20Boys" so it could be used in urls.
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.
I'll start off by saying I'm a newbie, just putting that out there. How do you make a turn by turn multiplayer flash game? I don't know if an engine is made in AS3, PHP, Javascript, or whatever,I made my game already, it's just that it isn'tmultiplayer yet. Basically, there are lines, and each player crosses out a number of lines, and the last player to cross out a line is the loser. I want it where one user crosses out some lines, then presses End Turn, then the other does their turn and then presses End Turn to allow the other player to move his cursor. But how can I get both players to see the same frame and only have one player have the ability to move the cursor during a turn? Is there some easily adaptable multiplayer engine for flash for newbies out there
what changes I make to my source, compiling alway yields either a transcoding error, or a missing definition. The stack overflow link I always put in all my source, to look at for encouragement every time I feel like banging my head against the keyboard.
// Main.as package { // General imports
[code]...
Currently when I try to compile I get the following error...
C:Documents and SettingsGekoDesktopFlash estclientsrcMain.as(6): col: 31 Error: Definition com.bit101.components:Label could not be found.
and if I remove the comment from "var myLabel" or "addChild lines" in Main.as, then I get..
C:Documents and SettingsGekoDesktopFlash estclientlibMinimalComps_0_9_5_srccomit101componentsComponent.as(51): col: 4: Error: transcoding parameter 'embedAsCFF' is not supported by 'flex2.compiler.media.FontTranscoder' C:Documents and SettingsGekoDesktopFlash estclientlibMinimalComps_0_9_5_srccomit101componentsComponent.as(51): col: 4: Error: Unable to transcode /assets/pf_ronda_seven.ttf.
My classpaths are "src", "libMinimalComps_0_9_5_srcassets", and "libMinimalComps_0_9_5_srccomit101components" I'm using Flex SDK 3.5.0.12683 on Windows XP with FlashDevelop 3.2.1 RTM why I'm constantly receiving errors each time I try to build the project?
At the moment i am using vlc to transcode my video realtime and display the output through Flowplayer.The problem is that I am struggling to seek using flowplayer my time gets out of sync between the stream and flowplayer and there are a few other issues.Are there any streaming servers that allow for real time transcoding and allow for a flash player to seek.
I have a video library that i want to create a previewer app for in flash. The problem is that all of the videos are in avi/wmv format. Is there any way to transcode them on the fly to flv format in order to stream through flash? If so then what tools would I need and all that jazz?
Our company is developing the product that includes rtmp restreaming/transcoding server.Our goal is to restream rtmp stream taken from external rtmp server(probably FMS), transcoding it in real-time.By transcoding I mean changing the stream resolution, quality and bitrate.Does FMS privide such a functionality? Which version of server we have to use? Does we have to use additional software such
Here is my problem: We are broadcasting sportevents live to the internet via flash media encoder.At the event locations we mostly have just 2 mbit upstream. So at the moment we are streaming with about 1mbit rate.But we need also streams for mobile-devices and a stream for users without fast internet. So we want 2 more streams with lower-bitrates,but we can't get this through the 2mbit...I am looking for a solutiuon which can transcode about a 1mbit(and may be in the future a 1.5mbit) livestream in to two (or more)lower-bitrate streams.The solution should be scalable,because sometimes we have 7 events at one day on different locations,so there could be 7 input-streams.I've searched the net for hardware transcoders, but didn't find a stable solution and I've tested also transcoding with ffmpeg, but it seems to get problems with timing and key-frames for bitrate switching.
I have the following problem, I am embeding a font in a project with the embed tag and I get the following error "exception during transcoding".
[Embed(source="D:/repo/docs/fonts/FreeSans.ttf", fontFamily="Free Sans", fontWeight = 'regular', mimeType = 'application/x-font')] public var auxFont:String;
I had this same error in Flex but I found that adding "-managers flash.fonts.AFEFontManager" in the properties of the project, ActionScript compiler, Additional compiler arguments took care of it.
I need to compile this project with the Flash compiler and not Flex is there any place in Flash that I can add that argument?
is there a way to resize an flv? i have a client that gave me a set of FLVs that a previous designer made for him. the client no longer has the original mpgs. these flvs are much larger than we need them for the new site, and if i just resize them from flash on playback they look terrible and are an unnecessary longer download. i tried importing the flvs into flash's encoder, flixpro and squeeze and haven't had any luck.
I put the h264 packets into flv file with the flv file format in video_file_format_spec_v10.pdf. I used CodecID=7(AVC) and filled video data with h264 encoded packet. But it doesn't work. The codec lib is x264 with CABAC enctropy. The test.flv file in attachment is what I created using x264. Below is the media infomation about test.flv.
I'm working on creating a widget that displays the local weather forecast. I have the RSS feed I'm working with, but in that feed, there is a tag for <content:encoded> It looks like this:
What I want to do is to be able to grab the URL for the image and use it in the Flash movie..I can parse the rest of the XML just fine and it works perfectly for what I need...except for that one image I want.
When I try to import an MP3 file (specs below) I just bought off Amazon into Flash CS4, I get an error that reads "One or more files were not imported because there were problems reading them." I tried other MP3 files and they worked no problem. Does anyone know if there's a specific type of MP3s that Flash hates? Maybe I need to convert my MP3 to be encoded differently?
I need to convert a base64 encoded string from a server (being sent via amf) to an image. on the server the raw image data (gif / jpeg / png) is being encoded to base64 (which already works fine), and I need to decode this string and display the image in my flash movie.
I've created a simple drag-and-drop dress-up game. The aim is that users will create a monster by dragging and dropping, and that an image of that monster will be sent to me, and I will create a toy that looks like the monster.
So once users are happy with the final look, and have filled in their details on the page, I would like them to be able to click a button that will send me the encoded jpeg of how the swf currently looks. I could then recreate the image using image magick or something similar, I guess?
I realise that this may require PHP, but as I have never used it before I thought that perhaps it may be possible to use getpixel to get an encoded text string of the stage and then send that to myself via "mailto"?
I found an old thread which showed how to get javascript to send flash a variable obtained from the URL which loads it's html page [URL].. It works a treat in Firefox but for some reason in IE it doesn't show the swf file it merely shows a white box where the swf should be and a scrollbar next to it.
I have this code which Im using to pass data in JSON encoded format to php. Is there a way I can check at the php end if it was received and beamed in proper format? var people:Array = new Array(); var person:Object = new Object(); var url:String = "[URL]"; var request:URLRequest = new URLRequest(url); var requestVars:URLVariables = new URLVariables(); [Code] .....
I 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?