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


Similar Posts:


ActionScript 3.0 :: User Drawing Multiple Ellipses?

Jul 25, 2011

I've got a program that needs to let the user draw ellipse a on the stage and I need to track the positions so I can re-draw them when they come back. I've got that mostly working, except, I need to let them draw up to 5 ellipses and be able to delete ones that they have already drawn so they can draw new ones.I'm having difficulty managing the children, object numbering/naming, etc.Here's the code that's working as far as drawing the ellipse:

Actionscript Code:
import flash.display.Sprite;import flash.events.*;import flash.ui.Mouse;import[code].....

View 6 Replies

ActionScript 3.0 :: Limit The Text In The Field To "x" Amount Of Characters And Insert An Ellipses

Sep 10, 2008

I have text from an RSS feed parsed using AS3 and displayed on the stage in a few dynamic text fields. Some of the text is too long and I would like to limit the text in the field to "x" amount of characters and insert an ellipses (...) character when that
limit is reached. Cannot seem to find any mention of it in the Adobe. Is there such a method or class that will do this?

View 2 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 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

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 :: 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

Transitioning One Image To Another Using A Grid Of Squares?

Jun 12, 2009

I'm trying to do a transition that you've probably seen many times. Transitioning one image to another using a grid of squares where each square fades at a slightly different time.I've made a complex movie clip made up of several other movie clips with all the squares fading at the rate I'm looking at. When I just play the color squares it works fine, but the minute I turn that master movie clip into a mask for the image I loose the transition/fade completely--just an on off thing.

View 3 Replies

ActionScript 3.0 :: Calculating Pixels In Squares?

Jan 27, 2009

I have a math issue that I have some problems solving.

screen1

screen2

I need to calulate the pixels inside the squares and put them inside an array:

The main square rotates(see screen2) and i have the angle.

Something like attached code.

I have the following values:

- x/y of the main square. ( reference point )

- Width/height of the main square

- Width/height of all the squares

- Angle of main square..

View 8 Replies

ActionScript 2.0 :: Arrange Squares In Column?

Apr 23, 2010

I have a problem with arranging some thumbs in column when I resize the stage. The problem is that it is arranging the last square in line half outside the stage and you can see only a half.

ActionScript Code:
stop();
Stage.align = "tl";
Stage.scaleMode = "noScale";

[code]....

View 0 Replies

Actionscript 3.0 :: Draw Squares With DrawTriangles?

Jan 25, 2010

How do you go about drawing only the outline of squares using drawTriangle. Currently I am using lineStyle to draw my lines but obviously that outlines each triangle. I know i can just draw Squares out using drawRect with no fill but that seems like a waste.

View 6 Replies

ActionScript 2.0 :: Hide Some (most) Of The Squares From View?

Feb 10, 2004

Now I could do with some hints as to how this should be done Hopefully someone will help me out here.

Ok, basically I have a map (a jpg/gif file), which should be divided into squares (like a chessboard). Each square has a coordinate (X, Y) and other pictures should be shown on top of a map square - like a small house or something (also a jpg/gif file).

It should also be possible to hide some (most) of the squares from view - like with a black square on top or whatever. Perhaps Flash should also make some lines between each square to divide them.

Furthermore only a part of the map should be shown through a window (using a mask, I guess) as the map could be large and buttons at the edge could be used to scroll the map.

View 3 Replies

IDE :: Link The Red Squares To The Blue Square In 3D With CS4 Only?

Feb 20, 2009

I would like to link the red squares to the blue square in 3D with CS4 only (please no papervision or sandy...)I'm very closed to the solution but I still have a wrong z (visible when you move the mouse to a corner for instance)

[code]....

The main function is drawLines()

View 1 Replies

ActionScript 3.0 :: All TextFields Displaying As Squares?

Mar 18, 2011

I learned about the date class yasterday and made a lil app that will tell me when the next recess at school will be. It worked great when I ran it at home, but now when I try to run it at school all the letters in the textfields displays as squares, the numbers still work tho. The only difference I can think of is that at home i use CS5 and at school is use CS4, the font is embedded in the fla.

View 4 Replies

ActionScript 3.0 :: Manually Refresh The Page To See The New Squares

May 17, 2011

So far my code takes hex codes out of tweets containing a certain hashtag, and draws a square of that hex code colour. If someone were to tweet a new set of hexcodes while you were looking at the site, you would have to manually refresh the page to see the new squares.

[Code]....

View 6 Replies

ActionScript 3.0 :: Cut Up A Movieclip / Existing Bitmap Into Squares?

Jul 19, 2011

If an image is 800 by 600, copy the image's bitmap data and divide the image into, say, 20 by 20 squares, each having a reference to be manipulated later. Im guessing you have to use bitmapdata for that, unfortunately I dont know how to copy bitmapdata from an image's arbitrary x and y coordinates and for a certain width/height.

View 2 Replies

ActionScript 3.0 :: Fill Grid With Different Size Squares?

Mar 8, 2012

I'm trying to fill a grid with different size squares, randomly, and have no overlap. I want my grid to be 100px by 100px. I've tried creating a matrix array (10x10), holding x and y values. My square size is either 10x10, or 20x20. I loop through the matrix randomly picking a square (x,y position) and placing one of the two squares. All of this works fine, but obviously the squares start to overlap.

This is the type of outcome I'm looking for: I tried adding each square to an array, then checking if the current square placed collides (hitTestObject) with an already placed square. This eventually hits true every time, because the square placed matches the same square when placed in the array. Does anyone know of a way to accomplish this? Place each square but do not have overlap?

View 3 Replies

Actionscript 3.0 :: Using Loop To Create Multiple 3D Squares

Jun 8, 2010

I put together this code that builds a container that contains boxes(squares) in an ordered way. Problem is when I rotate the container, the boxes don't stay in their order. (something to do with swapping depths I think) . In fact, they look a bit confusing. Just create a movieClip 24 x 24 and Name it Box. Create another movieClip and name this one Container. Save them in your library. Then just copy this code and compile. You know the routine.

[Code]...

View 2 Replies

ActionScript 2.0 :: Make Each Of Squares Change Alpha Every Second

Jul 28, 2004

I want to make each of the squares (pictured below) change alpha every second or so. (fading).Is actionscript needed to do this?

View 13 Replies

ActionScript 2.0 :: Shape Tweens - Possible To Draw Squares

Jul 10, 2005

How you draw squares for example in AS (if at all possible) and using shape tweens in AS (again if possible).

View 3 Replies







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