ActionScript 3.0 :: Slow Performance With Bitmap Erasing?

Nov 26, 2008

for the past couple of weeks I've been learning AS3, and for a school project I'm doing a remake of the popular DOS game Liero. Everything is working fine, I got a layer of dirt that I am shooting away, but the problem is that after a few hundred bullets, the game starts to lag heavily whenever a shot is fired.I'm using a simple bitmap and a brush to erase the parts where the bullets hit.

// Drawing stage
bmap = new BitmapData(1100,800, true, 0);
dispBmp = new Bitmap(bmap);

[code]...

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Erasing Parts Of A Bitmap?

Mar 20, 2009

I'm in need, again, of some assistance. I'm making a game with 2 pictures. and the concept is built on that you erase part of the top-bitmap to see the bitmap under.How can I accomplish this?I tried to wrap my head around the bitmaps and the draw and the FillRect but can't get it to work completely.Basically I want 2 bitmaps, and a cursor which erases parts of the top one to show the one underneath.

View 5 Replies

ActionScript 3.0 :: Erasing A Circle From Bitmap Data?

Sep 29, 2009

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.

View 2 Replies

Flash :: Erasing A Specific Selected Portion Of A Bitmap?

Apr 20, 2011

I have two layers namely topLayer_mc and bottomLayer_mc. The actual vector drawing is drawn on the top layer and onmouseUp of the tool, a bitmap copy of the vector graphics on the top layer is taken and added as a bitmap to the bottom layer. The top layer is cleared subsequently. It is working for the pencil tool.Now I need to create an eraser tool. This is where things get tricky. In the application there is an option to save the image as png, so alpha has top be preserved. So the coventional method of draw a brush using the vector and using the draw method of bitmap will not work. Of course, on a visual level it would work if the brush drawn using the vector is to have the same color as that of the background.

What I need is to excatly erase the pixels.Now I have created a brush tool using the conventional technique and clearing is possible but what I need is to exactly erase the pixels. Is there some technique to draw this ? This is the code that I am using: I have also uploaded the swf and source code, When trying out, please draw all over the stage using the pencil (press Pencil button and start drawing)The source fla is also provided.

View 4 Replies

AS3 :: Professional - Performance In IOS - Animations Run Really Slow (CS5.5)

Feb 18, 2012

I have created an app in CS5.5 for Android and iOS. I have tested on two Android devices and everyingthing works fine. However, on an iPad and iPhone the animations are really slow. Here are some more facts:

1) My project has many scenes and in the problems scene there are upwards of 1,200 frames. But even simple animations run slowly.

2) The frame rate is set for 24 fps.

3) I have created a universal app (iphone and ipad), publish resolution is standard at full screen.

4) Ironically, I have already tried caching as bitmap. That actually slowed my animations even more. I am truely at the end of the line here and don't have any possible solutions.

View 3 Replies

ActionScript 3.0 :: Datagrid Component Performance Slow

Mar 14, 2008

I have a DataProvider object which loads an XML object during instantiation. I set my datagrid.dataProvider to the DataProvider object. There are 13 columns, and approximately 40 rows.

Scrolling the datagrid, and resizing columns has alot of lag. Is this to be expected when using the DataGrid component with larger datasets?

View 10 Replies

ActionScript 3.0 :: Spinning Many Objects With Slow Down The Performance

Aug 27, 2009

I have 500 small objects, I would like for them each to rotate (spin) constantly, I have seen a few methods for doing this, but what would be the best way to do this so performance doesn't slow down?

View 9 Replies

Professional :: Slow Performance Using Anti-alias Option?

Jul 23, 2009

when I create a medium or large text block, Flash (cs4) starts to work very slow, only a objet move or a click on stage takes a lot of time to process. My computer features should be ok... 4gb ram, intel 2 core duo 2.4 hz... The only thing that I think can be a problem is that I'm using Windows Vista 64 bit.

View 9 Replies

Professional :: CS5 Component Inspector Panel - Slow Performance

