ActionScript 2.0 :: Painting Movieclips With Masks?

Nov 9, 2011

I am dynamically creating moviclips.. when I create a movieclip(mc1) this movieclip present a wall(for painting).. On this wall I create several windows(holes) which a present as mask for a wall, so that only the color of the wall is viewed, but the window is transparent..

when I am done with this I have for example 3 walls(mc1, mc2, mc3) with masks included..now on a button action I want to enable each movie clip for painting->painting is done so that you pick a color in a palllete and then click the wall you want to paint.. I do this with this code:

btn_color.onRelease = function(){
for(i=1; i<=stMC; i++) //stMC is nubmer of created mc's
{

[code]....

The code works great for the last movieclip created.. but when painting others it paints the entire wall in chosen color, so it colors the transparent windows(were set as masks as well)..

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Movieclips Under Masks

Jan 9, 2009

So I have a MovieClip, A, and inside of it is a layer that has shapes on it for a mask, this layer does have some keyframe animation (the masks move). Then I have MovieClips on other layers that are masked by the masking layer. When the movie loads, I load in an external jpeg and draw it onto a bitmap object, and then use that bitmap object and attach it to the moviecilps that are masked. This works fine, until the animation hits the part where the masks actually animated, then it reverts back to whatever i had in it before i attached the bitmaps. Is this a bug? or am i missing something? the only way i can get it to work is to run a function every single frame that the mask changes to reattach the bitmap. but that seems quite unefficient to have to do

View 0 Replies

ActionScript 2.0 :: Movieclips Under Masks?

Jan 9, 2009

So I have a MovieClip, A, and inside of it is a layer that has shapes on it for a mask, this layer does have some keyframe animation (the masks move). Then I have MovieClips on other layers that are masked by the masking layerWhen the movie loads, I load in an external jpeg and draw it onto a bitmap object, and then use that bitmap object and attach it to the moviecilps that are masked. This works fine, until the animation hits the part where the masks actually animated, then it reverts back to whatever i had in it before i attached the bitmaps. Is this a bug? or am i missing something? the only way i can get it to work is to run a function every single frame that the mask changes to reattach the bitmap. but that seems quite unefficient to have to do

View 2 Replies

ActionScript 3.0 :: Finding Masks In MovieClips?

Nov 7, 2009

I'm trying "get" the masked objects in my MovieClip object using something like:

ActionScript Code:
for(var i:uint=0; i<myMC.numChildren; i++){
if(myMC.getChildAt(i).mask!=null){
maskedObject = myMC.getChildAt(i);
break;
}
}

It goes through myMC's children and never finds a masked object even though myMC does have a mask in it. I made myMC in flash, so is that the problem? And how would i access the masked object otherwise?

View 1 Replies

ActionScript 2.0 :: Multiple Masks Movieclips?

Oct 10, 2011

I am creating movieclips and there holes(deselected areas using masks) dynamicly. Is there a way I can assign one movieclip moer than one mask? Maybe by somehow saving the moviclip with the first hole(mask), so I can assign him the mask again(Seee example hole1 and hole2 on mc1).Another thing is to assign the same mask to two difrent movieclips, but as read that should be sovled by duplicating the mask mc.

View 5 Replies

ActionScript 3.0 :: Flash Animated Masks & Resizing Movieclips

Aug 22, 2010

I am an intermediate/moderately experienced AS3 programmer - however, I am having a few issues with resizing my background mc (mcBG), that contains a mask with bounds which go beyond the dimensions of the stage, to display correctly.

I know my script works (well, at least this much) so that if a static image of 1000px * 800px is placed inside the mcBG movieclip, the background fills the screen as intended.

However, if I change that static image (inside mcBG) to be either: a movieclip (mcAnimMask) which contains an animated mask (which has elements larger than the 1000px * 800px bounds, eg: 4500px * 3000px) or,2 layers (mask, and animated layer (dimensions: eg 4500px * 3000px) - framed tweening)...the resize script resizes mcBG to be the greatest dimensions of the files contained within it - ie: it does not fit the screen correctly, in fact it appears to be about 60% smaller than the original (which should be 1000px * 800px).

View 4 Replies

ActionScript 3.0 :: Painting DataGrid Cell?

Jun 20, 2011

var cr:CellRenderer = dgv.getCellRendererAt(0,0) as CellRenderer;
cr.setStyle("upSkin", new CustomCellBackground());

where dgv is DataGrid instance, CustomCellBackground - is my MovieClip which is simple rectangle filled with some color.

View 7 Replies

Actionscript 3.0 :: Screating A Painting App In Flash?

Jan 12, 2011

i have a problem with functions, i'm creating a painting app in flash as3. i want to draw two different style a pen and rectangle.

When i draw pen style in first frame there is no problem, but when i click rectangle style in second frame it is drawing with both style. How can i stop or kill other function?

How do I make both of the not drawing. And How can i undo my last action in drawing?

Fla is in the attachement (CS4 version)

in first frame drawing pen;

Code: Select allvar clip : Shape = new Shape();
addChild (clip);
stage.addEventListener(MouseEvent.MOUSE_DOWN, _handleMouseEvent);
stage.addEventListener(MouseEvent.MOUSE_UP, _handleMouseEvent);

[Code]....

View 1 Replies

ActionScript 2.0 :: 2 IPs Painting At The Same Time On Same Canvas?

Jun 18, 2004

I`trying to create an MC that when browsed two people on two different terminals (2 IPs, on two different continents) can actually draw on the same canvas...

View 8 Replies

ActionScript 3.0 :: Painting Text While MOUSE_DOWN?

Jun 8, 2011

I'm developing a word game for mobile and I'm trying to solve a bug:I have many squares with letters and when the user mouses down (or touches) a letter, the app starts to put together a word. Every letter that is moused over is added to the word and I have a textfield that shows the current word the user is trying to put together.Every letter added to the word (text.change event) I check if this is a word that is available in my dictionary (array of words). If this word is correct and exists, I want to paint the color of the textfield showing the word so the user would know that this is a valid word, even if he doesn't know the word.

My problem is that this code runs and traces correct and in the right moment (the trace "word exists" is being called when I add a letter that makes the word valid. But the painting of the word just happens when the text changes again. This causes the app to make the word blue after adding or removing a letter from a "valid" word, but in this case I want it to happen immediately when the user reaches a valid word.Can the problem be happening because the mouse is down?

Code:
if (dict.wordExists(word))
{

[code]......

View 1 Replies

IDE :: CS5 Tapered Painting - Convert The Lines

Jul 9, 2011

I've recently decided to trace over an animation from a cartoon as a reference for my own animation that I am making. Now, my hang up is that I use the line tool for the tracing, and then convert the lines to paint so that I can shape them better to match how the characters from the show look. Where the legs connect to the body the line get gradually thinner from where it started.

I don't have a tablet and trying to do it with the mouse leaves too many lumps. The results are not acceptable, nor efficient. In all, I have about forty frames to optimize my traced lines, to the good looking tapered paint. The show was done in flash, so I know it must be possible in CS5. Aside from the subselection tool (Which horribly warps my lines and is extremely tedious for a frame by frame animation), does anybody know a more efficient way to do this?

View 1 Replies

ActionScript 2.0 :: Painting Program Key Press Variables

Dec 1, 2010

I'm currently working on a few small paint programs designed to emulate certain famous painters. I'm using a pretty basic AS2 painting program and simply manipulating it to my needs, but have run into a few problems that trial and error have not been able to fix.For two of the programs I would like the up and down arrows of the keyboard to change the size of the brush, which is currently set by the variable ranWidth (one of the other programs uses random widths for the brush).For one of the programs, the left and right arrows will increase or decrease the paint opacity.One of the programs will be a pointillism style drawing program, so instead of drawing a line as it does currently, I'm trying to have it draw a series of dots, without having to click down every time.Third, my color selection right now changes randomly each time the user clicks down. This works fine for some of the programs, but others it really is neccesary to choose a color. I've tried creating buttons with on release functions that would change the color variable but havn't got them to work properly.I know its a bit of a list but I think most of the coding is fairly simple, I'm just new to actionscript and trying to learn the ropes. I've used keys to change items before but am not having any luck.Here is my basic script for one of the painting programs. This one simply draws lines in different colors at random sizes.[code]

View 10 Replies

ActionScript 3.0 :: Textfields Painting Into BitmapData Alias?

Jan 24, 2009

If I create a simple Textfield and place it on the stage, it looks good.

If I take the same Textfield, and paint it into a BitmapData (first putting the Textfield into a Sprite so I can paint it), the resulting BitmapData is not the same, pixel for pixel, as the original textfield on the stage.

refer to the attached image for a zoomed in view on the differences in the aliasing.

What can I do to keep the two pixel-for-pixel identical?

Code:
private static function doTest( stg:Stage ):void
{
var tf:TextField = new TextField();
tf.text = "TESTING";

[Code].....

View 1 Replies

ActionScript 3.0 :: Switching Between Painting Ellipses And Squares

Jun 23, 2010

I'm doing a tutorial from Adobe Flash CS4 classroom in a book. They're suggesting the following: "create buttons that allow users to switch between painting ellipses and painting squares". I've created the class files for the cirlcle and the square and I've set two hot keys to switch between painting circles and rectangles(it does not work) Now I'm trying to create the buttons.

package {
import flash.display.MovieClip;
public class Rect extends MovieClip {
public function Rect(w:Number = 40,h:Number = 40, color:Number = 0xff0000) {
graphics.beginFill(color);
[Code] .....

View 1 Replies

ActionScript 3.0 :: Stop A Function In Drawing ( Painting ) App?

Jan 12, 2011

i have a problem with functions, i'm creating a painting app in flash as3. i want to draw two different style a pen and rectangle.

When i draw pen style in first frame there is no problem, but when i click rectangle style in second frame it is drawing with both style. How can i stop or kill other function?

How do I make both of the not drawing. And How can i undo my last action in drawing?

Fla is in the attachement (CS4 version)

in first frame drawing pen;

Code:
var clip : Shape = new Shape();
addChild (clip);
stage.addEventListener(MouseEvent.MOUSE_DOWN, _handleMouseEvent);

[Code]....

View 5 Replies

ActionScript 2.0 :: Implement A House Painting Application?

Oct 5, 2011

I am trying to implement a house painting application. I've done it so far that I can draw a shape(creates a movie clip) and fill it with any color. But now I don't know how to "make holes"/transparent areas into a certain movie clip for windows or anything that should not be colored so taht the backgorund will be displayed. [URL]

View 5 Replies

Make An Interactive Flash Movie That Explains A Painting?

Mar 5, 2010

I'm new ActionScript, and programming in general, however I've been doing a lot of tutorials and reading my Flash CS4 Bible, and cruising the forums like crazy trying to figure out how to go about scripting for my project.

Situation: I need to make an interactive flash movie that explains a painting.when you rollover different sections of the painting, I would like the rest of the painting to dim, and for that section to grow. if you are to roll out, it goes back to the first frame and the same thing happens for all of the sections.

If you are to click on any given section, there will be a voiceover, and possibly a little animation that goes along with it. if you either watch the whole thing or click anywhere on the painting, it should go back to frame.I've thought of a few ways to do it, but can't seem to get the scripting right.for now, I'm only worried about the first part because the rest is going to be similar.Frame 1 I have the painting and an invisible button over a section. frames 2-7 is that section growing and the rest of the painting getting dim there is a stop(); on frames 1 and 7

[Code]...

View 5 Replies

ActionScript 3.0 :: Integrating Painting Program With Fluid Layout

Jan 7, 2010

I am making a flash website and I am implementing a fluid layout. In the website I made a drawing program that is supposed to move along with the rest of the elements of the website when the window is resized. Now the problem is not the drawing program itself, ive got that working very well, the problem is when the canvas movieClip onto which the painting is being done is moved when the window is resized, the movie clip does not stay on centre, and the drawing is displaced outside the canvas movieClip and no longer happens on the mouse X and Y.For the sake of simplicity I made a simplified version of the drawing program with the fluid layout code and drawing code. No point in going through 200 lines of code when the problem lies within 10 lines of code.[code]The pink box is the canvas the user is able to draw on. The grey box is used to test the fluid layout code and to give coordinates for the pink box. When the file first loads both the pink and grey boxes are side by side, during the resize event they should stay side by side, however they do not.

View 1 Replies

ActionScript 3.0 :: Combining Painting Application And Jpeg Encoder?

Feb 8, 2011

I am trying to create a painting application that allows you to export as a jpeg. I have the code for the jpeg encoder, and for the color changing--but I am having trouble combining the two...

This is the jpeg encoder sketching app:

ActionScript Code:
import flash.display.Sprite;
import flash.events.MouseEvent;
import com.adobe.images.JPGEncoder;

[Code]....

It would also be great to be able to clear the canvas_mc by clicking a button..

View 7 Replies

Actionscript 3 :: Flex: Difference Between Defining Sprite's X - Y Coordinates And Painting Object In Some Location

Oct 14, 2009

I have a task: I need to place about 100 sprites on one canvas (with prepared grid on it). I need to place them as invisible (circles) stones, on the board, and make visible only on mouseover. The problem I come across is following, I can't place those objects accurately into the nodes on the grid.

[Code]...

View 2 Replies

IDE :: Two Masks On One Layer?

Sep 24, 2009

I'm trying to display a shape using a mask in a way that it unhides the shape from left to center and in the same time from right to center.

--shape--
---><---

Is there a way to create a mask layer that animates two masks or to create two masks above one layer?

View 6 Replies

CS3 Multiple Masks To One Layer?

Mar 16, 2009

I was wondering whether it was possible to include multiple masks to just one layer?I have a huge deadline in for thurs and it would be a huuge help if it is possible.

View 1 Replies

Actionscript 3 :: Create Masks In It?

Mar 18, 2011

I can SEE the maskObject unless I set its alpha to 0 and then it doesn't let clicks through to objectToBeMasked

And every single tutorial that I've seen fails to mention this and how to solve it, as if it should be obvious.

How do I mask objects through AS3 so that the masks act like masks act like the ones added in the IDE?

View 3 Replies

ActionScript 2.0 :: Masks Over Two Objects?

Jul 2, 2008

I have two seperate MCs which I want to have the same mask effect on it Ie a gap in the middle, the mask is spinning round as stated they are separate, the blue thing gets moved whist the white one doesn't

View 4 Replies

ActionScript 2.0 :: Dynamic MCs And Masks?

Oct 4, 2011

I'm creating a starry sky for a header and there are mountains in the image which obviously I want the randomly generated stars to appear behind it.I've tried setMask() but I don't see it doing anything. The generated stars still appear on top of everything regardless of layer order and such.

View 2 Replies

ActionScript 2.0 :: FMX Scripted Masks?

Mar 19, 2004

I have a client who is IN LOVE with this site: http:[url]...I was just getting ready to start tweening and wondered if there's a way to script masks to do the same thing easily...NOT on mouse drag, but on the click of the button. I found a nice tutorial which will make a similar thing happen when you drag the mouse. But when I tried to target x and y the whole thing fell apart.

View 3 Replies

ActionScript 2.0 :: Multiple Masks For 1 Mc?

Apr 2, 2005

I have this problem that has been makin me crazy. I want to make an erasor for the drawing api basically. Since I wasn't able to accomplish it, i looked everywhere!!! no luck So far I have been able to "erase" with shapes. For instance, I can drag a circle out and see the masked item underneath. The very next shape I drag out cancels the mask from the previous shape as if you can only have 1 mask per maskee. Also, I cant get a line drawing to become a mask.

//creating the shape
_level3.drawingPlane.createEmptyMovieClip("layer"+ _level3.layer+"_"+i, _level3.layer);
// dynamically setting the mask_level3.water.setMask(_level3.drawingplane["layer"+_level3.layer+"_"+i]);

View 3 Replies

ActionScript 2.0 :: Drawing Api And Masks?

Jan 23, 2005

I've been having this issue for a day or two now and it's really bothering me. Sometimes the drawing api draws to the mask perfectly fine other times it doesn't work at all.

[Code]...

View 5 Replies

ActionScript 3.0 :: Can One Movie Clip Have Two Masks

Mar 27, 2009

I'm trying to make flash add two maks in one movie clip,like this (pseudo-code)

PHP Code:

MovieClip.mask = mask1
MovieClip.mask = mask2
Print (MovieClip)

but it only shows me the last mask.

View 12 Replies

ActionScript 3.0 :: Creating Masks From BitmapData

Oct 17, 2009

I'm trying to modify the alpha layer of a bitmapData by taking a source iamge and masking out areas that don't have the correct channel. ATM I'm using copyChannel to achieve the effect, but I'd liek more than 3 channels (use alpha kills the other channels it seems). 255, 0, 255 should be able to act as another mask.

This is what I'm doing now...

Code:
bitmap.bitmapData.copyChannel(tempMask, new Rectangle(0, 0, tempMask.width, tempMask.height), new Point(0, 0), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);

So the red parts of the image mask out the source image. All I want is to be able to mask out things basic on multiple channels (the lesser of the 2).

1) How does copyChannel work? Can I just test each pixel manually and achieve relatively similar speeds? and 2) if the Flash inline functions are infact faster, is there a function that can do what I want, or would it be better to use a shader?

Code:
var tempBitmapData:BitmapData = new BitmapData(tempMask.width, tempMask.height);
var matrix:Array = [];
matrix = matrix.concat([0, 0, 0, 0, 0]); // red
matrix = matrix.concat([0, 0, 0, 0, 0]); // green

[Code].....

View 1 Replies







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