Actionscript 3 :: Changing A Sprites Bitmap

Dec 30, 2009

As of right now, I am trying to create a tiling effect for a game I am creating. I am using a tilesheet and I am loading the tiles to the sprite like so...

this.graphics.beginBitmapFill(tileImage);
this.graphics.drawRect(30, 0,tWidth ,tHeight );

var tileImage is the bitMapData. 30 is the Number of pixels to move retangle. then tWidth and tHeight is how big the rectangle is. which is 30x30 This is what I do to change the bitmap when I role over the tile

this.graphics.clear();
this.graphics.beginBitmapFill(tileImage);
this.graphics.drawRect(60, 0,tWidth ,tHeight );

I clear the sprite canvas. I then rewrite to another position on tileImage. My problem is.... It removes the old tile completely but the new tile positions farther to the right then where the old bitmap appeared. My tile sheet is only 90px wide by 30px height. On top of that, it appears my new tile is drawn behind the old tile. Is there any better way to perfect this. again, all i want is for the bitmap to change colors

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Batch Bitmap Conversion To Sprites?

Feb 26, 2012

I'm looking for a method or tool that allows me to make the following: import several bitmaps (pngs that are frames of an animation) convert each of those bitmaps to a sprite, put each sprite into an array in order (spriteArray_name.push[bmpSprite]). The array itself can be just exist as a static array in resource file. This isn't exactly a complex task, but I've got thousands of frames for different animations, and I really don't want to do this by hand.

