ActionScript 2.0 :: Using Drawing API To Mask?

Jun 15, 2006

I'm trying to get a better handle on creating dynamic content, so I made a little experimental Flash file to test out programming with more robust and portable code to accomplish it (). I have two functions, one creates rounded rectangles and the other regular rectangles. I'm planning on using the regular rectangle to hold an image (which it does), and the rounded rectangle as a mask to give the appearance of a rectangle with uh, rounded corners. I've run into a couple problems with this:

1. The mask doesn't apply to the image. The regular rectangle (pictureHolder_mc) will appear and the picture (a .JPG file) will load into it; the rounded rectangle (pictureHolderMask_mc) will even appear on top of the picture. But as soon as I use the setMask() method, the mask disappears and not in the cool applying-to-the-movie way.

2. Both the rounded rectangle function and regular rectangle function have parameters for X and Y coordinates that worked fine when I was testing without trying to load an image. As soon as I did, it'd put the image at (0,0) for some reason, even with 300 passed for X and 50 for Y.

3. I've set up an onRelease() function for the image-holding movieclip that calls a tweening function, just to test out functionality. It doesn't work so hot; the mouse doesn't even turn into the clicky button cursor when the movieclip's rolled over.

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
stop();

[code]....

View 14 Replies


Similar Posts:


Create Own Mask Around A Jpg Image By Drawing Around It On The Mask Layer

Dec 4, 2009

maybe point me towards a better way to mask. png file is way too big. I have been using the mask layer option to create my own mask around a jpg image by drawing around it on the mask layer. There has to be a fetter and faster way to do this. Is it possible to maybe have a specific color range have an alpha value of 0. Similar to green screening whereas If I put the item I want to clip on a green background flash will auto take out the green for me. and by auto I mean action script maybe. I think this can be done but im not finding it.

how are these guys clipping these images [URL] they have the movie clips set up where the black background on the 3 layers of shoes is getting masked out. When I go into the shoe movie clips I see there is a black background but it just disappears when I go back to main timeline.

View 3 Replies

ActionScript 3.0 :: Drawing Rectangle Behind Mask Layer

Jun 28, 2010

I have a button that when clicked is supposed to draw a rectangle behind my mask layer but when I try to run it I get this error:
1067: Implicit coercion of a value of type Class to an unrelated type flash.display:BitmapData.

Here is the related ActionScript Code:
fabric_mc.phoenixFab.addEvenetListener(MouseEvent.CLICK, changeFabric);
function changeFabric(event:MouseEvent):void{
this.graphics.beginBitmapFill(phoenixFabric);
this.graphics.drawRect(181, 46, 319, 319);
this.graphics.endFill
}

View 9 Replies

Professional :: Mask Revealing Oval Line Drawing?

Aug 16, 2010

I have a drawing thats made up of (closed) ovals, which i have imported into flash from Illustrator. The ovals are simple "drawing objects", 0.1 thick with no fill. I need to find a way to animate these ovals "drawing" themselves.

View 1 Replies

Professional :: Drawing Artifacts With Motion Under A Gradient Mask

Feb 9, 2011

I have a transparent png bubble in movie clips that are being randomly sized and animation started using code. The design has a reflection and I am using a gradient mask for the effect. The issue is when the bubbles animate they are causing drawing artifacts. Please see the attached screen shot or you can see the swf here - Code: bottomMask.cacheAsBitmap = true;beaker_bottom.cacheAsBitmap = true;beaker_bottom.mask = bottomMask;

View 2 Replies

ActionScript 3.0 :: Drawing Artifacts With Motion Under A Gradient Mask

Feb 8, 2011

I am having an issue with using a motion under a gradient mask. I have a transparent png bubble in movie clips that are being randomly sized and animation started using code. The design has a reflection and I am using a gradient mask for the effect. The issue is when the bubbles animate they are causing drawing artifacts. Please see the attached screen shot. Below is the code I am using to set the mask.

[Code]...

View 2 Replies

ActionScript 2.0 :: Using Drawing API Shape To Mask Another Movie Clip?

Nov 16, 2006

I have a movieclip that contains code for an API drawing shape. I can use it to mask a movieclip containing an image but not a moviclip that contains a dynamic gradient.

Code:
// CREATE MASK SHAPE WITH DRAWING API
// create empty movieclip

[code].....

View 3 Replies

ActionScript 3.0 :: Drawing Pill Shape Mask - Cannot Adjust Linestyle

Aug 31, 2011

I'm trying to draw a mask that's a pill shape but I can't seem to adjust the linestyle properly.
Code:
import flash.display.Sprite;
var pill:Sprite = new Sprite();
pill.graphics.beginFill(0xFF0000,1);
pill.graphics.lineStyle(1,0x000000,1,false,"normal","round","round");
pill.graphics.moveTo(0,6);
[Code] .....