Aug 31, 2010

I'm curious when Adobe are going to repair the performance issues inside component inspector panel in CS5? Scrolling through the properties of some components is ridiculously slow, 486 like slow...

View 2 Replies

ActionScript 3.0 :: Slow Performance With Full Screen And No Scale

May 10, 2010

I have a Flash movie that runs full screen, but with StageScaleMode.NO_SCALE so that the actual movie size is the same as it would be if I ran it not full screen.

There is a huge difference in performance between full screen and no full screen. This is despite the movie taking up the same screen space.

how I could improve performance at full screen?

View 8 Replies

ActionScript 3.0 :: Performance - Videos Play Slow Using FLVPlayback

Feb 25, 2009

My scene has a video background which scales to the stage size. Then, each section has another video when transitioning in. The problem is that the videos play really slow than they should, very low fps. When there are 2 videos on the stage, it goes even slower. I've tried with embedding videos, using FLVPlayback, wrapping in movieclips, but still the same result. The videos are exported at 30 fps, same rate than the flash movie.

View 3 Replies

Flash :: Incredibly Slow Performance When Going To Previous Frame Of A SWF Movie?

Aug 5, 2011

In a SWF file, when I am using the following code to move backwards to a previous frame, it is incredibly slow -- Taking around 2 seconds. Where as moving forward to next frame takes 30-40 milli seconds.

[Code]...

View 2 Replies

ActionScript 2.0 :: Loading Complex SWF Into Simple Movie - Slow Performance

Jan 27, 2006

In terms of performance, does loading .swfs into a flash movie have any implications. I've been experimenting with loading complex swfs into a simple movie and the complex .swf seems to perform a lot slower within the .swf than as a standalone. The host movie has no other funcitonality other than as a simple container. Is it in general terms better not to load .swfs into a movie but to code everything inside 1 movie ?

View 2 Replies

Actionscript 3 : :Improving Slow Performance Of Drawing Application Using BitmapData.draw()?

May 27, 2011

I am using a custom Flex skin to create an active blur/frosted glass effect on the background of floating Panels, TitleWindows, and other containers (similar to http:url....). There is a background image in the Application skin, and potentially any number of other components above and below the active blur component. Here's some relevant code within the skin:

public static const BLUR_FILTER :BlurFilter = new BlurFilter(16, 16, BitmapFilterQuality.HIGH);
private var _bitmapFill :BitmapFill = new BitmapFill;
private var _matrix :Matrix = new Matrix;[code]....

Unfortunately, the performance of this when the component is being resized, and especially when moved, is poor. There is noticeable drag delay and overall slowdown, and this is with only one popped-up TitleWindow in the test application. There is especially poor performance when components inside the TitleWindow are changed (button hover states, etc.)I've attempted to optimized a little bit by avoiding reinstantiation of the blur filter, bitmap fill, and matrix, but this has had little or no effect. I removed the blur at one point, just drawing the Application to a bitmap, and the performance is still poor, so it's clear that it's mostly the BitmapData.draw() call.

