Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Dripping Blood Effect - BitmapData Fun


I was planning on playing around with the BitmapData object during christmas time (snow) to familiarize myself with its awesomeness, but I got impatient and decided to do dripping blood for halloween.

The way it will work is I am going to compile this effect into a transparent windowless movie, and run it inside of a div tag that completely covers a webpage. The desired effect will be blood dripping over the usual website's content.

Here's the source, feel free to use or improve upon. I'm sure there are performance improvements that can be made. It fades to a sort of gray before it disappears, and I would have liked a browner black, but eh, close enough.

BloodEffect.as

Code:
package
{
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.filters.ColorMatrixFilter;

public class BloodEffect extends Sprite
{
private var timer:Timer;
private var fadeTimer:Timer;
private var drops:Array;
private var bmd:BitmapData;
private var bitmap:Bitmap;
private var dropPath:Sprite;
private var fadeColorMatrix:ColorMatrixFilter;
private var clearBmd:BitmapData;
private var clearBitmap:Bitmap;

public function BloodEffect()
{
// define the fading color matrix - reduce Red, subtract Alpha
var matrix:Array = new Array();
matrix = matrix.concat([.96, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, -5]);

fadeColorMatrix = new ColorMatrixFilter(matrix);

// init the droplets
drops = new Array();

for (var i:Number = 0; i < 10; i++)
{
var s:Sprite = new Sprite();
drops.push(s);
}

// create the BitmapData and Bitmap objects - made for 1280x1024 res
bmd = new BitmapData(1280, 1024, true, 0x000000);
bitmap = new Bitmap(bmd);
addChild(bitmap);

addEventListener(Event.ADDED_TO_STAGE, addedToStage);
}

public function addedToStage(e:Event):void
{
// draw the droplet path graphic
dropPath = new Sprite();
dropPath.graphics.beginFill(0xAA0000, 0.4)
dropPath.graphics.drawCircle(0, 0, 5);
dropPath.graphics.endFill();
dropPath.graphics.beginFill(0xFFFFFF, .8);
dropPath.graphics.drawCircle(-2, 0, 1.5);

// draw blood droplets
for each (var s:Sprite in drops)
{
s.graphics.beginFill(0xAA0000);
s.graphics.drawCircle(0, 0, 7);
s.graphics.endFill();
s.graphics.beginFill(0xAA0000);
s.graphics.moveTo(-7, 0);
s.graphics.curveTo(-8, -8, -4, -16);
s.graphics.curveTo(0, -20, 4, -16);
s.graphics.curveTo(8, -8, 7, 0);
s.graphics.endFill();

var flare:Sprite = new Sprite();
flare.graphics.beginGradientFill(GradientType.RADIAL, [0xCC0000, 0xCC0000], [1, 0], [0, 15]);
flare.x = -3;
flare.y = -4;
flare.graphics.drawCircle(0, 0, 8);
flare.graphics.endFill();
s.addChild(flare);

s.x = stage.stageWidth * Math.random();
s.y = -80 * Math.random();
addChild(s);
}

// init motion timer - fired every 50ms
timer = new Timer(50);
timer.addEventListener(TimerEvent.TIMER, onTick);
timer.start();

// init fade timer - fired every 1000ms
fadeTimer = new Timer(1000);
fadeTimer.addEventListener(TimerEvent.TIMER, onFadeTick);
fadeTimer.start();
}

public function onTick(e:TimerEvent):void
{
for each (var s:Sprite in drops)
{
// move the droplet down 2px
s.y += 2;

// copy the path graphic to the BitmapData
bmd.draw(dropPath, s.transform.matrix);

// send the droplet back to the top if its off the screen
if (s.y > stage.stageHeight + 30)
{
s.x = stage.stageWidth * Math.random();
s.y = -80 * Math.random();
}
}
}

public function onFadeTick(e:TimerEvent):void
{
// apply the color matrix filter
bmd.applyFilter(bmd, new Rectangle(0, 0, 1280, 1024), new Point(0, 0), fadeColorMatrix);
}
}
}




ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 10-08-2007, 07:26 AM


View Complete Forum Thread with Replies

Sponsored Links:

Dripping Blood Effect.
Hey! I'm looking for someone to help me code a dripping blood effect for my logo im trying to make for my guild.

All help is welcomed. Thanks in advance

P.S The logo so far has been attached, please refer to this in making the code .

View Replies !    View Related
Dripping Blood Effect.
Hey! I'm looking for someone to help me code a dripping blood effect for my logo im trying to make for my guild.

All help is welcomed. Thanks in advance

P.S The logo so far has been attached, please refer to this in making the code .

View Replies !    View Related
Making Dripping Realistic Blood?
Hey!

I´ve got a question.. how do I make blood, dripp/flowing down a wall and perhaps leave trails behind it, the dripping should look as realistic as possible, a singel drop flowing down leaving a trail is enough for me, I don´t need a river..