I'm not an AIR programmer but, would that be a possible easy solution? It just seems like there would be an easy way to Batch this process. I'm currently using Flash Pro cs5.5 for the project. I am currently doing this at runtime, basically creating empty spites and drawing in the bmp data on the fly. But, its not going to work. I need to do this precompile (or during compile if that's possible).

View 4 Replies

ActionScript 3.0 :: Printing Sprites With Scrollrects Using The Bitmap Printing Option Fixes And Prints Most Of The Stuff In The Sprite

Jun 19, 2007

I have a sprite that has a scrollbar that uses the scrollrect feature. The sprite has several bitmaps and textfields. When I print the outer sprite (The one with the scrollrect) all of the textfields outside the scrollrect are cut after the first line. In case anyone else is having problems with printing sprites with scrollrects using the bitmap printing option fixes and prints most of the stuff in the sprite. Excluding all textfields outside of the scrollrect. This however can be fixed partially by embedding your fonts.

So now the only problem left is printing multiline textfields that are outside the scrollrect. P.S. Imho the scrollrect should have nothing to do with the printed area of the sprite because the printJob.addPage has a printarea parameter.

View 3 Replies

ActionScript 2.0 :: Changing Bitmap With SWF?

Dec 10, 2009

I have a swf I'd like to make a minor change to. Basically I need to change one bitmap, I've tried decompiling it but then it fails to recompile. Is there anyway to hack into a swf file and just change a bitmap?

View 5 Replies

ActionScript 3.0 :: Changing Bitmap Of An Object

Jan 24, 2010

I've got another simple question. I have a mc who's bitmap that is associated with him I want to change.

[Code]...

When BlankClip is first created, I want to tell it to either have the same image as Block_0 or Block_1. Looking it up online, it seems like I have to use BitmapData somehow, but I'm really unfamiliar with things...I've been working on this same code for about 2 hours...

View 2 Replies

ActionScript 2.0 :: Changing Bitmap Path On Library

Jan 5, 2007

Is there a way to dynamically change the path of the Bitmap on the Library? Using actionscript?

View 9 Replies

ActionScript 3.0 :: Bitmapdata.hitTest - Bitmap 'emptyBitmap' With Bitmap Data Created

Feb 3, 2009

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.

[Code]....

View 1 Replies

ActionScript 3.0 :: Use The BitmapData Property Of A Bitmap And Pass It To The Constructor Of A New Bitmap Object?

Aug 20, 2009

I know the topic of "duplicating" movieclips is a hot issue with the new virtual machine. Luckily, I understand the implications. I only am [currently] interested in duplicating a Bitmap. See, I load an image from an URL using 'flash.display.Loader.load', which is a non-blocking operation in Flash Player.However,I may use multiple copies of the loaded image (which is reported to be a Bitmap, naturally) in the display list at the same time.Hence, I naturally do not want to load the image from an URL every time, because I don't want to wait for a non-blocking call to complete. Nor do I need to - I mean one copy is already loaded, so it should be possible to just "duplicate" it, right?

My idea is to do use the bitmapData property of a Bitmap and pass it to the constructor of a new Bitmap object. I have not tried the following in action, but I want to hear whether any of you did and if the following would not work, what would:

Code:

var original_bitmap: Bitmap;
var copy_of_original_bitmap: Bitmap = new Bitmap(original_bitmap.bitmapData);

LiveDocs mention that the BitmapData being passed to a Bitmap constructor is "being referenced", which to me might suggest it cannot be used twice? There is also the BitmapData::clone() method, which I am not sure is applicable here or not.I know this is a lot of talk instead of just trying this out, but I test so much Flash Player code daily just to see "what works" (which should be documented instead by Adobe),

View 4 Replies

Flex - Function To Redraw Bitmap On Sprite Without Passing In Said Bitmap?

Feb 22, 2011

If I have a BitmapData that's already been drawn onto a Sprite. Is there a way to redraw the BitmapData onto a Sprites Graphics object without having to invoke beginBitmapFill and passing in the same BitmapData?

View 1 Replies

ActionScript 3.0 :: Drawing From Bitmap To Bitmap Overrides Earlier Graphics?

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

ActionScript 3.0 :: Copying A Rotated Bitmap Into A Bigger Bitmap?

May 9, 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 (larger bitmap) as follows:

Actionscript Code:
public override function copyToBackBuffer(db:BitmapData):void{ if (active)  var drawRect:Rectangle = new Rectangle((currentFrame-1) * frameWidth, 0, frameWidth,

[code].....

View 5 Replies

Actionscript 3 :: Update A Portion Of A Bitmap With A Pixelbender Instead Of The Whole Bitmap?

Feb 17, 2012

In pure AS3, I have a pixelbender and a large bitmap. The pixelbender is configurable with a distance parameter to affect only a small area of the bitmap. The problem is that the pixelbender is executing over the whole bitmap. What would be the best way to update only the effected region of the bitmap? Given this config:

[Code]...

View 1 Replies

ActionScript 2.0 :: Bitmap Font Text Drawn To Bitmap

Oct 8, 2006

Is there a way to write a bitmap font right into the bitmap being desplayed? Mabey better worded: myBitmap.draw(image, t) draws a picture is there a way to draw text? I'm stuck even if its just a work around in some way I would like to know... (the current work around i have in my head is writing it in a movieclip turning that into bitmap data and drawing it... esentially creating a prototype answering my question... but a built in way would be easier probably).

View 2 Replies

Actionscript 3 :: Bitmap Too Big - Limitation Is In Bitmap And Loader?

Mar 30, 2011

In AS3, I am loading a png from a zip file (nochump's zip library through ByteArray to Loader). The png can be up to 45k pixels wide but only 120 tall. This creates a problem in flash, as images can only be ~8000 pixels wide. A possible solution would be to split the images into 6 columns somehow. This would probably need to be done in the ByteArray state, because the limitation is in Bitmap and Loader.

View 2 Replies

ActionScript 3.0 :: Draw Bitmap Instead Of Export Bitmap?

Nov 5, 2009

I'm using Sandy to animate some objects in 3D. What I currently do to images which are EXPORTED in the library, I want to do to some bitmaps that I create using the DRAW technique. But it wont work :-(

CODE FOR 'CREATED BITMAP' :
ActionScript Code:
var bData:BitmapData = new BitmapData(myObject.width,myObject.height);
bData.draw(mask5);

[Code]....

Sandy doesn't seem to treat the 'created' bitmap the same as those that are exported from the library.

View 0 Replies

Actionscript 3 :: Create A Bitmap From Another Bitmap?

Feb 24, 2012

Letīs say I have a bitmap with 3 colors: red, green and blue (not mixed)

What if I wanted to make a bitmap of the red part of the first bitmap?

Iīd like to take the red pixels from first bitmap (and its positions), and make another bitmap.

View 2 Replies

ActionScript 3.0 :: Find Bitmap In Another Bitmap

Oct 13, 2009

I haven't worked very much with bitmap manipulation and I need to create an app that can find a bitmap (or a pattern of pixels really) in another bitmap.Are there other methods of doing it besides iterating through the pixels and using getPixel()?I'm of course looking for the most effective solution.

View 14 Replies

Flash :: Use The CS4 Tool's On A Bitmap Image After Tracing The Bitmap Image And Applying My Settings?

Aug 7, 2009

Use the flash CS4 tool's on a bitmap image after tracing the bitmap image and applying my settings?

View 10 Replies

Flex :: Changing Cornerradius Of Label And Changing Arrow Of Combo Box

Aug 14, 2009

How do I change the corner radius of a Label component in Flex. Tried applying style name, and the setStyle('cornerRadius',9) methods, but doesn't work. How can I change the arrow image in the combo box control to a different image?

View 4 Replies

Duplicating & Changing Movie Clip Without Changing Original?

Aug 31, 2009

I want to create another button on the main menu of my flash site. I want to take one of the existing buttons (which are set as movie clips) and modify it to show a different menu name and page link. BUT when I go into my library and "duplicate" my movie clip, change the instance name, drag it to the stage and attempt to modify it, the original changes as well. I need to keep the original the same and create a new one with the same code, frames, etc but with different static text. I keep going in circles

View 1 Replies

Importing The Images/Sprites?

Apr 10, 2011

If I am to import an image and I wish to use it as a sprite or something like that; How do I remove the white areas? For example, if I was going to create a custom cursor or something like that, an I was to use this image: Image - how would I remove the white areas, so that they are transparent. I would also like to know if it is possible to set where the center of rotation in an image is?I do all my image work on Photoshop, if that is of any significance.

View 1 Replies

ActionScript 3.0 :: Add Same Images To 2 Sprites?

Oct 29, 2010

How do i add the same images to 2 sprites?The below code doesnt give an error but only adds the image to 1 sprite[code]...

View 2 Replies

Actionscript 3 :: Joining Sprites Together?

Nov 13, 2010

So created a Sprite to which I add other Sprites which are game tiles. Each tile is 60 x 60 px big. In result I've the Sprite with about 200 childs (those tiles).When I try to startDrag() the container sprite the lag when moving it is very noticeable..

Is there a way like to join the tile Sprites so the container would have only 1 child Sprite instead of 200? Because it lags so much probably cause it needs to move (change the x and y) all those 200 tiles.. Am I correct?In this case I can't use the cacheAsBitmap property, cause user can zoom in or zoom out the map..

View 3 Replies

ActionScript 3.0 :: Draw Sprites With XML?

Aug 12, 2010

I'm currently building a slideshow application using the MVC pattern, as it stands the application works by going to the next picture by clicking the photo or controlling the slides with a next/prev button.

i am trying to add additional navigation so that there are thumbnails of the images loaded with XML so the user can click the image and go straight to the image clicked on.

thats easy enough i could add buttons manually with thumbnails in them but it would tedious to update the photography or artwork when it comes to increasing or reducing the number of photos.

so what i plan is that ,when the application loads it reads and counts the images Thumnails in the XML file,then the AS3 generates thumbnail icons according to the amount of images counted in the XML File, then places them on the stage in a sequence next to each on the stage. as a sequence of thumnails with can then be used to navigate around the library with more control and is easy to update simply by changing the XML file.[code]...

View 0 Replies

IDE :: Possible To Insert Sprites Directly?

Feb 12, 2009

How can insert sprites from the IDE? When I press f8 the only options are MovieClip, Buttons and Shapes. If I export to ActionScript I can change the class to Sprite, but I want to insert a Sprite directly from the IDE.

View 2 Replies

ActionScript 2.0 :: RGB Changing Is Working But Not Changing All The Time

Feb 1, 2006

basically when you load the .swf it changed everytime u re-load it , i want it to keep on changing even when the user hasnt reloaded the image

[Code]...

View 1 Replies

ActionScript 2.0 :: Playing Sprites On Key Frame

Feb 17, 2009

I am trying to do some scripting in flash. I have some sprites and need them to playing one by one in the main, one in each frame. Then when they are complete let the movie move on to the next frame. how can I do this?

View 1 Replies

ActionScript 3.0 :: Removing All Filters From Sprites?

Apr 27, 2009

I'm making a picture gallery. I have a thumbnail container, which contains a mask and a dynamically generated mc called "thumbnail_mc". Thumbnail_mc contains all the sprites of the thumbnails.When I click on a thumbnail, the thumbnail get's a glow filter added to it. Now, I want to remove all filters on all the other sprites before I apply that filter to the Sprite.

This is what I'm trying to do:

Code:

thumbnail_mc.children.filters = [];

How do I do that?

View 3 Replies

Bluring Sprites And A Moving Background?

Sep 30, 2009

i um want to make a sprite flash movie but i cant afford flash cs4 or 8 so i only have mx heh.. >_> i guess im good at animation but im not as good as alvin earth worm or rpg fan but i want to be good as them is there any way to blur like they do in flash mx? it can be easy or hard i'll work as hard as i can to get it right

View 3 Replies

ActionScript 3.0 :: Attach Sprites Using TweenLite?

Aug 19, 2010

I'm creating visual effects using TweenLite, which currently only manages the tweens for me, can I also attach a sprite at a specific time? (using "delay")

Basically I want to use TweenLite to attach/remove sprites apart from just tweening existing objects.

View 1 Replies







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