I've read about using scrollRect and cacheAsBitmap, but I'm not sure where to apply these properties (or other optimizations I'm not aware of) within the Application or its components.

View 2 Replies

ActionScript 3.0 :: Getting The Bitmap Rotation Performance?

Dec 15, 2009

I've been developing an application which uses a lot of sprites to create a 'wheel of fortune'-like object. Since I use several filters, sprites, countless calculations, and various other tricks to draw it, it became painfully slow to try to spin that, as flash had to redraw everything every frame.

Needless to say, I took the bitmapData 'snapshot' approach - I drew the massive combined sprite to a bitmapData, removed the original sprites, filters, et al from the display list and nulled them, Threw the BMD into a Bitmap object, placed that in a container sprite so that I wouldn't have to continually use a matrix to rotate from the center when it registers at the top left, and started rotating the container.

Unfortunately, it seems that rotating the container with this 500x500 Bitmap in it is nearly as slow as it was when I hadn't snapshotted it and rotated the whole thing, filters and all. I have already played with the BitmapData's transparency, turned on and off cacheAsBitmap on various combinations of containers and the bitmap itself (hahaha), checked the Bitmap.smoothing property out, blah blah blah, the whole nine yards. Rotating a decently sized Bitmap (thus making pre-rendered/calculated frames a really bad idea) ... how do I make this run at a tolerable speed without eating my CPU and turning the fans on?

View 7 Replies

AS3 :: Performance - Stagesized Bitmap And Update Regions?

Feb 28, 2012

I have a project where i'm drawing to a stageSized bitmap by using BitmapData.drawusing the 'show update regions' feature of the debug player, i can see that the player always updates the whole stage although i changed only a small part of the bitmapdata.Can I somehow make the player only update that part of the screen where there were changes made to the bitmap data?

View 2 Replies

ActionScript :: Flash - Bitmap Caching Vs Image Asset Performance

Mar 14, 2011

i've created a full spectrum color wheel Sprite object that is composed of 1440 vector triangles, or slices if you will. since i want to animate the color wheel, i've activated the display object's cacheAsBitmap property. however, caching the vector as a bitmap does not increase performance during animation it remains slow, jumpy. importing a PNG screenshot of the color wheel into the library with lossless compression, converting it to a Sprite, and rotating this new image asset performs great during animation. why does an uncompressed PNG image asset import out perform the same vector image with cacheAsBitmap property set to true?

View 1 Replies

Performance :: Performance - Hold MouseDown To Increase Speed/power?

Sep 12, 2011

this is what i'm trying to accomplish; With a click on a movieclip (cannon_mc)a shot is being fired (ball_mc)

The longer mouse is down, the speed of wich the ball is fired with should increase.My question to you is;

What is the most efficient way to accomplish this? With a timer or something like this;

[Code]...

View 2 Replies

Performance :: Optimization - Improving Performance With Large #'s Of Objects

Jan 11, 2011

I'm devloping some library classes for flocking/steering behaviours on large numbers of objects (2000+). I'm finding that at < 500 instances, performance is reasonable. As the numbers increase, framerate bogs down.

I've seen remarkable performance with libraries such as Flint or Box2D with ridiculous #'s of particles / objects, so it should be possible to optimize / refactor my code to be a bit better.

I'm aware of the basic optimizations, such as bitwise operations and optimized for loops. Are there any more fundamental approaches I should be considering? For example, currently each instance is a vector-based MovieClip. Would working with BitmapData be more efficient?

View 1 Replies

Performance :: Flex - Using Nested ViewStacks Cause Performance To Decrease?

Nov 4, 2011

Will I take a big hit in performance using nested ViewStacks? Should I strive to handle all navigation in one ViewStack and push children manually or will the affected performance be negligible?

eg.
<viewstack>
<tabnavigator />
<tabnavigator />
<tabnavigator />
</viewstack>

View 2 Replies

Performance :: Improve Flex Performance For Invisible Views?

Mar 19, 2012

We have a medium size Flex 3.6 application that contains around 20 different page views (managed via a single lazy ViewStack) each having multiple components. Most use custom renderers.All model data is loaded at startup and changes to model instances are communicated via binding and/or collection change events.Once the user has viewed each page at least once, all page views are instantiated and happily listen to update events.Which in effect means that each time a model instance changes, all interested views receive that event and compute derived data or trigger item-renderers.I have tested and confirmed this behaviour in a proof-of-concept application. Even when setting a list to being invisible, it still listens to collection change events and invalidates any renderer affected.What would you do?

View 1 Replies

Actionscript 3 :: Erasing A Movieclip?

Oct 14, 2010

I have a fully working flash application, made in as3. Now i dynamicly added a movieclip and i would like to be able to erase that movieclip with a eraser of some sort, my goal is to be able pick up a sponge with the mouse and then start dragging over the movieclip and erasing the parts where i dragged over it.

View 2 Replies

ActionScript 3.0 :: Erasing Drawing From Stage?

Jan 12, 2010

I tried to erase whatever was drawn on the stage by using a similar function in a recent previous post but I'm not getting it.when I try to use it an error says that this is no longer supported. I tried addChildAt() and inserted different Num but it only erased everything including my button.the current code is:
 
var drawing:Boolean = false; 
this.graphics.lineStyle(5,0x000000);this.graphics.moveTo(mouseX,mouseY);
this.addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false,0,true);stage.addEventListener(MouseEvent.MOUSE_UP, onUp, false,0,true);