is there a way to script it so my wall can bleed from several wounds and the drops are flowing down in random ways, leaving trail, making the drop smaller and smaller until its nothing left from my drop?

(i wan´t my wall to bleed..)

thanx in advance!

View Replies !    View Related
Dripping Effect.
I am attempting to create a dripping effect (Blood). I did do a search on the forum and locate the following thread.


http://www.kirupaforum.com/forums/sh...highlight=drip

From what I read, I did the following.

Created a Movie Clip . In the Clip I had a shape tween of the dripping effect. Stopping ( stop(); ) the drip on frame 30.

I dragged an instance of the clip on the stage and gave an instance name of "drip_mc".

I wanted the blood to look as it was dripping/streaming down a "wall."

The only script that came to mind..


for (i=0; i<200; i++) {
duplicateMovieClip("drip_mc", "drip"+i+"_mc", i);
_root["drip"+i+"_mc"]._y+=i;
}



I know there is much missing. It is a start. I do get the clip to duplicate but I am having trouble getting the duplications to go down the y axis to form a line. Right now it just layers (one on top of other).

Any Ideas or suggestions?

I am really trying to accomplish what I seen in the "Mr.Clean" effect in the thread link I posted above.

Appreciate any input.

View Replies !    View Related
Dripping Effect.
I am attempting to create a dripping effect (Blood). I did do a search on the forum and locate the following thread.


http://www.kirupaforum.com/forums/sh...highlight=drip

From what I read, I did the following.

Created a Movie Clip . In the Clip I had a shape tween of the dripping effect. Stopping ( stop(); ) the drip on frame 30.

I dragged an instance of the clip on the stage and gave an instance name of "drip_mc".

I wanted the blood to look as it was dripping/streaming down a "wall."

The only script that came to mind..


for (i=0; i<200; i++) {
duplicateMovieClip("drip_mc", "drip"+i+"_mc", i);
_root["drip"+i+"_mc"]._y+=i;
}



I know there is much missing. It is a start. I do get the clip to duplicate but I am having trouble getting the duplications to go down the y axis to form a line. Right now it just layers (one on top of other).

Any Ideas or suggestions?

I am really trying to accomplish what I seen in the "Mr.Clean" effect in the thread link I posted above.

Appreciate any input.

View Replies !    View Related
Creating A Dripping Effect.
I'm creating my first flash website and i was wondering how to creating a dripping effect from a picture? would i have to draw a line? is it even possible?

View Replies !    View Related
Dripping Water Mask Effect
Hi everyone,

Does anyone know how they created the dripping water mask effect that reveals the images in the swf file located at the following address:

http://www.hypertemplates.com/templates/15841.html

I have no idea how they did it and wondered if anyone could give me any clues.

Thanks in advance.

View Replies !    View Related
Blood Effect
Is there anyway to make a realistic blood splatter? I was also thinking about making font drip...how would you do that? I am guessing with a shape tween.

View Replies !    View Related
Blood Effect
Is there any way to create some blood flow from the upper to bottom from the wall. (like something real)

Another problem is that when I want to change from one frame to the other frame, can flash do the ripple effect to do it?

View Replies !    View Related
Blood Effect?
Does anyone know a good place to find a blood effect, or just a good image with REAL looking blood?

I want to put a bloodstain on my site but i cant find any

thanks

View Replies !    View Related
BLOOD Text Effect
Hi, Im currently doing a title page for a 'vampire' short film and i really want to do a blood dripping effect...i.e hopefully a blood droplet falls from either the top of screen or front of screen and falls into a splay then turns into a letter/s any examples hint tips would be grealty appreciated

thanks heaps

View Replies !    View Related
BLOOD Text Effect
Hi, Im currently doing a title page for a 'vampire' short film and i really want to do a blood dripping effect...i.e hopefully a blood droplet falls from either the top of screen or front of screen and falls into a splay then turns into a letter/s any examples hint tips would be grealty appreciated
thanks heaps

View Replies !    View Related
Effect: Splash Ink Or Blood. How? Please Help
Hi,
Has anybody an idea about the spalsh of ink or blod on the screen?
There are some good photoshop brushes to make realistic splash, but how can we animate this to look real in Flash?

Thanks.

View Replies !    View Related
Blood Flowing Background And Ripple Effect
Is there any way to create some blood flow from the upper to bottom from the wall. (like something real)

Another problem is that when I want to change from one frame to the other frame, can flash do the ripple effect to do it?

View Replies !    View Related
[F8] BitmapData Ripple Effect
I'm having a bit of trouble coming up with the right approach to achieve a particular effect.

I want to make a "ripple" effect using BitmapData.draw(), such that the final image can be rippled vertically, horizontally, or both. I have written a rudimentary trial version of it that uses a translation matrix in cooperation with the clipping rectangle, but it is too processor intensive to apply the effect using this method at high resolution (i.e. using the clipping rectangle to manipulate each column or row of pixels individually.)

