ActionScript 3.0 :: Use CopyPixels To Copy Part Of Stage?
Dec 3, 2009
Is it possible to use copyPixels to capture part of the stage directly into a bitmapData object?
Just wondering because in my situation using captureBitmapData.draw(stage, matrix); is causing performance problems, even without the matrix. I read that copyPixels is fast so I was wondering if there's a trick to use that directly on the stage without the draw part.
What I'm essentially doing is screen capturing a part of the stage and putting it in a a window, using a loop to update it over time since it contains animation. Works great in one of my FLAs, but chugs in the other so looking to optimize the code to a bare minimum.
View 1 Replies
Similar Posts:
Jun 3, 2011
I think the title tells it all, but just incase, I will clarify. Is it possible to copy part of the stage to the clipboard in order to paste that into an email or word document.
I need this as an option to the user, not during publishing... So basically, a button on stage that copies a specific area/coordinates.
View 1 Replies
Jun 23, 2011
Do any one have idea of copying only a small portion of a image, further it could be made as mc. Or any other method to do this in as3? Not manually breaking the image and convert as mc.
View 1 Replies
Mar 19, 2006
I'm looking for a way to select an arbitrary rectangle from a Graphic Symbol (or Movie Clip) in an arbitrary layer and to copy and paste it somewhere else.
View 1 Replies
Dec 10, 2009
I have created an animation (see attached) where the stage can be dragged from left to right to reveal hidden areas off the edge of the stage. Unfortunately I need to add buttons containing links to websites within the dragable movie symbol and I can't work out how to do it.
View 2 Replies
Oct 8, 2009
I have drawn a pecked line route, sitting on its own layer, using flash tools, over a base map. I have then gone Insert>Symbol>movie and I now need to get a copy of this route into the movie's white area. I expected perhaps when right clicking on the layer, an option called copy to movie and an ability to select the movie name.
View 2 Replies
Jun 18, 2010
i'm using jpeg encoder script. in the script example, a movie clip is converted to jpeg. differently i want to convert the stage but only some part of it such as x:320-500, y:0-600. is it possible?
[Code]...
View 3 Replies
May 15, 2009
They show their work as the page�s background which can be resize with the browser window, but their navigation always stays the same.I know how to achieve the resizing effect, but it resizes the whole stage including navigation.
View 2 Replies
May 23, 2010
I have found an example which should show things better. It is here [URL]
Basically, on that stage, they have several movie clip objects..One for the actual card, one to hold the components, one to perform actions etc. When you drag and drop items to create your card, you can then send it via email. However, what is sent is only the card part of the whole stage, not the parts which hold the components and actions. So, they basically send one movie clip component of the whole stage, rather than everything which is on the stage.
View 7 Replies
Mar 24, 2010
I would like to know how to achieve an effect like in Flash Element TD 2 http:[url]....when you select a tower or a creep you can see a real time zoom of what you select on the right side panel.
View 5 Replies
Jul 5, 2009
I've download a flash template from:[URL]I just wanted to use the menu, so I copy the movieclip and paste it into my stage then use AS 3.0 to control it.It's working fine when I only have 1 item on the menu.But when I paste more than 1 they all seem to share the same attribute, when i edit the text of 1 the rest get edited too.
View 3 Replies
Feb 9, 2011
I am trying to paste a bitmap (any bitmap) onto the stage. I just get the box outline on the stage. I have imported several basic bitmaps into the library. I tried dragging and copying and pasting but I always just get the outline. I don't know if it means it can't be pasted or there is a setting to display it. If I copy the same bitmap and paste into word for instance I do see the image.
View 3 Replies
Feb 4, 2012
I have a custom menu with moviclip inside, I want to click in movieclip, and send to my custom stage a copy of movieclip: [URL]
ActionScript Code:
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.utils.ByteArray;
import flash.text.engine.EastAsianJustifier;
[Code] .....
But I have this error:
TypeError: Error #1007: Tentativa de instanciao em um no-construtor.
at testeMenu_fla::MainTimeline/teste()
Here my .fla: [URL] My question is: how to convert a e:Event in MovieClip?
View 9 Replies
Aug 26, 2009
I have a question, not necessarily about coding, but about setting up a file. I want to create an expandable ad, but I don't know how they work. Do I make the stage the size of the expanded part? How do I only have the unexpanded part act as though it is a different, smaller size.
View 2 Replies
Mar 19, 2002
How can I make images load dynamically thru button onto the main stage in the same frame of the main flash movie.
Can I load a movie onto a specific part of the stage?
View 6 Replies
Aug 6, 2005
i have a menu which has 10 items. there are sub menus for each of them. the submenus total to 40 items. and when i click on ech of these submenus, then i need an image to appear on a part of the stage. Now, I need the same effect for ech of the image. Say when i click on the 1st submenu of the 1st main menu, the image of an apple comes from the bottom the stage to the centre of the stage.
Now when I click on any other submenu - say 1st submenu of the 3rd main menu, this apple image should go off the stage from the top and an image of mango should appear from the bottom of the stage to the centre of the stage (same as how apple image appeared). So, basically, i need any image to come from the bottom of the stage to centre of the screen and whn a diff image is calld, the image on the screen shld go off frm centre to the top.
View 3 Replies
Oct 7, 2011
A web channel streaming service streams to a certain IP range, it only checks the IP in example.com/cmd.php?id=xxx (channel number) and outputs an rtmpe stream URL, nothing else.How do I trick it to get my local URL instead of the one on their server? I have considered squid proxy, but is there some way to do it with a firefox plugin or greasemonkey script?
Edit:I will try to specify:It's a streaming service from an ISP and cable provider. They stream for free to people on their IP's. On their webtv page, which is called webtv.example.com, there is a flash player. If you are not on an IP from their ISP, you can't stream anything but the test channel.When you try to change channel via. javescript:videoplayer_changechannel(xxx) it makes this HTTP request:
[URL]
If you are on one of their IP's you will get an RTMP URL, like this:
[URL]
This is what the flash player requests, and if it get's this response it load the channel requested. There is no HTML on the php page, just the URL. Note that the rtmp URL is static.If you are not on one of their IP's it will return a random sentence (something stupid, the programmers having fun).I wan't to trick the flash player into getting the right value, even though it's not on one of the ISP's IP's.
View 1 Replies
Oct 27, 2010
How can I copy files with FLfile.copy method in CS4? I need any samples with all classes.
View 0 Replies
Sep 26, 2009
I did a function for blit scrolling successfully using Draw(), but then I heard that copyPixels is faster. Unfortunately, I'm not having the same success with that as I had with draw();
Specifically, no matter what I try to use for the source image, it keeps saying that it can't be coerced into a bitmapData object:
Code:
TypeError: Error #1034: Type Coercion failed: cannot convert SourceBitmap_bm$ to flash.display.BitmapData.
I tried referencing the bitmap in my Library (That's how I'd prefer to do it, copy from an item already sitting in my library) that has base class "flash.display.BitmapData", yet I get the error. I tried putting the bitmap into a movieclip and copying from that, same error. I tried copying from an offscreen instance of the mc (which worked fine with draw()), same error.
It's a mess by now because i've tried so many things, but this is my code:
[Code]...
I see are for copying pixels after loading in an external file. Does anyone know of an example that works with items already in library?
View 2 Replies
Sep 5, 2010
I need to load a very big image on AS3 (currently sized at 8192x8192). I am aware that it does not fit any of the limits imposed by Flash regarding drawing to screen or creating a BitmapData of that size. I just want to load the image so I can copyPixels() some parts of it here and there.The thing is, I'm loading the .jpg file of that size with no problems. The size is recognized correctly from my Loader object. I load it like this:[code]But I am greeted with the #2015 "Invalid BitmapData" error usually reserved for BitmapDatas that are too big. The error also happens if I try to do a copyPixels(), which is what I need to do.Is there any workaround I can use so I can get data from an image this big on AS3?
View 1 Replies
Aug 4, 2009
How would I go about using CopyPixels to build an isometric map? CopyPixels takes a specific rectangle and copies that onto a bitmap.. But how would one use that to build a seamless isometric map?Building a square top-down tiled map would be very simple as copypixels pastes each tile next to one another.. But for Isometric Maps, this would be different as some parts of the CopyPixels rectangle is over lapped into other tiles.. and this would 'erase' the bitmap of the other tiles currently on the bitmap..[URL]Fig2, is what happens when you try to do a copyPixel over an existing bitmap, assuming the white is transparent space.
View 0 Replies
Nov 12, 2010
Traditionally, when blitting in old 2d games, flips and 90 degree rotations could be achieved with almost no performance hit. The reason for this is that the effect an be achieved by simply changing the order that pixels are copied.
I'm using copyPixels in Flash to get maximum performance. Is there any way to do a flip or 90 degree rotation using copyPixels? (Without pre-calculating and storing the flip/rotate). I couldn't find a way to do it, but it seems like it should be possible, because it is a very common technique in 2d games (well, not so much now that modern 2d games use 3d hardware acceleration... but Flash doesn't let us do that, so we need to use the traditional 2d techniques)
View 2 Replies
Mar 1, 2012
I am making a custom renderer using the copyPixels function for my Haxe/Flash game. So I have this kind of code :
buffer.bitmapData.copyPixels(m_CurrentSkin, RECT3, POINT, null, null,true);
where :
-buffer is the bitmap where all my scene's objects are drawn
-m_CurrentSkinis the BitmapData that contains the current frame of the object to be drawn
Every time m_CurrentSkin contains a BitmapData that have never been drawn (the first time that an animation frame is drawn for example),I have a memory leak that is not garbage. However if m_CurrentSkin contains a BitmapData that have already been drawn (when the animation is played a second time for example), there isn't any memory leak.If I comment this line there is no leak so the problem comes from there.It seems that a copy of the BitmapData is cached in memory but I have checked in my code and there is no cacheAsBitmap explicitely set to true.
View 3 Replies
Jan 19, 2009
Can anyone tell me if I can copyPixels with an irregular shape instead of just a rectangle?
View 0 Replies
Oct 1, 2009
I am playing around with an old Zelda: Link's Awakening tile set, and was trying to make an application that will display the current selected tile.
I am well versed in as2 but have never had need for the bitmap classes until now. I have found examples of the copyPixel() function that work but could not get it to work in my code.
I have attached the .fla file I saved it as a CS2 (Flash 8) file. (I use CS3 and/or CS4 depending on which computer that I am currently using. This one is in CS3)
ActionScript Code:
// -----
// ----- Author: Nathan Sepulveda
// ----- Date: Oct 1, 2009
[Code]....
View 6 Replies
May 8, 2011
I have a bitmap which has several frames (packed along the horizontal axis). In order to render them I copy it to the backbuffer as follows:
ActionScript Code:
public override function copyToBackBuffer(db:BitmapData):void
{
[code]........
View 0 Replies
Jun 14, 2009
I'm working on my second flash game and have been stopped in my tracks trying to cache MovieClip Animations into arrays of BitmapData frames. To capture the frames I have set up a loop which runs through the frames in the MovieClip and use copyPixels to get a snapshot of the graphic.This works fine if the MovieClip to cache does not contain any child MovieClips, but if it does, these MovieClips are frozen on their first frames. I've been looking at MovieClip.getChildAt(index) in attempt to navigate their time lines but because that returns a DisplayObject it seems impossible.
So, my question is: Is it possible it to use copyPixes on a MovieClip and also step through child time lines, or should I be using sprite sheets?
View 2 Replies
Aug 4, 2011
I'm not much of a scripter. I get by editing scripts similar to my needs. I learned a few things about blitting and I'm trying to get a rectangle area of a MovieClip to blit to a location on the stage. But I run into the error "Invalid BitmapData" which makes sense because I'm referencing a MovieClip and not an image. Is there a different AS3 command other then copyPixels that would work for a MC?
I know VCam would seem an obvious solution, however VCam scales to fill the entire stage. I only want to fill a small rectangle on the stage. I've already attempted to edit VCam with no success. Its probably not the same principle, but would it be possible to blit the matrix VCam uses?
View 2 Replies
Mar 17, 2011
I have a BitmapData object with transparency (the sourceBitmapData parameter). Every time I use copyPixels() to copy it onto another BitmapData object the transparent pixels replace whatever is beneath them. I would like the copyPixels() function to simply ignore these fully transparent pixels (0x00) and NOT copy themBTW, I've tried setting the alphaMerge to true but that doesn't solve the issue - the whole source object just goes black and ignores ALL transparency.EDIT:
Here are the code snippets;
var b:UIComponent = new UIComponent();
b.graphics.beginFill(color, opacity);
[code].....
View 3 Replies
Jan 21, 2010
I am having problems dealing with the alpha channel of an image. Basically I do this:
1. I load an image (.png) and keep it in a bitmap:...
[Code]...
View 4 Replies