View 3 Replies

ActionScript 3.0 :: Alpha Mask - Area Of The Loader Outside Of The Mask Will Visible When The Mouse Is Down

Sep 10, 2010

I have a startDrag function set up on a loader and mask that when the mouse is down on the loader it drags, when not it doesn't. There is also 2 buttons that control whether mask1 or mask2 is used. What i would like however is when the mouse is down - the area of the loader outside of the mask is visible but only by about 10/20% alpha, that way the user can see where all the image is while dragging. Is this possible? Full code can be seen below and i have attached the zip with the .fla file:

[Code]...

View 2 Replies

ActionScript 2.0 :: Scriptable Mask - Large Mask Behind The Whole Of Flash Site?

Aug 19, 2003

what i am doing is to make something along the lines of the "scriptable mask" tutorial Inigo was kind enough to put up.My idea is to have a large mask behind the whole of my flash site, this masks a colour image with a black & white one (nothing tricky). The image I am using is actually 5 separate images combined, and each is a pic of certain parts of the site.I also have a very basic set of buttons along the bottom... each corresponding to each section.

All I want is to set it up so that when I mouse over the buttons, the _x of the mask moves to correspond with the correct image... really very basic... or so I thought .If anything it should be easier to do than what is in Inigo's tut (where he uses the _x of the mouse to move the mask)... i just cant seem to get it to work with a nice easing effect (its easy to get the mask to simply snap to each coordinate, but I need it to smoothly move).

View 4 Replies

ActionScript 3.0 :: Pencil Tool - Drawing Above A Image But The Drawing Is Below The Picture

Nov 9, 2010

i've tried to simulate a pencil tool, for drawing above a imagem, but the drawing is below the picture. How fix it?

[Code]....

View 3 Replies

ActionScript 3.0 :: Shape.mask=mc.mask In As File Not Working

Apr 8, 2010

ive gotten one movie clip to mask another in the actions frame but i cant seem to be able to mask the flames which are a shape with a movieclip in this as file. im not getting any errors but the mask isnt covering anything look near the bottom at s.mask=mask_mc; there are about 20 "s" shapes spawning per second if that has anything to do with it