I was considering using a method that would draw all of the slices that share a common translation value along the graph of the ripple (advancing the parameter in multiples of Math.PI), but this would add complexity and execution time to the already sluggish for ... loop.

At this point, I'm looking at using a much lower resolution approach that would use a skewing matrix and a larger rectangle to simulate the ripple in fewer manipulations. Can anyone think of an easier way of making something like this with better resolution without compromising speed?

+Q__

View Replies !    View Related
BitmapData Fire Effect
I'm working on a basic mouse-trailing fire effect. I got it to place I'm happy enough with the fire appearance, and I can get the motion, but I'm finding some strange results in performance. Here is my code:

ActionScript Code:
import flash.display.*;
import flash.filters.*;
import flash.geom.*;

// fire bitmap
createEmptyMovieClip('fire_mc',1);
var bmp = new BitmapData(550,400,false,0x000000);
fire_mc.attachBitmap(bmp,1);

// glow clip
createEmptyMovieClip('glow_mc',2);
with (glow_mc) {
    matrix = new Matrix();
    matrix.createGradientBox(200, 200, 90, 0, 0);
    beginGradientFill('radial', [0xffffff, 0xFFFFFF], [100, 0], [0, 0xFF], matrix, 'pad', 'RGB', 0.3);
    moveTo(0, 0);
    lineTo(0, 200);
    lineTo(200, 200);
    lineTo(200, 0);
    lineTo(0, 0);
    endFill();
    blendMode = 'overlay';
}


// track mouse
var prevPoint = new Point(_xmouse,_ymouse);
function onMouseMove() {
    // draw a fire sprite
    var mat:Matrix = new Matrix();
    mat.tx = _xmouse;
    mat.ty = _ymouse;
    bmp.draw(flame_mc,mat);
    //prevPoint = new Point(_xmouse,_ymouse);
    noise_bmp.perlinNoise(30,50,1,1,false,true,1,true,new Point(offX+=4,offY+=9));
    updateAfterEvent();
   
    // glow
    glow_mc._alpha = 100*Math.random();
    glow_mc._x = _xmouse-100;
    glow_mc._y = _ymouse-100;
}

// flame distortion effects
var noise_bmp:BitmapData = new BitmapData(550,400,false,0x000000);
noise_bmp.perlinNoise(20,30,1,1,true,true,1,true,new Point(0,0));
var displacement = new DisplacementMapFilter(noise_bmp,new Point(0,0), 1, 1, 50, 90,'clamp');
fire_mc.filters = [displacement];
var offX = 0,offY = 0;
function onEnterFrame() {
    if (mouseIsDown) {
        onMouseMove();

    }
    // noise movement
    //noise_bmp.perlinNoise(30,30,1,1,false,true,1,true,new Point(offX+=4,offY+=9));

    // fade the color
    var matrix:Array = new Array();
    matrix = matrix.concat([1, 0, 0, 0, -15]);// red
    matrix = matrix.concat([0, 1, 0, 0, -15]);// green
    matrix = matrix.concat([0, 0, 1, 0, -15]);// blue
    matrix = matrix.concat([0, 0, 0, 1, 0]);// alpha
    var col = new ColorMatrixFilter(matrix);
    bmp.applyFilter(bmp,bmp.rectangle,new Point(0,0),col);

    // re-apply displacement filter
    fire_mc.filters = [displacement];
   
    // glow fade
    glow_mc._alpha -= 10;
}
function onMouseDown() {
    mouseIsDown = true;
}
function onMouseUp() {
    mouseIsDown = false;
}

You'll need a MovieClip which contains a firey colored radial gradient, and name it 'flame_mc'.

The problem is with perlinNoise(). Notice I have it commented out in the onEnterFrame block? That's because it causes significant lag. Not too surprising, but notice I again have perlinNoise() in the onMouseMove block? Well, at least on my machine, it doesn't create any noticable lag. MouseMove even executes with greater frequency than onEnterFrame(so long as the mouse is moving), so why is that? Am I doing something wrong here? I would just leave it in onMouseMove and be done with it, but the problem is then the fire doesn't billow unless you are moving the mouse. It fades(because I have that in the onEnterFrame) but the displacement offset upwards only occurs when you move the mouse.

Any solutions?

View Replies !    View Related
BitmapData Signature Effect, Please Help
Hey all,

I've been working on a tutorial for this for the last month, thinking that once I got it mastered, there would be a lot of interest in it.

I just don't get it, though.

Here's the idea:

You have a vector drawing in your library entitled, "signature", that represents the silhouette of a signature to be used as a mask.

You have a MovieClip on Stage entitled "signature_ani" which contains two MovieClips within it: "signature_mc" (an instance of signature from above) and "brush_mc" an instance of the symbol "brush" from the library.