[code]....

View 2 Replies

Flex - Erasing Components On Canvas?

Oct 6, 2010

The problem is when background of top or below label is changed, the top or below button is erased.

<mx:Canvas width="100%" height="100%">
<mx:LinkButton icon="{icon1}" width="25" x="10" y="10"/>
<mx:LinkButton icon="{icon2}" width="25" x="10" y="100" />
<s:VGroup width="100%" height="100%" id="lst" click="highlight(event.target as Label)" gap="0">
<s:Label />

[Code]...

So do anyone know the possible solution for this problem?

View 1 Replies

Actionscript 3 :: Erasing A Layer Where Mouse Is Over It?

Jul 18, 2011

I got the following question.

i added the following elements to the stage:

homeBg = new HomeBg();
homeMask = new HomeDrawBg();
addChild(homeBg);
addChild(homeMask);

I allready instantiated them in the beginning of the document. But my problem is the following. the homeBg layer is a image, the homeMask layer is the same image but it has a pencil scetch look. What i want is that wherever i move my mouse, the homemask layer should be erased so the bottom layer becomes visible(only where the mask is erased). So how can i tell the mask layer to erase itself if the mouse is over it?

View 2 Replies

IDE :: Erasing Text Effect Masks?

Feb 25, 2009

I'm attempting to create a dry erase board style animation effect in my flash movie where I'm erasing the text, like a dry erase board type effect. I've tried doing a frame by frame mask animation and it's not turning out very well. Has anyone attempted this before? Are there any tutorials or maybe after effects > flash tricks?

View 2 Replies

ActionScript 2.0 :: Blendmode - Erasing One MovieClip From Another

Nov 10, 2009

I am trying to erase one movieclip from another using the blendmode="erase" setting, but can only get it to work on the stage as the parent. This means it erases a hole through everything! The attachmovie also doesn't seem to work as I was expecting and I was hoping that when you drag the movieclip, the attached clip would move with it? If you check out the FLA [URL] you can see whats happening right now and what I want to achieve (diagrams provided in FLA).

View 1 Replies

Actionscript 3 :: Flash: Erasing Area Dynamically?

Mar 27, 2012

flash: Erasing area dynamically?

View 2 Replies

ActionScript 2.0 :: Erasing Lines Drawn With Root?

Aug 20, 2009

How can I erase lines I've drawn using
_root.lineStyle()
_root.moveTo()
And
_root.lineTo

View 1 Replies

ActionScript 3.0 :: Pixel Have Changed To Get The Percentage Of The Complete Erasing?

Feb 2, 2010

I'm working with Threshold on BitmapData class. I need the threshold return the modified pixel (the pixels match with the equation).I need to detect how many pixel have changed  to get the percentage of the complete erasing! I did it with getPixel32/setPixel32 but it's faster with threshold (i'm doing it on 15 bitmapdata at the same time)

pixelChanged += bmp.bitmapData.threshold(bmpBrush, bmpBrush.rect, new Point(this.stage.mouseX, this.stage.mouseY), ">", 0);
 
so, each pixel bigger than 0 should match this equation ... and they will be set to 0 after that (default color value). Next time, because they are 0, pixels are not suppose to change again because 0 is not bigger than 0 ! But it still return me a value, like if the pixel have changed! I've tried with different combinaison of mask/threshold .I join a sample of my problem (drag the triangle and check the output window ... the number increase even if the pixel is transparent 0x00000000)

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved