ActionScript 3.0 :: Drawing Shapes Based On Button Selection?

Jan 3, 2011

I am in the process of learning AS 3 and Flash on my own and currently using the Actionscript 3.0 Adobe Classroom in a book CS4 version. Having a problem with the Lesson Adendum if anyone has done it. This lession requires you to create two buttons. They both draw shapes on the stage. When one is clicked, it draws Rectangles on the stage following the mouse movement. When the other is clicked, it draws Ellipses instead. The problem I am having is that it just draws rectangles and not ellipses when the 2nd button is clicked. Would be greatful if someone could tell me what i am doirng wrong. Here is the code that I have so far. Apologize for the commented out code, I left it in to show what I have tried:

[Code]...

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Drawing Api W/ Button Selection

Feb 18, 2009

I want to have 4 buttons my stage that draw different color boxes with the option of me reference them.Heres the working version so far without the capabilities of 4 buttons:[code]

View 0 Replies

ActionScript 3.0 :: Download A Song Based On A Radio Button Selection?

Apr 6, 2009

I'm trying to allow users to download a song based on a radio button selection. And I've succeeded in getting the "save as" box to pop up, but for some reason, the file does not actually download and save after you hit the save button.

[Code]...

EDIT: Someone informed me that if the variables weren't defined OUTSIDE of the function then they would be garbage collected. I moved them outside but it is still behaving the same.

View 1 Replies

Flex :: Drawing Lines Between Shapes?

Jan 24, 2011

I have one left panel in which there are different shapes like start,end connectors..... when i drag line image inside canvas i want to draw line/connector between two shapes how would i do it

View 1 Replies

Actionscript :: Drawing Shapes In Flex?

Feb 9, 2011

I want to develop an image editing application in Flex 4. My initial requirement is to draw various shapes like Line, Rectablge, Triangle, Circle, Star etc in appication. I want to facilitate user to draw shapes using rubber banding like professional applications do.

All shapes would be vector and should look smooth in an size. So, can't use bitmap and scale them.

What are better methods to achieve this?

View 2 Replies

ActionScript 3.0 :: Drawing Shapes At An Angle?

Dec 29, 2009

I have a code, that draws a horizontal line, then it turns into a slope, and at the end of the slope it draws a circle. Here's a code:

Code:
var xspeed:Number = 1; // defines increments for x of slope
var yspeed:Number = 2; // defines increments for y of slope
var hspeed:Number = 5; // horizontal line increments

[Code]....

Create document 800x700 and put this code into main timeline. Now test movie As you can see, everything works great. But there is a problem. The circle is being drawn at 0 degree angle. But I want the circle to match the angle of the slope, so it looks like the slope and the circle are both at the same angle.

View 1 Replies

Tween Between Two Shapes Created With Drawing Ap?

Jul 11, 2009

I have 2 shapes drawn with the drawing api - the points are stored in an array like this...

private var shape_points : Array = [ [81,61],[81,46],[84,43],[84,0],[11,0],[0,5],[0,48],[69,48],[81,61 ] ];

Both shapes have the same number of points. I need to tween the points from one shape to the other using tweenlite/max or tweener.

View 1 Replies

ActionScript 2.0 :: Animating The Drawing Of Shapes?

Oct 23, 2003

If I want to draw the stroke of a square just using actionscripting, I can (i.e moveto()).That will just show the stroke of a square as soon as I play the .SWF file.Let's say I want to animate the drawing of the stroke of a square from one point to the next. This way when I play the .SWF file, it will show the square being made. How would I go about doing so?

View 2 Replies

IDE :: CS4 Tutorial : Drawing Shapes In Flash?

Aug 24, 2010

This thread is designed to help collect discussion on the Drawing Shapes in Flash tutorial.

View 1 Replies

Flash :: Drawing Outlines Around Organic Shapes

Mar 21, 2010

One thing that seems particularly easy to do in the Flash IDE but difficult to do with code is to outline an organic shape. In the IDE you can just use the inkbucket tool to draw a stroke around something. Using nothing but code it seems much trickier. One method I've seen is to add a glow filter to the shape in question and just mess with the strength. But what if i want to only show the outline?What I'd like to do is to collect all of the points that make up the edge of the shape and then just connect the dots. I've actually gotten so far as to collect all of the points with a quick and dirty edge detection script that I wrote. So now I have a Vector of all the points that makeup my shape. How do I connect them in the proper sequence so it actually looks like the original object?[code]

View 1 Replies

Actionscript 3 :: Drawing A Connector Line Between Shapes?

Mar 24, 2010

I am building a diagramming tool using Adobe Flex 3. I am about to implement connector lines and I have a question.

Imagine I have 2 squares at random positions on the canvas. I need to draw an arrowed connector line between them. I need it to tend to the target square's center but end on its border.

How do I find out the exact points between which to draw the line?

View 3 Replies

Actionscript 3 :: Drawing Shapes In Flex 4 Addchild?

Mar 31, 2010

I am simply trying to draw a rectangle inside of a panel using flex4. I am using spark instead of mx. It complains about addchild being replaced by addelement; however, addelement expects type ivisualcomponent. I think sprite should be of that type; however, it reports an error when trying to use the below code... I have tried a few different ways. I think I am missing something very basic about flex 4.

[Code]...

View 3 Replies

ActionScript 3.0 :: Tween Between Two Shapes Created With Drawing Api?

Jul 10, 2009

I have 2 shapes drawn with the drawing api - the points are stored in an array like this...

Code:
private var shape_points : Array = [ [81,61],[81,46],[84,43],[84,0],[11,0],[0,5],[0,48],[69,48],[81,61 ] ];

Both shapes have the same number of points. I need to tween the points from one shape to the other using tweenlite/max or tweener.

View 1 Replies

Actionscript 3.0 :: Tween Between Two Shapes Created With Drawing Api

Jul 10, 2009

I have 2 shapes drawn with the drawing api - the points are stored in an array like this... Code: Select allprivate var shape_points : Array = [ [81,61],[81,46],[84,43],[84,0],[11,0],[0,5],[0,48],[69,48],[81,61 ] ]; Both shapes have the same number of points. I need to tween the points from one shape to the other using tweenlite/max or tweener.

View 1 Replies

ActionScript 2.0 :: Drawing Board How To Add Text, Shapes

Oct 17, 2006

(MX2004)I have made a 'whiteboard', users can draw on it, change width of pen, clear it.

I need to:

1. allow users to add text as well as lines

2. allow them to add a circle or a square

3. clear last stroke/shape

4. save the drawing

5. email it or print it

View 9 Replies

ActionScript 3.0 :: Drawing Shapes So That Anything Inside Gets Deleted

Aug 7, 2010

I want to draw lines to make a region so that anything inside that region is deleted. The Case : You could say that there are many movieclips in stage but when I just selected by drawing circle or something even complex shape to it purposely then anything inside that shape is just gone.

View 3 Replies

Flex :: Workarounds For Flash Bug When Drawing Large Shapes?

Dec 12, 2009

When you use Graphics object to draw very large shape(that does not fit in 10000x10000 pixels) stroke width may become much wider than value specified in lineStyle function.For now I have only two options:

1. When drawing line you can split it into several lines. However this trick does work only for drawing lines, polylines and polygons. There is no way to apply this to drawing circles and ellipses. Well, we can approximate circles via bezier curves, but this approach seems to be very inefficient.

2. Perform manual cliping. But this require manual implementation of different cliping techiniques, and I think ActionScript does not suit well for this sort of task. And again there is need to approximate visible parts of large circles.

View 1 Replies

ActionScript :: Library For Drawing Resizing Moving Shapes And Text?

Nov 6, 2011

I know Sprite.graphics is pretty easy to use, but I was wondering if there is any ready made libraries for drawing, resizing, moving, layering, etc.. of various display elements? Also, stuff like tool selection, maybe some effects, premade shapes. Anything you would recommend?

View 1 Replies

ActionScript 2.0 :: Displaying Element Based On Selection?

Sep 14, 2011

how I would go about to accomplish the following:

There should be 3 dropdown menus with predefined words

1. First menu has 3 predefined options
2. The second dropdown has 5 options.
3. The third dropdown has 3 options

--> Depending on which word is selected in dropdown #2, an img (of a total of 5 possibilities) is being displayed

In addition there is a dynamic textfield, where you can enter a name, which should then be displayed along with the img.

View 1 Replies

ActionScript 1/2 :: Image Selection Based On Criteria And Filename

May 28, 2009

Here is what I'm trying to do. I have a sunroom product that is available with several different options. I have created images of every possible combination of options, and named the files like this:
 
DeckFurniture_NoVisor_ClearGlass_View1.jpg
 
Hot Tub_Visor_TintedGlass_View3.jpg 
 
I want users to be able to choose their options, and have the appropriate picture be displayed. So to get the above image, they'd have to choose "Deck Furniture" "No Visor" "Clear Glass" and "View 1". Or to get the other one they'd choose "Hot Tub" "Yes Visor" "Tinted Glass" and "View 3"
 
It's not necessary to have it auto-update the image, so I was thinking they could choose their options and then click "Update", and that would in a sense pull up the correct filename from the options they've chosen. I'm not exactly sure how to tell Flash to change this master variable (the filename) whenever one of the sub-variables (pieces in the filename) change. Would I have to put a script on each option button telling it when it gets selected to change the master variable?

View 5 Replies

Actionscript 3 :: Change Combobox Selection Based On Value In An Object In Flex?

Jun 14, 2010

how do i change the item selected in a combobox selection based on a selection of a datagrid object?

View 2 Replies

ActionScript 3.0 :: Creating Selection Border Around Sprite Based Object

Oct 22, 2010

I'm trying to make a little program. It works right now by drawing the top shape to the dark gray area, where it then copies itself and changes color. The new shape can be re-dragged as well. What I want to do now is add a dynamic border when I click on the new object, I want the box to adjust to an appropriate size. And on mouse release I want the selection border to disappear on the new shape. I want the selection border to be dashed much like you find in many of Adobe's programs, if at all possible.
Attached is my .fla file

View 1 Replies

ActionScript 3.0 :: Unable To Click Some Words In The Text And Based On The Selection Clicked?

Mar 8, 2011

I have a simple TLF text box on stage. i want to be able to click some words in the text and based on the selection clicked got to some other place on a timeline or set a variable (not a link to an external web page).
 
sounds like it shout be simple but i cannot seem to find any information about it.
 
i seem to remember having done something similar years ago in as1 or as2.

View 3 Replies

Flex :: Flash Builder Show / Hide ComboBox Based Off Selection

Mar 29, 2012

Is it possible to show or hide a comboBox based off the selection made in another comboBox. I have been looking for documentation on this to no avail.

View 2 Replies

Dynamic Drawing - Choose And Draw With Other Shapes - Square - Forward Slash (/) - Backward Slash ()

Oct 13, 2009

I am trying to work with this flash tutorial -[URL] So far it draws with a simple rounded line. I have been extending this application by making the drawing board bigger and other small things. I now want to be able to choose the line style. Currently it is rounded and I want to choose and draw with other shapes - square, forward slash (/), backward slash (). Is this possible? If so, could you explain how I could go about it?

View 1 Replies

ActionScript 2.0 :: Snap - Press Button To Detect The Last Button Pressed And If The Shapes Match

Jan 12, 2009

I want the press button to detect the last button pressed and if the shapes match, make them do something...obviously. I think I'm going at it the wrong way. I need to stick a "triange" id into the button/mc then if compares that and then if there is a match works then... right?

[Code]...

View 1 Replies

ActionScript 2.0 :: Drawing Curve Based On Data Points?

Jun 25, 2007

I'm trying to draw a curve based on 24 data points. I want to draw a curved line based on the average of these 24 points. I can draw a line from point to point no problem, but would like a smooth curve. The white dashed line is what I'm trying to achieve:

View 2 Replies

ActionScript 3.0 :: Curved Smooth Drawing Based On Motion?

Feb 4, 2009

i made an animation following a motion guide and i drew a line from animated movie clip's previous position to its current position. The problem is that with curves this method is very unprecise... the edges are much too jagged even with the event firing every milisecond.

[URL]

So basically my question is if it's possible to create a nice curved animation using my method or do I have to draw it manually using lineTo and curveTo and snychronise it to the MovieClip's movements or maybe creating some sort of mask to reveal the already drawn symbol?

Code:
var shape:Shape = new Shape();
this.addChild(shape);
shape.graphics.lineStyle(1, 0x000000);

[code]....

View 2 Replies

ActionScript 3.0 :: Import Shapes Directly From The Library As Shapes And Not As Sprites / MovieClips?

Feb 17, 2009

I have a question about shapes (i mean the flash.display.Shape class). Is it possible to import Shapes directly from the library as Shapes and not as Sprites/MovieClips? Shapes are supposed to be faster than MovieClips/Sprites, right? So why is it only possible to import MCs/Sprites from the library? I understand that generally shapes could be created solely by actionscript, but in my case the shape comprises of many points and is curved - so it's quite infeasible.

Is there maybe some sort of plugin to generate code that would draw the desired shape from a drawn shape in CS4? And a last one: Are there any benchmarks out there for performance comparison between sprites/mcs/shapes? How much performance do i loose by using a sprite instead of a shape?

View 2 Replies

ActionScript 3.0 :: Function - Drawing The Polygon Based On The Number Of Sides

Dec 29, 2011

I'm trying to create a function that draws a polygon with two parameters that are: number of sides and length of sides. You would input a number for side length and a number for the number of sides. Then it would draw the side length, then turn at a angle based on the number of sides, then draw side length again... until it has finished drawing the polygon based on the number of sides that were put in.

View 1 Replies







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