"brush_mc" is tweened for position over a number of frames inside "signature_ani", making sure that there is at least one blank frame between brush strokes (when ever the brush is supposed to lift of the page, say to dot an i or start a new word).

So the idea is that if, on every frame, you add the "brush_mc" image to a BitmapData object called "brushpath_bmp", you should get a lumpy approximation of your signature's shape. However, in order for this to happen, the animation has to be real slow or you get "spots" where no "brush_mc" was copied because it tweened past it.

So, if you add to the tmieline of the "brush" symbol some code that basically looks like this:

ActionScript Code:
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.display.BitmapData;
 
function initClip() {
this._visible=false;
this.bmp=new BitmapData(this._width, this._height, true,0);
this.bmp.draw(this);
this.canvas_mc=this._parent.brushpath_mc;
this.canvas_mc.moveTo(this._x, this._y);
this.canvas_mc.lineStyle(this._width, 0x00ff00);
this.onEnterFram=function () {
this.canvas_mc.lineTo(this._x, this._y);
this.canvas_mc.bmp.draw(this.canvas_mc);
this.canvas_mc.bmp.draw(this.bmp, this.transform.matrix);
}
this.play();
}
this.onEnterFrame=function () {
if (this._parent.init) {
delete this.onEnterFrame;
this.initClip();
}
}
stop();


and on the timeline of "signature_ani" you put:

ActionScript Code:
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
 
function initClip() {
delete this.onEnterFrame;
//setup the final masked image
this.source_bmp=BitmapData.loadBitmap("maskedimage");
//setup the holders for the mask and the animation
 
this.bmp=new BitmapData(this._width, this._height, true, 0);
this.mask_bmp=this.bmp.clone();
this.mask_bmp.draw(this.mask_mc);
this.final_bmp=this.bmp.clone();
this.final_bmp.copyPixels(this.source_bmp, this.mask_bmp.rectangle, new Point (0,0),this.mask_bmp, new Point (0,0), true);
//apply effects like filters and things to this bitmap.
 
//setup the holder for the brush strokes (which will act as a progressive mask)
this.brushpath_mc=this.createEmptyMovieClip("brushpath_mc",10);
 
this.onEnterFrame=function () {
this.brushpath_bmp=new BitmapData(this.brushpath_mc._width, this.brushpath_mc._height, true, 0);
this.brushpath_bmp.draw(this.brushpath_mc);
 
this.bmp.copyPixels(this.final_bmp, this.brushpath_bmp.rectangle,new Point (0,0),this.brushpath_bmp, new Point (0,0));
}
this.init=true;
this.play();
}
this.onEnterFrame=this.initClip;
stop();


What this should do allow you to take any image and mask a signature out of it (so the image is inside the signature). Then use the timeline to tween a movieClip that records not only it's position, but draws a line from frame to frame making the "path" that the brush takes continuous for each "stroke". Then the animation clip copies from the final signature image only those pixels already covered by the brush path.

I've had it working a couple of times, but I am just missing someothing because it is always just bit off.

If anyone has the patience to read through this and see where I have gone wrong, I would really appreciate it. I'm sure it'll be a rreally great tutorial that will really come in handy for a lot of folks, if I could just get the details worked out...

Thanks in advance for any input.

jase

