ActionScript 3.0 :: Exploding And Converging Bitmaps
Apr 29, 2010Does anyone have an idea of how I could go about creating something like the flying particles in the intro of this Audi site? URL...
View 3 RepliesDoes anyone have an idea of how I could go about creating something like the flying particles in the intro of this Audi site? URL...
View 3 RepliesI'm trying to figure out the best way to compare a single bitmap against perhaps an array of saved bitmaps to see how close of a match it may be to any one of the bitmaps stored in the array. Right now I'm running a for loop that uses the bitmapData.compare() method to try to compare to see how much of a variance there is but... to be honest I'm at a loss as to how to use the resulting data to do so. Does anyone know of any good method to accomplish what I am trying to do? Forget looking at my code it's a waste of time because simply, it's not working.
View 4 RepliesI'm developing a Flash AIR app mostly on Windows Vista, but recently tried to do a little light editing on my MBP running Snow Leopard as I have access to the excellent jEdit text editor there. Unfortunately, the Windows Consolas font I have chosen for on-screen error messages, tool tips, etc seems to have issues with displaying properly in the Mac version of Flash CS4.
Consolas displays well in Flash CS4 editor mode (and other Mac apps like Text Edit), but as soon as I try and test the Flash file, the font basically explodes, drawing huge black triangles all over the screen. The app continues to work properly, but it's almost impossible to use as everything is covered in triangles. I tried clearing the font caches already as well as deleting the ASO files/test movie.
I need to create an exploding image in Flash and want it to look as good as when using "cc particle explosion" in After Effects. Is this possible and can anyone point me in the right direction to creating this - or downloading an existing effect / component that I can drag and drop on an image.
View 1 Replieslike this but with text. (text is pixely and on mouse over does the above)
View 1 RepliesMcGiver's submission to the Flash Game Contest was his footer, a very cool blast-a-tank game. In his game if you hit some scenery it dissapears with the bullet. That is SO COOL! How did you do that? McGiver's Blast a Footer: [URL]
View 2 RepliesI have a movie clip that I add Bitmaps by using addChild(). I was wonding how would I go about displaying the next image that I added because as of now it is stuck on the first image.
View 3 RepliesI was wondering which method would be the most efficient (run faster)...Lets say I have multiple layering of animations, say a moving sky, then birds, then fireworks ordered respectively. Is better to have one bitmapdata (called BD) then do a copypixel of sky, then bird, then firework at every tick (I'm using a timer) and put it in one bitmap.
Or is it better to have 3 bitmaps (and put into 3 different sprites) with the animations separated, so when I update the birds I don't have to update the sky.share any knowledge on pros or cons of using multiple bitmaps vs using one bitmap in that situation. Aside for the increase of initial memory used.
I'm loading some external images and trying to get them to smooth, but for some reason it's not happening. i've been trying everything i can find on the internet over the past 10 hours or so, and nothing's worked.The code on my movieclip (first frame) is:
[code]...
my images are very high-res, so i know it isn't a resolution issue. anyway, they look crappy when they're sized down too. also, i'm pretty sure smoothing is the issue, because i have a very similar image in the library (a detail from the same shot, and similar resolution, etc.), and it looks great when i allow smoothing in the bitmap properties panel.
I want to know if there is a faster way to take several bitmaps and arrange them one after another in a single layer in a movie clip.
This is how I am doing it currently.
Stage 1: Import the bitmaps to the stage
Stage 2: Distribute the bitmaps to layers
Stage 3: Make the first bitmap a movie clip symbol and cut the other bitmaps' frames
Stage 4: Go into the symbol, create a new layer, and paste the frames.
Stage 5: Click and drag the other frames into one layer, one after the other.
I now have a single movie clip with all my bitmaps ordered one after the other in the timeline.
I have a Bitmap where I can draw on. After some seconds I want to let the drawing fade away and blend over to the original picture/bitmap. Can I do this with the blend mode by drawing the original bitmap on it? I tried something like this and of course it isn't right. Just copying the alpha channel if I get the documentation right.
dstBitmapData.draw(srcBitmap,null,null,BlendMode.ALPHA,null)
dstBitmap = new Bitmap(dstBitmapData);
I want to put some percentage to the destination bitmap. So that after doing this some frames the original picture will be visible. As the user can interrupt this by start drawing again I want to use the BitmapData object dstBitmapData.
I wish to add some 3D bitmaps to my 2D game. Everything is currently drawn via copypixels into the only movieclip and that is rendered. Am I correct in that I need to create (for example) a sprite, add a bitmap to it, perform all my 3d transformations and then simply .draw the result into my bitmap? If so are there any simple examples of doing so, also what about camera, focal length, perspective etc. etc. Are they taken into account before the .draw?
View 0 RepliesI'm working on better performance on mobile device with gpu rendering set to on. I use only bitmaps for animations, but I have some doubts:
1. If my content is poor bitmap (jpg or png file) should I cache its container as bitmap?
2. Shoud I use cacheAsBitmapMatrix for my bitmaps to have smoother animations or poor bitmaps are already optimized?
I have a jpeg that I have exported to actionscript via the library. The jpeg class is "adcouncil". If I want to add it to the stage I would use the following code:
Code:
var adcouncil = new adcouncil1(150,150);
var myImage:Bitmap = new Bitmap(adcouncil)
printMC.addChild(myImage);
The problem is that I want to ad these Bitmaps to the stage dynamically. My first instinct is:
Code:
var adcouncil = new this["adcouncil1"](150,150);
var myImage:Bitmap = new Bitmap(adcouncil)
printMC.addChild(myImage);
[Code].....
Trying to add EventListeners to Bitmaps.Can I add an EventListener directly to a bitmap?If I load an image to a UILoader then addEventListener to the UILoader instance that works just fine, but if I use a Bitmap instead, nada...I could load the Bitmap into a Sprite and add the EventListener to that, but would prefer the direct method...
View 4 RepliesSometimes I have a problem publishing to an xfl file. The bitmaps in the library do not save with the xfl save to the LIBRARY folder. I've tried resaving as another .fla before re-exporting as an xfl. but I do not seem to find the proper way to overcome this?
View 1 RepliesI'm having an issue where after 24 bitmaps are placed inside a sprite, the first bitmaps start to disappear. When the last added Bitmaps get removed from the display list, the older ones start to reappear. Go here and check it out: http:[url].... draw 24 dots or whatever with the pencil tool (the only one that draws to a bitmap). You should notice that the 24th dot will cause the 1st one to disappear. Undoing (which simple removes the top bitmap/sprite) causes the 24th one to be removed (which is correct) but the 1st one also reappears which means its still there just not visible .Here are the relevant methods:
Code:
private function nextShape() : void {
newShape = new Sprite();
newShape.mouseEnabled = false;[code].....
I'm confused by a tip in Adobe's own documentation that says:Avoid using gradients, because they require many colors and calculations to be processed, which is more difficult for a computer processor to render.I understand how this would be true in a vector shape fill, but they aren't specifying vector. It seems to be implied they include bitmaps too, since the next couple tips are bitmap related.If they do in fact include bitmaps in this tip, can someone explain to me how this is possibly true? In a bitmap a pixel is a pixel. I don't see how it matter that the pixels form a gradiated color or not, the software still has to read and write each pixel regardless.
View 1 RepliesI'm looking for a good method to resize bitmap images to fit within the constraints of a container object whose size will change based on the browser window dimensions, etc. Basically, it needs to scale to fit. I'm using the following for resizing by height. "largeImage is a bitmap object.
[Code]....
I would like to have a SWC file with many bitmaps stored in it, which can the be called and loaded dynamically when they are needed.The SWC has been made, with the Bitmaps set to export.In my main class I am running into trouble trying to access these classes.Different sources are offering different advice, could someone advise the best way to gain access to these classes within the SWC, and the best way to access the SWC from within my file.URL]they offer a solution which involves having to statically name the classes at runtime (these arent exported bitmapdata classes but same idea)this second link is a person describing a solution to the problem described in the first link. His solution involves what appear to be either flex or command line compiler directives
View 2 RepliesI'm working on a flash website that consists of 3 frames (1 = preloader, 2 = instances of symbols, 3 = the main page/view). I've gone through and optimized all my static bitmaps/movieClips and removed any symbol that I've exported for ActionScript from exporting in the first frame. Even after all these steps frame one is still the longest to load (797kb on a 32.6 kbps simulated download), only showing the preloader when the whole file is at 86% complete. Any further steps to take to get frame one's size down?
View 3 RepliesI've imported 29 bitmaps into my library (gifs, each one 1728x1152, size ranges from 4-14kb, in each case the vast majority of the image is transparent). I add each one to the stage in the following manner:
var img1Data = new img1(1728,1152);
var img1Map = new Bitmap(img1Data);
containerMC.addChild(img1Map); // MovieClip to which all of the bitmaps are added
[code]......
I has a series of bitmaps which have been broken apart in flash, I want to know if it is possible to go into these bitmaps using their bitmapdata and edit them based on information on the arrays that I get. I.E. I want to delete the transparent pixels each one has.
Obviously I can do this by hand in photoshop or just using the lasso tool, but I have several thousand bitmaps that I have to edit, so I'm hoping theres a way to do this through code.
i've used a Loader and URLRequest to download a .png from the internet and add it to my display list. since it's already a bitmap, does it have built in bitmap data already? or do i have to create the bitmap data myself?also, why does the same trace statement return false in the mouseMoveHandler when it outputs true in the displayImage function?
var imageLoader:Loader = new Loader();
imageLoader.load(new URLRequest("http://somewebsite.com/image.png"));
imageLoader.contentLoaderInfo.addEventListener
[code].....
I would know if with AS2 it's possible to load programmatically a bulk of images and save them in an array; then how to attach programmatically each image to an empty movieclip.
I know how to do this in AS3 however it seems impossible in AS2.
I'm trying to position an image on top of another image based upon the make-up of the smaller image. The smaller image is a cut-out of a larger image and I need it to be positioned exactly on the larger image to make it look like a single image, but allow for separate filters and alphas to be applied. As the images are not simple rectangles or circles, but complex satellite images, I cannot simply redraw them in code. I have quite a few images and therefore do not feel like manually finding the position of each image every and hard setting them manually in actionscript. Is there any way for me to sample a small 5-10 sq. pixel area against the larger image and set the x and y values of the smaller image if a perfect match is found? All the images are in an array and iterating through them has already been set, I just need a way to sample and match pixels. My first guess was to loop the images pixel by pixel right and down, covering the whole bitmap and moving to the next child in the array once a match was found, leaving the matched child where it was when the perfect match was found.
View 4 RepliesAlright I'm programming in actionscript 3, using flex as a compiler. I have an 16x16 large PNG file that is basically a square outline like this:But in more noticeable colors.
I want to draw an 11x11 grid of these squares, so I use these for loops:
for (i1 = 0; i1 < 11; i1 ++)
{
[code].....
I'm working on a project which draws circles continuously at framerate and animates them around the stage and I'm running into performance issues.
I'm already converting all objects to bitmapData as soon as they become static. My question is, will converting the circles to bitmapData as soon as they are drawn increase performance? In other words, is animating say, 200 bitmaps (with transparency) faster than 200 vector circles?
Are there any drawbacks to this technique? (I'm thinking opacity problems maybe?)
If they were more complex shapes than circles would the answer be different?
I have a bunch of Bitmaps stored in the library and I want to display some of them on the stage via actionscript. All I need is to attach each of them to a MovieClip and use addChild() on the stage. Also I want to be able change the attached bitmaps dynamically.
What is the easiest way to do this?
I have an array: possessionPics.
Code:
trace(possessionPics[0])
returns: [Object Bitmap]
[Cpde].....
Just gets me: TypeError: Error #1034: Type Coercion failed: cannot convert []@1c87df59 to flash.display.Bitmap.