ActionScript 3.0 :: Converting XML Data To PNG Through Flash
May 22, 2010
I just started using AS3, I'm trying to do is pipe xml data to flash to be stylized in a text field, then save as transparent png. Right now I have a problem; when I run the script with this.addChild(this); it takes a snap of only the first entry, and only the first entry to output. If I leave that out, it sends all 750 entries to the output screen, and it parses the xml like it should (w/ out the text clear at the end, it applies all 750 entries filter styles to the one textfield). So I'm assuming everything is working right with parsing the xml, and it's just getting hung up. I'm assuming I have this setup all wrong, but it's the only way I could get it to work... this.addChild(this); just seems wrong, but it's the only way I could snag root, and write it.
Here's my code (I don't need this all proper for use on a website or anything, just to run a few times to batch out some xmls).
ActionScript Code:
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.text.TextField;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
[Code] .....
There's no code implemented for saving the bitmap data to png. I'm using cs3 right now, so no FileReference.save() feature. I plan on finishing it on a buddies box w/ cs5. On a side note - Would it be possible to compile this with flashdevelop to get this feature? I've never used it...
Here's an example of my xml:
<game titlem="filenameoutput"></game>
<namem desc="name description"></namem>
<manu manufact="manufacturer"></manu>
<year yearmade="19xx"></year>
Probably not the best, but the best I could manipulate the source file w/ regular expressions and sed, and still have it work with the xml tutorial I was referencing. I can try again if it needs to be setup differently. Is it possible in as3 to create a gradient that has one color on top and one on the bottom? I've always failed miserably creating these in previous versions, so I didn't even try.
I get this out put (each row is a different element) and I don't know how to convert it in to a readable value.
it should be number with 9-10 digits. from what I have seen in other sites regarding this specific data (this is the value of the tempo in a midi file) - it looks something like this: "tempo is 06 96 27 (in hexa format)"
these values are ByteArray type. how do I convert them to the readable numbers (or perhaps they contain text)?
I have the job of recreating a flex app in HTML and CSS. The existing app makes considerable use of TextFlow to layout content. For several reasons I need to be quite accurate (within a few pixels) with positioning.
[Code]...
Ideally I'm looking for a library I can use to translate these many attributes into "proper" html and css. The current technology stack is PHP at the back end and javascript at the front end, but there would be little problem in using any other language to do the translation.
Failing that I guess I'll try and write my own, using the api reference as a guide.
I have this code inside my flash to name my navigation menu. Now I want to put this outside flash and load it via XML. How do save my different arrays into a variable for later use in my code?
In my nav fla (what i want to load from XML):
Code: // MAIN MENU ARRAY var mm_array:Array = ["MAIN1", "MAIN2", "MAIN3", "MAIN4"]; // SUB MENU ARRAY
I feel like this should be really easy, but I don't get what I need to do.I have a value bgW[j] stored in "j" equaling a number.But I can't seem to get it to register as a number.What commonly needs to happen to convert this value into a numeric datatype?I've tried a bunch of stuff: eval, parseInt, multiplying it by 1.
So I'm importing this file called tbox.txt and in that file it has a variable, num, which equals 3. Now when I run the debug window, it comes back as num = "3". So its a string. so I do num=num-0 to make it a number instead of a string. And it doesn't work so I do a trace on num and it comes back as undefined.... which is what I dont understand, how can it be "3" and undefined at the same time.
I am developing a mobile project in Flash builder using flex 4.5. I am very new to flex, with some background in Obj-C.urrent Setup:I am passing the text property of a text input component to a second view via navigator.pushview{view.Someview, data}public function doSomething():void{navigator.pushView(Session_View, timeInput.text);This successfully passes the text I put into the textinput to the Session_View instance and I can display that text in a label in the mxml; however, I would like to take the text passed and convert it to an integer to use in my logic.Within Action Script I have tried parseInt() function with no luck.I have also tried to assign data to a variable in actionscript with no luck.
I have to convert a flash file to a big screen it will just be animation in Flash CS4 and there may be jpeg graphics imported into the animation. I have been given screen dimensions to use but they are in millimeters. This is the information I have been given :-
Bumper banners: w- 1,200mm x h- 6,048mm Full screen: w - 8,062mm x h- 5,184mm Small screen: w- 8,062mm x h- 5,184mm
The video needs to be DVD quality full PAL MPEG2
1. What should I do to make this scale properly from Flash on my PC to a big screen tv. Do I need to obtain the size of the big screen in pixels and make the animation this size in flash?
2. Also I wondered if you knew what bumper banner means I have emailed the person I am dealing with back and still awaiting a response?
3. I have been told that it needs to be in full PAL MPEG2 can flash convert to MPEG2 and will this have any affect on the scaling or quality of the animation?
4. Also does it matter what frames per second I use I am using the default of 12 fps is this ok?
I have an animated GIF file that I am trying to convert to Flash using Adobe Fireworks. I can't get the Flash version to loop. I want it to replay indefinetely. I have attached the files so somebody can take a look.
I don't know Flash and the only reason I am using Fireworks (a trial version at this point in time) is because another person said this was the best way to do this.
Does anyone know of an effective way to do this, besides using converters? I created a menu like controller that will control the PPT once it's been converted to a swf. I've tried everything, and am hoping I won't have to just copy the data into an .fla by hand.
I have to convert a flash file to a big screen it will just be an animation in Flash CS4 and there may be jpeg graphics imported into the animation. I have been given screen dimensions to use but they are in millimeters. This is the information [code]...
The video needs to be DVD quality full PAL MPEG2
1. What should I do to make this scale properly from Flash on my PC to a big screen tv. Do I need to obtain the size of the big screen in pixels and make the animation this size in flash?
2. Also I wondered if you knew what bumper banner means I have emailed the person I am dealing with back and still awaiting a response?
3. I have been told that it needs to be in full PAL MPEG2 can flash convert to MPEG2 and will this have any affect on the scaling or quality of the animation?
4. Also does it matter what frames per second I use I am using the default of 12 fps is this ok?
Does anyone know what the best way is to convert a flash file to a .mov or .avi file?I thought maybe if I did "export" to a quicktime movie, it would do it, but when I was looking at all the settings, there are so many of them, I don't know what to choose!I have received specs that the flash file I have need to be converted to a .mov file, and here are the specs:Video must be a minimum resolution of 720 x 540. It will be resampled to 1280x540. Video chould be progressive video, square pixel (1:1) and supplied in .mpgeg2 or uncompressed .mov format.
I have a game that I made in flash, and now I want to take all the movieclips I have and export the images into something that I can use outside of flash. What would be the easiest way to do this? I would rather not use screenshots, plus, I need to keep the transparency.
I want a little greeter guy on my website. I have received a .mov from Adobe Premiere with a transparent background. I opened this in Adobe After Effects, went to composition->add to render queue, I set the output format to FLV with RGB+Alpha and Audio included. I then uploaded the FLV to my webserver, opened the FLV from my server into Flash Professional, chose a FLVPlayBack Skin and selected the "already deployed" option for the source of my file. I then File->Export to a .swf and upload the .swf back to my server. When I embed this into my home page, the guy does not load all the way, I get about 5 seconds worth. The SWF is around 50 KB and the FLV is around 18,000 KB. The video is 1 minute 15 seconds long.
Is there a application (Or way in coldfusion/VB.net) to be able to convert a swf to a image file? It needs to be ok quality and needs not to be too slow.
I am writing a script that lets a user record their voice and then saves the file as an MP3 format. I'm recording using [URL] which works fine and the WAV is saved. However, I need to convert that file, on the drive, to mp3 before I move it along the pipeline.
I have a lot of experience in the PHP/Python/Ruby/C world, but this is my first foray into AS3,
I have a flash file where i load a remote SWF file into my own, now what i want to do is convert that remote SWF file into a gif that i can save onto my server. The remote file is a swf that has a variable amount of frames, and i somehow need to be able to figure out the amount of frames (i presume), and take a snapshot (picture) of every frame, to turn the taken pictures / into a gif file. That's what i THINK has to be done, however i have no idea if it's even possible to take pictures / snapshots of remote swf files.
I am trying the following to record a live video from my Flash/AIR application: I take a "screenshot" (BitmapData from stage) each frame. I convert each pixel to yuv format like this (V2):
[Code]...
I'm not really a codec expert (just starting ;)), so I don't know what to make of most of that. Here is a zip that contains one of the frames and the video output. What should be visible is a green smiling pear, without any artifacts. Remember the size is 600x700 and the format yuv420. Best to view such raw image files with irfanview, IMO. Don't mind the noise, its from pushing against my microphone ;)
I have to convert a flash file to a big screen it will just be animation in Flash CS4 and there may be jpeg graphics imported into the animation. I have been given screen dimensions to use but they are in millimeters. This is the information I have been given :-
[Code]....
The video needs to be DVD quality full PAL MPEG2
1. What should I do to make this scale properly from Flash on my PC to a big screen tv. Do I need to obtain the size of the big screen in pixels and make the animation this size in flash?
2. Also I wondered if you knew what bumper banner means I have emailed the person I am dealing with back and still awaiting a response?
3. I have been told that it needs to be in full PAL MPEG2 can flash convert to MPEG2 and will this have any affect on the scaling or quality of the animation?
4. Also does it matter what frames per second I use I am using the default of 12 fps is this ok?
Fireworks or Flash This question is Not Answered.(Mark as assumed answered) My website was completely designed in fireworks. I'm told that can't be done but home 2000.com, there it is. I now want to switch to flash. I am having an understanding problem in converting the Fireworks png files to Flash.
1. Fireworks I saved as a swf file.
2. I tested the swf. (The file is basically a one-page display with rollovers that would each create a large picture in the middle of the screen when rollover. I believe when I call a rollover might also be called a hotspot. the problem I'm having with the saved swf file is all of the images continuously execute like a movie without stopping. This is in contrast to the purpose of the display area. It is supposed to only display the large image when someone rolls over the hotspot.
3. A third and separate issue is converting the Java navigation displayed on the left side to flash. I have asked many times for help on this and other forums and nobody can seem to come up with a way that I can duplicate, fairly closely, the navigation system that I'm using. it's nothing more than the all typical looking tree menu with two basic issues.
a. Swap out the Menu on top of screen that holds the six hotspots. b. Swap out the large display area that holds the new eight hotspots. c. Display an image or text in the TVBox, our term for small display area at bottom of navigation frame.
If you go to my site you will see one of the displays on the home page. Is this a large display area with the eight hotspots that I'm trying to export.
I have managed to put some captions on a video file and would now need to get this video back into flv format to put it online;..I tried with the cs3 video encoder but it wouldn't let me.... So my questions are:
1. Is it actually possible to convert my swf file into flv with cs3 video encoder ...which would be logical as it is a flash file...
2. What is the best option I Have to convert my swf file with captions without losing the captions...
What is the best way to convert an animation created in Flash to a .mov file. I've tried the export movie command in the file menu, changing various settings in the publish settings in Flash and and in the Quicktime options boxes. But the resulting .mov file has all kinds of fragments and artifacts. Has anybody had any luck creating animations in Flash and then converting them into a format that can be assemble in iMovie?
how to convert my curent Flash Professional project into an AIR project.
I've been using Flash Pro to do animations with some minor coding in the frames, and I'm using Flash builder to do the coding. However I realized that my application needs to be able to use the File system, which means I'll need to use AIR's API. However there's no way for me to import AIR's library to my flash builder project
We are attempting to convert a flash frame into a JPEG without using the Flex SDK or other adobe tools. Right now, we have a flash file that passes binary data over to a .cfm page, which uses the following code to change the headers:
<cfset var = GetHttpRequestData()> <cfcontent type="image/jpeg"> <cfheader name="Content-Disposition" value="attachment; filename=#url.name#">
I have a flash video(.swf) on my website and i want it to convert into such a format so that it remain available from iphone/ipad. Is there any possible way of doing so? Can i convert it into HTML5? If yes can anyone suggest the process and if no, can anyone suggest any other method?
I am using Adobe Air to get data from SalesForce, and present it in a datagrid. I am using a query to get the data, and then put it into an arraycollection that is bound to the datagrid, this works correctly and the data is displayed. The problem is that I want to convert the Account Id in the Event to show the account Name. To do this I am using the following code:-
_serviceWrapper.query( "Select * From Event order by StartDateTime asc", new mx.rpc.Responder( eventQueryHandler, faultHandler ))} protected function eventQueryHandler(qr:ArrayCollection):void { var acctIdss:String = ""; for each(var contact:DynamicEntity in qr) { [Code] .....
This works and displays the Account Name, the problem is that when I use this script and then Sync Changes to SalesForce all the records that have been displayed are identified as needing to be syncronised even if they have only been displayed. If I skip the function eventQueryHandler, and link my query to the OnQueryResult function then there is no problem, but only the Account Id can be displayed. How can I stop Air marking these records as having changed, or is there a better way to achieve this?