(oh, and if you want source files, lemme know. I've only got about 300 versions that I have tried in various stages....

View Replies !    View Related
[F8] Page Turning Effect Using BitmapData
(also posted in the flash 8 thread)

Hello everyone

I need to make an animation of a turning page using bitmapData i guess (the images on the front side and on the back side of the virtual page are BMP's loaded at runtime)

Can anyone suggest a way of approaching this? Is using bitmapData and drawing each pixel going to be fast enough? Is there a better way of achieveing this effect?

thanks

View Replies !    View Related
How To Make Bubble Dripping To The Top
Hi all, i saw the snow tutorial, at http://www.kirupa.com/developer/mx2004/snow2.htm

i wan to make the snow to flow from bottom to top, i try to modified the _y but either the snow stuck on top or it won't duplicate it self.

Hope someone here can guide me.

thanks.

onClipEvent (load) {
//variables
width = 300;
height = 200;
//random x,y, and alpha
this._xscale = this._yscale=50+Math.random()*100;
this._alpha = 20+Math.random()*50;
//random x and y for flakes
this._x = -width+Math.random()*(3*width);
this._y = -10+Math.random()*height;
//speed and trigonometric value
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;
rad = 0;
}
onClipEvent (enterFrame) {
// horizontal movement
rad += (k/180)*Math.PI;
xmovement = _root._xmouse;
this._x -= Math.cos(rad)+(xmovement-(width/2))/50;
// vertical movement
this._y += i;
// remove clips when they misbehave (overstep boundaries)
if (this._x>(width+50)) {
this._x = -45;
this._y = Math.random()*height*2;
}
if (this._x<-50) {
this._x = width+45;
this._y = Math.random()*height*2;
}
if (this._y>=height) {
this._y = -50;
this._x = -width+Math.random()*(3*width);
}
}

View Replies !    View Related
[MX] Video Loop Of Juice Dripping
Hello all,

I have a very simple task but unfortunately I'm new to this type of thing so I'm not sure exactly where to start. I need to create a flash loop of juice dripping from the top of the screen to the bottom of the screen. This is to be projected onto the wall during a party for juice boxes.

Any help would be greatly appreciated, as I'm not really sure how to loop a video in flash or anything like that

Thanks!

View Replies !    View Related
BitmapData::draw(BitmapData) Doesn't Seem To Support Alpha Channels
Hi all,

I have a BitmapData object with alpha channels, bm1, and would like to draw it into another BitmapData object, bm2. While I can draw bm1 into bm2, alpha channels do not seem to work. Here is some code to illustrate what I'm trying to do:

// create an all-green but semi-transparent BitmapData object (all alphas are set to 0x80 in the constructor)
var bm1:BitmapData = new BitmapData(100, 100, true, 0x8000FF00);

// create an all-white BitmapData object and display it
var bm2:BitmapData = new BitmapData(100, 100, true);
addChild(new Bitmap(bm2));

// draw bm1 into bm2 in the onTimer() callback function
bm2.draw(bm1);

I would expect bm2 to be light-green, because it's semi-transparent, but it's 100% green, i.e., 0xFF00FF00.

I already tried all blend modes, but blend modes didn't make a difference.

Any ideas?

Btw, what I'm trying to do is to extract an arbitrary collection of pixels (as opposed to a rectangle) from a bitmap (bm1) by copying it into another bitmap (bm2) and using alphas of 0x00 and 0xff to select the pixels to be extracted. Is there a better way to do this? (or any way for that matter? ;-)

Thanks!


-Bernd

View Replies !    View Related
Blood
I have a question..

Probably is this not really hard to do, but anyway..

http://www.thebloodbrothers.com

If you look at this site, when you roll over for example a textfield the background gets in the background so you can read the text... still its not a buttonlayer on the top because you can still mark the text, so there is not a invisible button layer..

do you got any idea how they did that?

/andreas

View Replies !    View Related
Blood
I've been testing everything i can think of but i cant figure out how to make blood in Flash MX. can anyone help?!

View Replies !    View Related
Blood
Hello everybody,

I'm working on this movie where someone begins to bleed. But I didn't have much succes. I tried to do it with masks and stuff but I ended up having a million movieclips inside eachother.

Is it possible to have 2 masks on 1 masked layer??

- Ruben

PS. Samples are VERY welcome

View Replies !    View Related
Splashing Blood
For a really intellectual flash, I need to splash a lot of blood over the stage. Anyone any pointers to make it look realistic?

Many thanks.

View Replies !    View Related
Blood Flow
I am trying to make it look like blood cels flowing through a vein.
I have the movieclip of the blood cell but how do I make it come at random speeds and random times, to look real?
Thanks
This is kinda urgent too.

View Replies !    View Related
Blood Placement
hi all,

im making a shoot-em-up and i was just wondering whether you can put a patch of blood on the bit of the body that you shoot at or do you have to have blood in the same place each time.

thx bye

View Replies !    View Related
Blood Bath And Beyond
Been a while since I posted. Here's a little script I've been working on. It's a handy little effect. here's the code, paste on frame 1.

////////////VARIABLES//
density = 35; //Density, default 35
speedA = 2.8; //Speed of low points, default 2.8
speedB = 3.6; //Speed of high points, default 3.6
speedZ = 200; // Time until it stops, default 250
thewidth = 250; //Width of file, default 250
trans = 50; //Alpha, default 50
fade = true; //Fade when stopped, default true
//
//////////////DO NOT MODIFY BELOW//
_root.createEmptyMovieClip("blankz", 0);
theY = new Array();
why = new Array();
blankz.onEnterFrame = function() {
speedZ--;
if (speedZ >= 0) {
blankz.clear();
speedP = speedA * (speedZ / 100);
if (speedP > .1) {
for (i = 0; i < density; i++) {
theY[i] += (Math.random() * speedP);
}
}
speedQ = speedB * (speedZ / 100);
for (i = 0; i < density; i++) {
why[i] += (Math.random() * speedQ);
}
with (blankz) {
beginFill(0xFF0000, trans);
lineStyle(0, 0xFF0000, trans);
moveTo(0, why[5]);
yPoint = _root.thewidth / density;
curvePoint = yPoint / 2;
change = yPoint;
for (i = 0; i < density; i++) {
curveTo(curvePoint, theY[i], yPoint, why[i]);
curvePoint += change;
yPoint += change;
}
lineTo(_root.thewidth, -100);
lineTo(0, -100);
endFill();
}
}
if (speedZ <= 0 && fade && _root.blankz._alpha > 0) {
_root.blankz._alpha -= 1;
}
};

Feel free to use the code

View Replies !    View Related
Oozing Blood
I am trying to figure out how to take this picture and add a flash image of blood starting out small and then oozing outwards.
Can someone assist with this? Any help appreciated

View Replies !    View Related
Scripted Blood
Ok. I know trhis ios alot to ask, but I need to know how to actionscript blood for a game. I want the blod to be in a big cluster in the middle and then decrease in size and alpha as it spreads out in all directions.

View Replies !    View Related
How Do I Do Decent Blood
Ive made (this animation/game thing, but im having problems with the blood on it.

Basically i used frame by frame animation for it, but the problems with this is:

1) it takes up loads of space. Eg. the blood for the chainsaw scene is 1mb of keyframes :S

2)It slows the animation down, as it keeps having to redraw the frames with the blood in.

So has anyone got a good way of drawing cartoony/realistic blood which looks good, but doesnt take up loads of space or slow the animation down?

Your help would be appriciated!!!

View Replies !    View Related
Scripted Blood
Ok. I know trhis ios alot to ask, but I need to know how to actionscript blood for a game. I want the blod to be in a big cluster in the middle and then decrease in size and alpha as it spreads out in all directions.

View Replies !    View Related
Red Mist And Thoughts Of Blood...
...have been swimming through my head for the last 45 minutes.

Flash MX is all jolly nice but what's happened to the dynamic textboxes?

I've got a movieclip called myclip
which contains a textbox called mytextbox
it's a dynamic textbox, and I've given it an instancename (mytextinstance) and a variable name (mytextvariable)

now I'm duplicating the movieclip and placing a different bit of text in each clip, or at least thats the theory....

myclip1.mytextbox.text = "think nice thoughts";

doesn't seem to work, neither does

myclip1.mytextbox = "type using fists";
myclip1.mytextbox.mytextinstance = "consider career change";

or

myclip1.mytextbox.mytextvariable = "drink whiskey and weep";

what am I doing wrong? please help.

View Replies !    View Related
Animated Blood Flow
Hi, I have created a small animation much like a psycho movie.

Basically at the end I was looking to do an animated blood flow from the top of the page to eventually fill the screen with red.

Has anybody done this or know of anywhere i can get it

cheers

lee

View Replies !    View Related
Blood Cells Video
I know this is kind of extreem but I was wondering if you could help me. I was looking for a screen shot of blood cells shooting past the screen. Just simple cells with the plasma all around it. I just wanted to know if there was a kind of technique that I should use to approach this. Any help would be appriciated. Thanks.

View Replies !    View Related
Blood Cells Video
I know this is kind of extreem but I was wondering if you could help me. I was looking for a screen shot of blood cells shooting past the screen. Just simple cells with the plasma all around it. I just wanted to know if there was a kind of technique that I should use to approach this. Any help would be appriciated. Thanks.

View Replies !    View Related
Dots Floating On A Wave Of Blood
Hi pals! :-D

Hey I'm trying to make these dots float on this wave script I found. If I can get them too then I'm going to turn them into ships! i also put two buttons in there that increase and decrease the wave height. Eventually I wanna make the ships be drag n drop able or shoot cannons at each other or something. Here is what I got so far.


Code:
kNbrControlPoints = 20;
kStartX = 0;
kEndX = Stage.width;
kBottomY = Stage.height;
kWaterLevel = Stage.height/2;
kWaveHeight = random(30);
kWaveSpeed = .001;

_root.onEnterFrame = function()
{
this.clear();
this.beginFill(0x480000, 100);
this.moveTo(kStartX, kBottomY);
for (x = 0; x < kNbrControlPoints; ++x)
{
var r = x/(kNbrControlPoints-1);
px = kStartX + r*(kEndX-kStartX);
py = kWaterLevel + kWaveHeight*Math.sin(r*Math.PI*1.1 + getTimer()*kWaveSpeed);
this.lineTo(px,py);
}
this.lineTo(kEndX, kBottomY);
this.lineTo(kStartX, kBottomY);
this.endFill();
_root.ship0._y = kWaterLevel + kWaveHeight*Math.sin(r*Math.PI*1.1 + getTimer()*kWaveSpeed + _root.ship0._x);
_root.ship1._y = kWaterLevel + kWaveHeight*Math.sin(r*Math.PI*1.1 + getTimer()*kWaveSpeed + _root.ship1._x);
}
Here's a link to the file: http://www.threebrain.com/bs/wave_sample.fla

View Replies !    View Related
I Need To Make Text Drip Like Blood
i need to make text drip down...or even smear down...can anyone help me...or tell me somewhere to go that i can find out how???

View Replies !    View Related
Security Reason? I´m Crying Blood...pleae Help Me
Display a linked html.doc in another frame looks now impossible.
This statement is now kaputt //getURL("content.htm", "contentFrame");
Years of work is kaputt.
Is there something I can do to get around this and without contact a lawyer
and bring an action for damages against ADOBE.

View Replies !    View Related
[as3] Drawing BitmapData To Erase BitmapData
Hey there. I'm still working on my paint program, and I figured I'd try using the open source, raster-based drawing system from Bytearray.org to speed up drawing in some of my paint tools. The Raster class has some drawing functions that don't bother with anti-aliasing, so in some situations, implementing these methods results in faster code than relying on the Graphics package. I've gotten a nice speed boost from my rainbow paintbrush, which is pretty neat. Go open source!

Unfortunately, I can't get the eraser brush to work, even though its code is essentially the same as the other brushes'. And I've figured out why; the "erase" and "alpha" blend modes, which my vector-based eraser uses to erase the drawing surface, don't seem to work when you draw one BitmapData object onto another. I could put the BitmapData in a Bitmap object and draw that, but that's essentially converting raster data to vector, and then back to raster, which is far slower than any speed improvement I'd get from relying on the Raster class in the first place.

Has anyone here succeeded in using one BitmapData object to erase another, without "wrapping" the eraser BitmapData in a Bitmap object?

View Replies !    View Related
Bitmapdata
This works by creating a bitmap on the fly then loading 2 bitmaps with copypixels, but how do i work with a bitmap loaded in library from a file?

import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;

var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000);

