ActionScript 3.0 :: Drawing Small Tiles Into One Large Bitmap Container
Jan 29, 2010
I have a project that is drawing ~10,000 small tiles into one large bitmap container - it's a mosaic. In Flash proper and in FireFox it takes about 20 seconds to complete the drawing. Very acceptable. In Chrome it takes about 1:30 and in IE it takes roughly 3:00 - both too slow to be acceptable to the client - who of course reviewed with IE. I have Flash set to run at 45 fps - and the images are populated by a Timer - at 2 ms intervals. Maybe 2 ms is too fast? But in my testing 1ms was slower as was 3ms, so I kept it at 2. And it works fine in FF and Flash...
View 4 Replies
Similar Posts:
Aug 4, 2011
I have 2 grid of 15x15 using BitmapData (One of 32x32, and one of 10x10). I've try 2 ways :1) Create multiple bitmap
ActionScript Code:
for ( var y:uint = 0; y < m_height; y++) {
for ( var x:uint = 0; x < m_width; x++) {
[code].....
View 0 Replies
Aug 9, 2011
I have the Bitmap data from a Loader object and I would like to slice it up into 32x32 squares to use as tiles. What is the most efficient way to do so?
View 2 Replies
Dec 29, 2010
I'm working on a game, and to keep performance good, instead of addChild'ing 50 new sprites to the stage every second, I decided to have each player draw to their own bitmap, and then to the 'master' bitmap. This introduces an issue though: the second player would override all data the first player has put into to bitmap...My basic debugging proof of concept:
Code:
// bitmap test
import flash.display.Bitmap;
import flash.display.Bitmap;[code]......
View 1 Replies
May 11, 2010
I'm download the file "bestof search" and I wonder if it is to correct or add to the browser worked with small and large letters. I have come to work in small characters. I would like to let me work with small and large letters.I hope you understand me what I want!Sending my AS which is in FlashThe XML file contains uppercase letters.So once again I would like to give me the browser (Search) work with small and large letters.
View 1 Replies
May 27, 2011
I'm download the file "bestof search" and I wonder if it is to correct or add to the browser worked with small and large letters. I have come to work in small characters. I would like to let me work with small and large letters.Sending my AS which is in Flash .The XML file contains uppercase letters.So once again I would like to give me the browser (Search) work with small and large letters.
View 5 Replies
Nov 28, 2011
How to distort the dimension of an image like from left side little small and from right large.
View 1 Replies
Sep 14, 2011
best way to read in like 200k words and have them each tween from the center of the screen as small dots and tween up to the word filling the SWF then "fly through my head" not literally, but you probably get it...
View 2 Replies
Apr 29, 2004
i sort of asked this before but never got a clear responce to it. this is sort of a two part question. one i have a dynamic gallery of images with a small picture that you click on that loads a bigger picture. I would love to be able to just have one photo that loads into the bigger mc and also the small mc. right now what i am doing is making two size photos a small 47x47 and a large141x141. does anyone know how i can use the same photo for both mc's second question. if that works will it make the small photos take forever to load since their sorce is a large photo?
View 5 Replies
Feb 17, 2010
On the stage I have a movieclip (Container, originally 200px width) and inside it with a progressbar movieclip (originally 700px width), scaled with Free Transform Tool to fit the parent container. The width of the container changes run-time while resizing the scene.
In ActionScript I have a function which should set the progress bar width according to a calculated percentage value:
private function updateProgress(event:TimerEvent):void
{
var barWidth:int = _container.width;
var progress:Number = _stream.time / _stream.duration * barWidth;
_progressBar.width = progress;
}
My problem is that the progressBar even at full time (100%) is only at 1/4 of the parent container. I assume that it comes from the symbols original size.
Can I correct this programatically, or I must redesign it with the "designer"?
View 2 Replies
Jan 24, 2012
I'm using a 3800x3000 bitmap as a background of a game.
Now, I first show the whole bitmap - the landscape -, and than zoom in at the characters. I'm using TweenMax from GreenSock, but even with this advanced tween class my bitmap doesn't move and scale smooth.
I'd like to work with smaller bitmaps too and scale them, but than I'll lose the quality, and I can't blur the bitmap to hide the quality loss, since there's a terrain in the bitmap too, and I don't want to blur that.
View 2 Replies
Dec 30, 2010
Let's say I have some background made up of 4,000 small vector images (doesn't matter what they are, say flowers or stars or something). Once this background is set, these small items won't move or animate. The background will stay the same.What I would do, rather than keep 4,000 sprites on the stage, I would create one single background "Bitmap" which has all the sprites drawn onto it once.Is this still a good idea if that Bitmap is so large it covers the entire stage (which may be quite large for larger monitors if using NO_SCALE and fullscreen or something), or is it better to break that large Bitmap into 4 or more smaller ones placed seamlessly alongside eachother to seem like a large one?
View 2 Replies
Dec 12, 2009
When you use Graphics object to draw very large shape(that does not fit in 10000x10000 pixels) stroke width may become much wider than value specified in lineStyle function.For now I have only two options:
1. When drawing line you can split it into several lines. However this trick does work only for drawing lines, polylines and polygons. There is no way to apply this to drawing circles and ellipses. Well, we can approximate circles via bezier curves, but this approach seems to be very inefficient.
2. Perform manual cliping. But this require manual implementation of different cliping techiniques, and I think ActionScript does not suit well for this sort of task. And again there is need to approximate visible parts of large circles.
View 1 Replies
Feb 21, 2009
is copyPixels not as speedy as it should be when Tweening large bitmaps ?
copyPixels does a wonderful job on images 500x500 or less, but on larger images, my motion is not as smooth.
all i'm trying to do is slide an image from stage.stageWidth to 0 (right to left).
View 1 Replies
Jan 29, 2010
I have a project that is drawing ~10,000 small tiles into one large bitmap container - it's a mosaic... In Flash proper and in FireFox it takes about 20 seconds to complete the drawing. In Chrome it takes about 1:30 and in IE it takes roughly 3:00 - both too slow to be acceptable to the client - who of course reviewed with IE...
I have Flash set to run at 45 fps - and the images are populated by a Timer - at 2 ms intervals... Maybe 2 ms is too fast? But in my testing 1ms was slower as was 3ms... so I kept at 2. And works fine in FF and Flash...
View 1 Replies
Feb 8, 2010
Requirement: Create single very large bitmap data which contain some 30 PNG images loaded and for each image it should have some text. Images and text are loaded dynamically (AS2 code. Images are stored in a remote server). The bitmap data display should show 8 images at a time and corresponding text. We can see rest content by scrolling (kinetic scroll is implemented). How can I go for it?Some questions:Is there any limit for size of bitmap data ( As per link there is restriction on the height of the bitmap we can create in AS2 (max value is 2880 which is not enough for some 30 element list If we create individual bitmap data for 30 individual PNG files, we find some jerks in scroll. How can we have smooth scrolling?
View 5 Replies
Sep 3, 2009
I have a MV called container. It has no specified size. I add to this container a child, a loaded SWF. And then, later, I draw this container into a BitMapData.
Code:
var jpgSource:BitmapData = new BitmapData (container.width, container.height);
jpgSource.draw(container);
On most of my loaded SWF, bitmap is the correct size of the original loaded swf. But sometimes, the bitmap is smaller and I miss part of my draw..
Does a my container take the size of his child ?
View 1 Replies
Feb 6, 2011
I have the following display hierarchy:- - container- - - objectI need to draw 'object' to a BitmapData instance which matches object.getBounds(stage) rectangle area. So the first part is easy:
ActionScript Code:
var rect:Rectangle = object.getBounds(stage);
var bmp:BitmapData = new BitmapData(rect.width, rect.height, true, 0x00000000);
[code]......
View 2 Replies
May 31, 2010
I'm a bit new to the ActionScript world, and I'm trying to get a custom class drawing a button correctly.I have a .png of a planet that I want to use for the image, this is how I load it:
imageRequest = new URLRequest(bmpName);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
imageLoader.load(imageRequest);
[code].....
View 1 Replies
May 8, 2009
what i need to do is basically a motion trail on a bitmap.
I want to continuously draw a bitmap onto itself while previous versions are faded into the background, similar to a smoke type effect.
View 1 Replies
Feb 11, 2010
today i started some particle generator class that will move particles over the stage via drawing in a Bitmap. Everything works well with low amount of particles, lets say 1000, but for my surprise when i added 10 000 particles the frame rate dropped drastically. And i am saying that since i made the same particle generator using MovieClips instead of drawing in Bitmap, the performance test i run on both classes showed that the Bitmap class with 10K particles on my PC works in around 10-12 FPS, and the MovieClip variation in around 20-21 FPS with the same amount of particles. The particles are identical and both classes are using linked list system to move the particles. So the only logical conclusion is that something is not right with the drawing function.
Code:
private function drawParticles(e:Event):void{
// clearing the _pZone Bitmap of the previous data
_pZone.bitmapData.fillRect(_pZone.bitmapData.rect,0);
_pZone.bitmapData.draw(_blankMc);
[code]...
View 1 Replies
Jul 2, 2009
i m making a drawing application .i want to save my drawing wit out bitmap classs because when i reload that it is not editable. So can any one tell me how to save my drawing to server with out bitmap .because i want to reuse it in flash.
View 1 Replies
Jun 23, 2009
Basically, I have a BitmapData object which is acting as a virtual screen.
I have a MovieClip which I want to render to the bitmap using the same transformation as though the bitmap were the screen. However, the MovieClip is not attached directly to the root
The BitmapData.draw() method takes a Matrix as an optional parameter, which I think I need to set as the MovieClip's localToGlobal transformation matrix. However, I don't know how to obtain or construct this!
View 2 Replies
Sep 26, 2011
As the heading dictates, i want to place bitmap files on the faces of the 3D object that i have created.Basically i found this tutorial code on a 3D rotating cube that is able to be rotated by the mouse. I have modified it to change its shape from a cube to a 'plane' or rectangular style object.
Code:
var vertsArray:Array = [];
var facesArray:Array = [];
[code].....
View 0 Replies
May 5, 2009
Over the weekend i put together an MP3 player in Flex and just managed to figure out the SoundSpectrum.
It is working as expected.
I am facing problems when it comes to using a bitmap.
Right now, my "Analyser" class pulls the data from SoundMixer.computerSpectrum.
I then use that data with the drawing API to create a simple analyser. You know, just spikes.
Here is the code for that part:
Code:
private function update(e:TimerEvent): void
{
SoundMixer.computeSpectrum(ba, true);
var n:Number = 0;
[Code]....
Ok using common sense here, I am telling flash to take a snapshot of the Analyser and draw it to the bitmapData.
However, i cant seem to get this working. I am not using the dispose() method to clear the bitmap so id expect to see a mess of points (similar to if i removed the g.clear()) but nothing happens.
View 1 Replies
Feb 9, 2010
I'm trying to use a bitmap fill, but I can't seem to get it to work.I'm using FlashDevelop with assets imported from CS4 - this isn't the problem, I can instantiate the asset I'm targeting perfectly fine, so I suspect that it's a problem with what I'm trying to do. Here's my code:
Code:
//get the bitmap data from a grass symbol
//grass symbol IS present - can be added to stage fine
var grassBMD:BitmapData = new BitmapData(155, 80);[code]....
Nothing gets displayed in the box, so I'm suspicious that I'm not allowed to use bitmap fill in non-primitive shapes.
View 6 Replies
May 5, 2009
I'm using the following code to load a .jpg into a movie clip container the problem is I need the container to be a specific size I tried loader.content.width = 50; and loader.content.height = 50; the height part works but the width doesn't work my image just expands beyond the stage width.How do i set the size of the movie clip container?I don't care if the image gets distorted i have a resize script for the images before they are loaded into flash.[code]
View 1 Replies
Jun 9, 2009
I found this quite amazing website [URL] and If you see the website when you zoom out there is no animation neither interaction with the content of each container, I mean, if you see the first one, the home container there is a animated banner, however when you zoom out that banner stops. Also, you if see, every time you zoom in a container it loads its content, if you zoom out and zoom in again it loads again the same content...this is cool because you're not wasting too much memory and you're not creating a huge .swf file.. Are they generating some kind of bitmap thumbnail for each container everytime we zoom out or what?
View 3 Replies
Nov 29, 2009
Is it possible to place two or more instances of the same loaded from a loader Bitmap in one container?
View 1 Replies
Aug 30, 2007
I'm trying to load a bitmap using this: [URL]. It seems like the preload is working fine. I'm just having trouble loading the bitmap from here. it works without the preloader but I can't figure out what's not making it load when it's done.
Code:
function loadTransBitmap(id){
this.createEmptyMovieClip("holder_img", this.getNextHighestDepth());
var mcl:MovieClipLoader = new MovieClipLoader();
preload = new Object();
mcl.addListener(preload);
[Code] .....
I noticed after the load is complete, I traced the width for targetMC, which is where the image should be preloaded..and it comes up as 0. So it seems like there's nothing in the holder_img container. But it preloads something so I don't know what the problem is.
Also: 'id' from the function is just the image (images/1.jpg)
View 1 Replies