Code:
//this package turns an mc into a flaming button that calls a javascript function
package
{
import flash.display.MovieClip;

[Code].....

View 3 Replies

ActionScript 3.0 :: Generate Drawing API Data From Drawing Object?

Jul 22, 2009

Basically I've got a reasonably complex drawing object in a fla and I want to reproduce it in a class definition using the drawing api. However obviously this is a tedious task, so is there some trick or automated method of doing this?

Last time I needed to do this it was a drawing of an arrow and I ended up writing down x,y,width,height values for everything but this one has curves in it which I don't have experience with drawing anyway.

View 2 Replies

ActionScript 3.0 :: Possible To Mask Multiple MC Or Sprites Under One Mask?

Nov 26, 2009

I was wondering if its possible to mask multiple MC or Sprites under one mask, when using AS3.abc.mask = a;cba.mask = a;something like that

View 2 Replies

ActionScript 2.0 :: Enabling Drawing Only When Drawing = True

Sep 28, 2009

I cannot get this to work. Without the "var drawing", "var drawing being true or false" and the "if statement", it works fine. But I need to add the "var drawing" so that you can only draw if you turn it on by pressing the "draw_btn" button. Note, I do not get an error, the script "apparently" contains no errors. Here is the code:

ActionScript Code:
var drawing = false
_root.createEmptyMovieClip("myLine", 0);

[Code].....

View 3 Replies

ActionScript 3.0 :: Drawing Over A Movieclip In A Custom Drawing App?

Jan 13, 2012

I've created a drawing tool which allows the user to draw on the canvas, the problem is that if I try to draw over a movieclip nothing happens. Is there a way I can allow for the user to draw over movieclips? For example if I had a background of paper?

Here's the code I'm using for it:

// This code is for drawing the lines on the page
//1.
var drawingLine:MovieClip = new MovieClip();
addChildAt(drawingLine,0);

[code]....

View 8 Replies

ActionScript 3.0 :: Drawing Api Drawing 40,000 Objects

Feb 18, 2009

I need to draw on stage about 40,000 4x4 squares each a different color. The color is determined by an xml file. I have this working in as2 and have converted it to as3 the problem is the amount of time it takes to draw is causing cs4 to time out. I have extended the script time out to 60 seconds. In cs3 as2 it would draw the squares in about 15 seconds. I was hoping as3 cs4 would improve performance but seems to be the opposite. I have tried several methods such as adding children and various drawing variations. the bellow seems to work the best, but is still causing flash to crash.

ActionScript Code:
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Shape;

[Code]...

View 9 Replies

ActionScript 3.0 :: Blur Everything Under A Mask (Blur Mask)?

Jan 12, 2009

I've searched every possible actionscript forum for this and i cant seem to find it. How can i create an "area" of blur which blurs everything beneath it?Like some kind of masked blur effekt?

View 0 Replies

AS3 :: Set A Mask On Movie Clip A Using Movie Clip B With .mask Parameter?

Jan 22, 2010

AS3 Movie clip does not have .setMask() method, but it has .mask property. What is the syntax to set a mask on movie clip A (mcA) using movie clip B (mcB) mith .mask parameter in AS3?

mcA.setMask(mcB);  // does not work in AS3 (no setMask() method any more)
mcA.mask = mcB;  //does not do the job either

View 6 Replies

Mask With Several Shapes?

Mar 19, 2009

Is this possible? Cause it "masks" just one shape within the mask layer.

View 7 Replies

Mask Background Of SWF?

Oct 28, 2009

I received an swf movie of a rotating brick with a blue background. I converted to fla but the blue bg and the brick are considered a single object. Is there a way to mask the bg without having to export it as single frames and masking in ps?

View 1 Replies

Using A Transparant PNG As A Mask?

Jul 1, 2009

I'm trying to use an irregularly shaped PNG as a mask but the mask is just coming out as a straight rectangle, not taking into account the transperancy of the image.
I've found many people complainng about this across the internet, and it is apperantly solvable, I just haven't been able to figure it out.
 
I've tried Trace Bitmap to vectorize the shape, since it's a single solid shape, but I'm getting weird results: [URL] I cant figure out why those lines are appearing across my mask. There's nothing there in the actual traced image, I've even ran the eraser over the affected sections to make sure.

View 2 Replies

Professional :: Get Url And Mask?

Mar 23, 2010

1- is there a way to make use of any universal URL in flash ? i mean. not needing to have the full path of the target in the button since the target is in the same folder than the page where is the flash ?
 
2- now, thats a funny one, i can make mask to make thing appear in an animation fashion style, no probleme as with any Adobe program... however unlike all other Adobe programs, it seem i am unable to find HOW make the exact reversed result... I want to make thing disappear without using the alpha channel, because i want to make it in an animation style way. It is to use for a sub-menu, where when you click the button to open the sub-menu, you see it appear nicely and in an animated way. But when you click again the button to close it, or once you picked your choice, it close the sub-menu in the exact reverse way it was open...

View 5 Replies

ActionScript 2.0 :: Mask Come In But Then Goes Out

Jul 18, 2009

I'm trying to make the image just scroll in with the current mask effect and not scroll out. You can download the source file here: [URL]. The layer to look at is "FlashAICB" there is 2 portions of code, one on the movie clip on this time line, and other on the mask inside the movie clip.

View 3 Replies

IDE :: Mask Not Working?

Apr 3, 2007

why my masking effect is not working,i mean on Library display is displaying correctly[Type:Movie],i just did draged into main pannel the movie clip,and when i run it,it just show static text,why?

View 13 Replies

IDE :: Gradient Mask In CS5?

Nov 13, 2010

Is there a way to create a gradient mask in Flash Pro CS5? I am able to get it to work in FPCS4 but apparantly the process was changed or the functionality eliminated in CS5.

View 1 Replies

Drawing During Run Time

Jul 23, 2009

Does anyone have the code for drawing lines (with smoothing) in an onMouseDown click event?

View 1 Replies

ActionScript 3.0 :: Drawing API To SWF?

Jul 10, 2009

I have an app that allows the user to draw and create temporal objects (sounds and animation).I want the user to be able to SAVE and PUBLISH their output as an SWF file they can download to their computer. I have no problem with the drawing and animation aspects, but I'm stumped on how to begin coding the output. Do I need to call some remote actions (JSFL) on the server to create the SWF? How would be the best way to pass the data?

View 2 Replies

IDE :: How To Create A Drawing Pad?

Mar 29, 2009

creating a drawing pad in Flash that will let a user (from my website) draw an image(also have different shapes and colors) then be able to click on "save". Now here's the tricky part, When a user clicks on save, I need it to be saved as a .jpeg file then have that image sent to my email for review

View 3 Replies

ActionScript 2.0 :: Using The Drawing API?

Jul 2, 2009

how to replicate the "add anchor point" tool using AS2? I have managed to use the API to draw a square with four anchor points, but am not sure how to add extra anchor points. What I want is that these extra anchor points are added when then user clicks on a line.[URL]

View 2 Replies







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