var mc_1:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());

var mc_2:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth());
mc_2._x = 101;

mc_1.onPress = function() {
bitmapData_2.copyPixels(bitmapData_1, new Rectangle(0, 0, 50, 80), new Point(51, 0));
}

mc_2.onPress = function() {
bitmapData_1.copyPixels(bitmapData_2, new Rectangle(0, 0, 50, 80), new Point(51, 0));
}

//i want bitmap_data 1 and 2 to be the bitmaps from the library

View Replies !    View Related
[F8] BitmapData
Guys,

when I try to position the movieclip and check the color value, it returns 0x0 ...

I cannot leave the emptymovieclip in 0x, 0y positions

Can anybody help?

Below is my code.

the "mcColorGroup" is a movieclip which contains a bitmap of a color chart


Code:
var myBitmapData:BitmapData = new BitmapData (193, 193, false, 0x00ffffff);
var mc:MovieClip = this.createEmptyMovieClip ("test", this.getNextHighestDepth());
test.attachBitmap (myBitmapData, this.getNextHighestDepth());

myBitmapData.draw (mcColorGroup);


any help would be great.

I figured it out

View Replies !    View Related
[F8] Jpg To BitmapData
Hi,

I am trying to create a BitmapData object of a jpg that is loaded into a movieClip, so that I can then remove the jpg and have just the BitmapData of the image to manipulate. I have the original image loading into my temporary MC without any problems..and am using a listener to check to make sure that the image has been fully loaded before it moves onto creating an empty movie clip for the BitmapData... but for some reason the BitmapData isn't working as nothing shows up in my holderMC.. and it says the width of the holderMC is 0 when it should be something liek 367 for the 'surf.jpg' test image I am using. My code is below...I must be missing something stupid...can anyone spot what's wrong? Thanks! - b.


