ActionScript 3.0 :: Getting Selection Of Movieclip Using JPEGEncoder Or Bitmap/Data?
Nov 23, 2009
I have a swf that includes another swf (my main movie (video_mc)) and i want to be able to take 'photos' of that swf using clicking of the mouse.I have tried using JPGEncoder and Bitmap/data but neither seem to give me the option to specify the point of origin for my movieclip.Is there a way to get either JPGEncoder or bitmap to take an image of a 100x100 box where the mouse is on the movie clip i've been pulling my hair out for days now! I've also searched everywhere but cant seem to find the answer.
I'm drawing a textfield onto a bitmap which I use as texture for a 3D object. I'm listening for Event.change, and so whenever the user adds a character I redraw the texture. But to really give the 3D object a 'interactive textfield feeling', I want to draw text selections and draw the caret (the blinking text cursor), but by default these a not drawn when using bitmapData.draw(textField), nor can I find a Event to listen for 'textSelected'.
//is there any event that catches text selection / blinking of text-cursor? textField.addEventListener(Event.CHANGE, redrawTexture); //... //is there any way to draw text selection / text-cursor in the bitmap? bmpData.draw(textField);
I'm cutting my teeth in actionscript 3 on a game that has a character running through a world. So, I have set up my Hit Testing by using the bitmap data hit test method, since I figured my world is going to be destructible - it'd be nice to update the level and then redraw it and have the character interact with the new change. (That works beautifully) I am however; a bit confused as to how I have my hit Testing set up. I've been messing around with it, and it works for now - but I'm not sure why.. currently, I have a character set up by using a class I built and using a series of animations I created. So, this character has a walking and falling animation, etc. This is a movie clip.
Then there's a bitmap 'emptyBitmap' with bitmap data created - however; I never really added this as a child to the character. This is sized to the dimensions of my character. My level is created as a movielip, then it's drawn to a bitmap - when the level movieclip is changed, the bitmap redraws, and that's how this updates.
Is JPEGEncoder available in Flash? Or does it work only in Flex ? Which package should I import? It gives me the following error: 1172: Definition com.adobe.images:JPGEncoder could not be found.
I am working on a project in which I am suppose to matain an array of movieclips, and I can also convert the movieclips into bitmap data. so I would like to know which one is the best to use either maintaing movieclip array or bitmap data array.
I have a movieclip on the stage(lets call that selection movieclip) that once a button is clicked is going to open another movieclip(call this slideshow) I am trying to remove the selection movieclip when you launch the slideshow movieclip.
Error: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display:isplayObjectContainer/removeChild() at mc_work/clickHandler3()
I have a DataGrid and I set the DataProvider to my data. When my data changes the DataGrid loses the selected row and the scroll bar jumps back to the top. How do I maintain the selection and scroll position?
I've got a comboBox with defined data and label fields. On Event.CHANGE I capture the data field. I need the comboBox to default back to the user selection if they should navigate to another screen and then come back. Normally I've got an array of labels that I can use to just lookup the index: comboBox.selectedIndex = labelArray.indexOf(user selection); In this case I don't have labelArray. What I really want to do is something like this (only with real AS, not fake):
comboBox.selectedData = storedDataString or, if the data array is accessible: comboBox.selectedIndex = comboBox.data.indexOf(user selection); Is there an easy way to do this, or should I just suck it up and add yet another global label array?
Now I have added my tree just below the list and I have saved counting from 10 to 19 in one.xml, 20 to 29 in two.xml and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list
when i press TAB, the selection goes to another movieclip, instead of the next text field.i read a lot of threads, but could't fix this bug,
so far (after lots), i got this code: [AS] var textAR:Array = ["nome_txt", "contacto_txt", "email_txt", "morada_txt", "pais_txt"] var textCounter:Number = 0 Selection.setFocus(textAR[textCounter]])
I never realized that fl.getDocumentDOM().selection doesn't retain the selection order... <sniff>. I was hoping to build relationships based on the order. I guess I took if for granted that tools like Maya and Max store the selection buffer in order of what was selected. I'm trying to avoid: Select Object, <Press 'Parent' Button>, Select Parent, <Press 'Parent' Button>
i am attaching a number of _mc (my_mc) with a for loop. Inside each my_mc is an input textfield (my_txt)I want to click on my_mc.my_txt and select the textfield .the following code allow this and i can enter text from the keyboard however I want to add text from a _mc keybooard on screen (here called myBtn_mc).As soon as I click on myBtn_mc of course I lose focus ... i have tried to use a variable (select) to keep scope&focus
I've created a prototype that will copy the pixel data from a movie clip then create a JPG image from it via PHP. It works perfectly. But when the MovieClip (called mcImage) contains a Video Object loaded with a streamed FLV, it won't copy the pixel data to the Bitmap object. The image generated is white. Here's a sample code:
var oBitmap:BitmapData = new BitmapData(nW, nH, true); var oMatrix = new Matrix(); var oColorTrans:ColorTransform = new ColorTransform();
i did a function the captures the stage and save it to bitmap datai want to display that bitmap data on a different frame what code should i do (the bitmap changes becuse the capture function triggerd alot);
I have made a little drawing program for my daughter, and I have worked in the ability to save and load images that you have made. It's a simple line drawing thing, but she's 3, and it works.Whatand I'm still new with Flash and AS3) is that I can "addChild" to put the jpeg on the stage, but it's on (or over top of) the drawing area. That means that when I start to draw, I don't really add to the picture, instead, it's drawing behind it. I used the line drawing tutorial as the basis for this little app, the basic code is :
Code: public function DrawMain(){ graphics.lineStyle(theLine,0x000000); //default to black lines
I am trying to do an image capture while in full screen, however the full image area is only partially captured, or the coordinates are off. In the source files you will see a few of my attempts commented off.
I'm trying to create sort of an eraser to remove sections of a bitmap on stage.
I have achieved this by creating a MovieClip in flash that is a circle and exporting it as a Class called Hole.
Now I use this MovieClip to erase a circle section of the image using the following.
var mat = new Matrix(); var ct = new ColorTransform(); var hole = new Hole(); mat.translate(x,y); image.draw(hole, mat, ct, "erase");
Now what im trying to do is scale the size of the circle depending on a certain variable but no matter what I try the scale doesn't seem to change and. The size seems to stay the same as I drew it in Flash. I tried adding the following line
hole.width = hole.height = size;
I even created a class file called Hole and the size as a parameter
var hole = new Hole(200);
This didn't work either it still appeared to have the same size. I have even tried altering the scaleX and Y values with no success.
I am adding a bunch of bitmap data (images) inside a canvas bitmap (using copyPixel) which is added to the stage (addChild(cavasBitmap)) how can I remove a bitmap data from a canvasBitmap?
I have to take a snapshots form my webcam every 5 minutes. Now my script is whit a button and its working but my file have to take the picture alone and then again whitout button to send them? I saw something on the net but when I try to do it its not working.
Is it possible to get the bitmap data from a component using ActionScript? I dynamically load an image. onComplete I create a Flex Image component and add the loaded image to the source
[Code]...
Later I want to create a new Image component and get the bitmapData from the first Image. I have tried this canvas.getChildAt(0) Which seems to give me the Image, but I can not figure out how to get the bitmap data. canvas.getChildAt(0).bitmapData; gives me a compile error "... undefined property" how ot get the bitmap data so I can use it in my new Image component?
Can anyone point me to demos or source code for creating reflections in actionscript? I want to create the effect of an object sitting on a reflective surface.
I would like to extract the most common color of a bitmap. My first idea was to do this by looping through the bitmapData and extracting every pixel color and storing it in an array. But the function has to be as light as possible so my question is; Is there a more lightweight approach to achieve this? The function is used to extract background color of a Bitmap.
I am working on somethign at the moment which allows a user to use a local connection to send and receive bitmap data. But I am havign a slight problem. Ok so at the moment I am using code from the bytearray live jpeg encoder to encode bitmap data as jpeg and then send it on to another swf opened at the same time when I click on an mc in the send swf.
So here is my code:
ActionScript Code: // CODE INSIDE OF SENDER var localConnection:LocalConnection = new LocalConnection(); import asfiles.encoding.JPEGEncoder;
[Code].....
But what ends up happening each time is that it seems to draw only the bottom right quadrant of the mc I am targeting. As shown by the screenshot I have provided. When the user clicks the first of the blue buttons it should send the whole bitmap.