Code:
import flash.display.BitmapData;
stop();

_root.createEmptyMovieClip("tempMC", 1, {_alpha:0});

//set up MovieClipLoader
var theLoader:MovieClipLoader = new MovieClipLoader();
var theListener:Object = new Object();
theLoader.addListener(theListener);

theListener.onLoadStart = function(mc:MovieClip){
trace("started");
}

theListener.onLoadProgress = function(targetMC, lBytes, tBytes) {
trace("% "+Math.round((lBytes/tBytes)*100));
}

//init function as soon as image is loaded and ready to receive events
theListener.onLoadComplete = function(mc:MovieClip) {
trace("image loading into TempMC is complete!");

_root.createEmptyMovieClip("holderMC",_root.getNextHighestDepth());
bMap = new BitmapData(mc._width, mc._height);
bMap.draw(mc);
_root.holderMC.attachBitmap(bMap, _root.getNextHighestDepth());

_root.tempMC.removeMovieClip();
}

theLoader.loadClip("surf.jpg", _root.tempMC);

View Replies !    View Related
Bitmapdata
Hi

Lets say I have an image imported into flash of a character ( person ). I convert this to a movie symbol and call the instance "Character". I have the following code which creates a new bitmap movie clip:

import flash.display.BitmapData;

var NewBitmapData:BitmapData = new BitmapData(this.Character._width, this.Character._height, false, 0x00CCCCCC);

var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());

mc.attachBitmap(NewBitmapData, this.getNextHighestDepth());

This works great to create a grey box the same size as the character movie. But how do I then copy the the character image to the new clip area?

View Replies !    View Related
BitmapData Help
Is it possible to capture part of the screen within a Flash movie using the bitmapData and send the data to a server to be stored as a image e.g. jpeg

This would then be loaded back into Flash later.

The idea is that people can drag and drop items to a location within the movie (a storyboard) and this is then captured. Later they need to see a miniture version of this but cannot move or alter the original image created.

Anyone got any suggestions if this makes sense
thanks

View Replies !    View Related
Bitmapdata
This works by creating a bitmap on the fly then loading , but how do i work with a bitmap loaded in library from a file?

import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;

var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000);

var mc_1:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());

var mc_2:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth());
mc_2._x = 101;

mc_1.onPress = function() {
bitmapData_2.copyPixels(bitmapData_1, new Rectangle(0, 0, 50, 80), new Point(51, 0));
}

mc_2.onPress = function() {
bitmapData_1.copyPixels(bitmapData_2, new Rectangle(0, 0, 50, 80), new Point(51, 0));
}

//i want bitmap_data 1 and 2 to be the bitmaps from the library

View Replies !    View Related
BitmapData
I'm hoping somebody can explain why this would work locally, but not online:

Code:
import flash.display.BitmapData;
this.createEmptyMovieClip("holder_mc",this.getNextHighestDepth());
loader = new MovieClipLoader();
loader.addListener(this);
loader.loadClip("photos/Sample1.jpg",holder_mc);
function onLoadInit() {
myBitmap = new BitmapData(holder_mc._width, holder_mc._height,true,0x00FFFFFF);
myBitmap.draw(holder_mc);
holder_mc.attachBitmap(myBitmap,this.getNextHighestDepth);
}
And yes, the image is properly placed on the server.

View Replies !    View Related
BitMapData
can anyone help out, duplicating mClips and bitmapdata. cant seem to get it to work when im making multiple movieclips

for (var i:Number = 0; i < $parsedObject.section[0].pic.length; i++)
{
var mHolder:MovieClip = b1.duplicateMovieClip("mClip_"+i,_root.getNextHigh estDepth());
var mHolderBMdata:MovieClip = b2.duplicateMovieClip("mClipBMdata_" + i, _root.getNextHighestDepth());


b1._visible = false;

oListener.onLoadInit = function(mHolder:MovieClip):Void
{
bmap = new flash.display.BitmapData(mHolder._width, mHolder._height, true, _root.getNextHighestDepth());
bmap.draw(mHolder);

mHolderBMdata.attachBitmap(bmap,300+2*i);
//mHolderBMdata._y = mHolderBMdata._x = 160;

mLoader.unloadClip(mHolder);
//img._alpha = 10;
mHolderBMdata._x = i*-33;
//mHolder._visible = false;

}
}

View Replies !    View Related
Example About Bitmapdata?
First of all, i am drawing a box with graphics api.....that is moveTo, lineTo,...

The top coordinates of the box are dependent on the distance from mouse thereby making it increase or decrease in size. Now the problem is i want to fill the shape/box/square with a bitmap, so i tried using beginBitmapFill(), but the problem is i don't know how can i make the bitmap always stretch/skew to fill the shape perfectly? That's why i am asking for a example, code, or theory/hint on how to fit the bitmap perfectly within the ever-changing shape! Please help!

View Replies !    View Related
BitmapData Help
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Matrix;
import flash.geom.ColorTransform;

myColorTransform = new ColorTransform();
myMatrix = new Matrix();
//area=new Rectangle(0,40,50,50);
myBitmap = new BitmapData(20,20,true,0x00FFFFFF);
var xRect:Number = 0;
// animation_mc is 400 x 200. i am just tring to get the first row of blocks
for(i=0;i<20;i++) {
var area:Rectangle = new Rectangle(0,xRect,20,20);
trace(area);
var t:MovieClip = this.createEmptyMovieClip("holder_mc"+i,this.getNextHighestDepth());

t.attachBitmap(myBitmap, 1);
myBitmap.draw(animation_mc,myMatrix,myColorTransform,"normal",area);
t._visible = true;
//trace(this["holder_mc"+i]);

t._x = xRect;
t._y =20;
xRect += 20;
}
stop();

--------------------------------------------------------------------------------------------------------------
I have a movieclip "animation_mc" that i want to manipulate by slicing up the movieclip into individual movieclips. I am using the bitmapdata class to do this but when i run this, the "t" movieclip only slices the first square and then repeats itself. I am using the rectangle class to incremently move this slice over but it does not work. Any ideas? Thanks





























Edited: 10/12/2007 at 05:54:51 PM by edHPU

View Replies !    View Related
Get BitmapData From Jpg
hey everyone, how are you? :)

so if i does this right:

loader = new Loader();
var request:URLRequest = new URLRequest( "/path/to/bunny.jpg" );
loader.load(request);

then i gets me a nicde little bunny jpg. now presumably that jpg has a BitmapData object. all i wanna do is: get it.

so how do i do that? :)

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved