Drawing App That Recognises Shape
Hi,
im trying to make a small drawing app used to let people vote
so each item has a small drawing area next to it where people can draw a X or a √ (Tick)
so i was wondering if flash could do such a thing or if anyone has a other kind of solution
thanks
Ultrashock Forums > Flash > ActionScript
Posted on: 2008-08-04
View Complete Forum Thread with Replies
Sponsored Links:
Drawing Custom Shape, And Filling Shape
Hello Forum members,
I have not yet figured out how to fill a shape (not an oval or a rectangle) that I draw.
for example, I draw a triangle with the pen tool (or the pencil tool). I have a nice triangle now.
Three lines, etc.
How can I fill this new "shape" with a color? Witout using the brush or the pencil and drawing color in.
Thanks,
eholz1
View Replies !
View Related
Help With 'drawing' A Shape
Hi guys,
I started learning the basics of Flash a couple of years ago and have had a big 'gap' in my Flash knowledge in the last year or so and am really rusty now. I am trying to create an intro web animation which starts by effectively 'drawing' out a swirl shape. I have the finished swirl but how to I get Flash to 'draw' it? Do I have to use masks? Any help would be greatly appreciated.
luisack
View Replies !
View Related
Drawing A Shape From A Txt File
I have a text file, which has X and Y coordinate values for a shape:
how can I place these X and Y values in an Array, then use this array to draw the shape? using actionscript
then turn this shape into a mc symbol
please help
View Replies !
View Related
Animation Of The Drawing Of A Shape
Could someone please offer some guidance, I am a fairly experienced flash user, however I have not been able to figure this out.
I am trying to animate the drawing of shapes
as an example: a circle, starting as a point that arcs out and around to finish as the whole circle shape
I have seen this and like it been done everywhere, is there a straightforward way of doing it via
animation & masking?
actionscript?
would appreciate any assistance or advice
Thanks!
View Replies !
View Related
Can't Break Apart My Drawing Shape
I'm following one of the tutorials in the beginners area and I'm having a time trying to figure out why my shape won't break apart...I just drew a simple thing with the pencil tool, on a new layer and made a keyframe and the "break apart" option is greyed out...can anyone help? No, it hasn't been made a symbol or anything like that...just a drawn shape.
View Replies !
View Related
Drawing Api Edit Shape
Hi,
I've looked around and haven't found anyting on this so i figured i'd ask. I'll explain what i'm trying to do first:
I want to import an image(containing a persons face) and then allow them to select points on oval shape that will be set to a mask(maybe 5 points?) that they can drag to make it so only their face is masked out.
I'm assuming i'd use the drawing api to do this. Is this correct and does anyone know if there are any tutorials out there that explain how to edit a shape in this fashion dynamiclly?
Thanks.
Paul
View Replies !
View Related
Drawing A Line From One Shape To Another
OOPS perhaps i should have posted this in the flex forum......I'm developing an application in Flex.
So I found out how to create shapes with the Drawing API. I also found out how to draw lines from a point (x1, y1) to a another (x2, y2).
I am going to try to explain this as easily as i can. I dynamically generate two triangles and add them to a canvas as follows:
var triangleHeight:uint = 100;
var triangle:Shape = new Shape();
// red triangle, starting at point 0, 0
triangle.graphics.beginFill(0xFF0000);
triangle.graphics.moveTo(triangleHeight/2, 0);
triangle.graphics.lineTo(triangleHeight, triangleHeight);
triangle.graphics.lineTo(0, triangleHeight);
triangle.graphics.lineTo(triangleHeight/2, 0);
// green triangle, starting at point 200, 0
triangle.graphics.beginFill(0x00FF00);
triangle.graphics.moveTo(200 + triangleHeight/2, 0);
triangle.graphics.lineTo(200 + triangleHeight, triangleHeight);
triangle.graphics.lineTo(200, triangleHeight);
triangle.graphics.lineTo(200 + triangleHeight/2, 0);
var uiWrapper:UIComponent = new UIComponent();
uiWrapper.addChild(triangle);
myCanvas.addChild(uiWrapper);
So one triagle is red then the one to its right is green. I can certainly connect both triangles by drawing a line between them like this:
triangle.graphics.lineStyle(1, 0xFF0000);
triangle.graphics.moveTo(50, 50);
triangle.graphics.lineTo(230, 50);
each triangle will have "drag and drop" functionality so heres is my question: how can I assign a point in each triangle so that the drawn line will be redrawn each time a triangle is moved? with the line drawing above that line is static. In toher words I need a dynamically drawn line that will adjust to the position of the triangles. Any ideas/tips/resources????? If lets say instead of triangles I used Button components is there a way to assing "connection points" to the buttons as well??? I would much rather use the buttons than the shapes but whatever gets me to the end....
Help!
View Replies !
View Related
Actionscript Shape Drawing...
With this following code I am drawing a box. Now, I would like to address the lines for each side of the box individually so that I can set their color individually. Any ideas?
PHP Code:
MainWindowClass.prototype.init = function() {
// Create Color Object
stage_mc_lineColor = (0x000000);
stage_mc_fillColor = (0xCCCCCC);
// Create Empty Movie Clips
this.createEmptyMovieClip("stage_mc", 3);
// Draw Box
with (this.stage_mc) {
lineStyle(.1, stage_mc_lineColor, 100);
moveTo(-100, -100);
beginFill(stage_mc_fillColor, 100);
lineTo(100, -100);
lineTo(100, 100);
lineTo(-100, 100);
lineTo(-100, -100);
endFill();
// Color lines individually...
}
}
View Replies !
View Related
Preloading In A Shape Or Drawing...
hello,
I was wondering how a preload such as this is done:
http://foxbox.tv/winx_microsite/fairies.php
you see how the have a outline of the charactors and fill it up with a preload?
I know they're using a masking technique, but what is involved here?
View Replies !
View Related
Custom Shape Drawing
Hey all,
Just wondering if it's possible to draw custom shapes in flash, ie: dragging out a rectangle in photoshop.
any good links or advice on how to accomplish this would be greatly appreciated.
View Replies !
View Related
Animating A Drawing API Shape
Drawing API examples always seem to be either really simple or really complex. I'm interested in doing something fairly simple (I think). I'd like to draw an abstract curved shape with the Drawing API and animate the shape of the object to slowly change over time. Nothing really dramatic. Kind of like a lava lamp, I suppose. I understand this is done with movie clip control points but I haven't seen any examples I can understand. I'm attaching a file showing an example of what I mean (done with manual tween in MX 2004). Thanks in advance for your help.
View Replies !
View Related
Closing Drawing API Shape
I've been making changes to an Ivan Dembicki "elastic line" sample file. I'd like to close off the shape with a curved line so that the shape doesn't have a hard edge to it. Right now the shape fill closes off the shape (the shape itself isn't closed). I've tried various things but failed miserably. Anyone know how to turn this into a closed, rounded shape? I'll attach my file but this is what Ivan's drawing API code looks like:
Code:
p.onEnterFrame = function() {
this.clear();
//this.lineStyle(3, 0xFF0000, 100);
this.lineStyle(1, 0x4827CF);
for (var i = 1; i<this.arrMC.length-1; i++) {
this.update.apply(this.arrMC[i]);
}
var e, s = this.arrMC[0];
this.beginFill(0x4827CF);
this.moveTo(s._x, s._y);
for (var i = 1; i<this.arrMC.length; i++) {
s = this.arrMC[i-1];
e = this.arrMC[i];
var mx = (s._x+e._x)/2;
var my = (s._y+e._y)/2;
this.curveTo(s._x, s._y, mx, my);
}
this.lineTo(e._x, e._y);
this.endFill();
};
I'm working in Flash MX 2004. Thanks for the help.
View Replies !
View Related
Drawing Board Within A Shape
Heya everyone,
I've been reading up on this drawing board AS and I can get it to work easily by itself, however I want to be placed within a shape and I'm not sure how to adapt to do so (e.g. A drawing board within a circle outline)
Drawing Board
http://www.kirupa.com/developer/acti...awingboard.htm
Any help would be really appreciated
Natushi12
View Replies !
View Related
Preloading In A Shape Or Drawing...
hello,
I was wondering how a preload such as this is done:
http://foxbox.tv/winx_microsite/fairies.php
you see how the have a outline of the charactors and fill it up with a preload?
I know they're using a masking technique, but what is involved here?
View Replies !
View Related
Flash Menu That Recognises Url
My website has a menu made with flash. This menu repeats itself in diferents html according to the info for the different sections.
What i want to know is how to make my flash menu recognise the url in which it stands, so it can mark the corresponding button for that info.
( i want users to know in which section they are)
Thanks
View Replies !
View Related
Converting A Shape Into A CS3 Drawing Object
Hello!
I've noticed that when I draw, say a square, in CS3, it becomes a "Drawing object" (like a symbol that doesn't appear in the library), instead of a pure shape like in Flash 8.
But let's say I break a drawing object down into a shape, how do I convert this shape back into a drawing object?
I like drawing objects, they're cool for simple shapes that I don't want in my library, and that I don't want to get distorted like pure shapes (despite being placed at integer positions) particularly in large documents.
Anybody know?
Thanks,
Kyrre
View Replies !
View Related
Adding A Stroke After Drawing A Shape?
I drew a circle on the stage using the oval tool and the stroke was set to none so it does not have one. I now want to add a stroke to it, so I select the entire oval by dragging over it and choosing black for the stroke color, though it will not apply the stroke to the shape. What am I doing wrong?
Thanks.
View Replies !
View Related
Drawing In MX - Confined To Shape (not Square)
Howdy
Another bump in the road for me.
I've found a similar thread to this but my problem's a little different.
I've never used the drawing function on Flash and I followed the fairly simple tute on it just recently.
Is there any way to confine the drawing area to a specific shape. Mine's a rectangluar shape that's rotated. You can download my FLA with the background image here > http://www.realchurch.com.au/my_draw.zip
I'd like to try and keep it confined to the notepad area.
Anyone know? I think it might be a hitTest thing with if/else. Not sure.
My other thing would be to just rotate the notepad so that it's straight.
Even still i'd like it confined to the area beginning with the corner of the notepad, not the corner of my movie.
Anyone got any thoughts?
View Replies !
View Related
Drawing In MX - Confined To Shape (not Square)
Howdy
Another bump in the road for me.
I've found a similar thread to this but my problem's a little different.
I've never used the drawing function on Flash and I followed the fairly simple tute on it just recently.
Is there any way to confine the drawing area to a specific shape. Mine's a rectangluar shape that's rotated. You can download my FLA with the background image here > http://www.realchurch.com.au/my_draw.zip
I'd like to try and keep it confined to the notepad area.
Anyone know? I think it might be a hitTest thing with if/else. Not sure.
My other thing would be to just rotate the notepad so that it's straight.
Even still i'd like it confined to the area beginning with the corner of the notepad, not the corner of my movie.
Anyone got any thoughts?
View Replies !
View Related
Converting A Shape Into A CS3 Drawing Object
Hello!
I've noticed that when I draw, say a square, in CS3, it becomes a "Drawing object" (like a symbol that doesn't appear in the library), instead of a pure shape like in Flash 8.
But let's say I break a drawing object down into a shape, how do I convert this shape back into a drawing object?
I like drawing objects, they're cool for simple shapes that I don't want in my library, and that I don't want to get distorted like pure shapes (despite being placed at integer positions) particularly in large documents.
Anybody know?
Thanks,
Kyrre
View Replies !
View Related
Drawing Gradientfill Shape Don't Work [as2]
Allright, i tried to draw a simple square shape with a gradient using an old s1 function. It didn't work. I check, with an exemple that macromedia give in flash mx 2004, what was wrong and nothing was wrong !!!!
This is the exemple code from macromedia give in the actionscript dictionary in flash mx 2004.
_root.createEmptyMovieClip( "grad", 1 );
with ( _root.grad )
{
colors = [ 0xFF0000, 0x0000FF ];
alphas = [ 100, 100 ];
ratios = [ 0, 0xFF ];
matrix = { matrixType:"box", x:100, y:100, w:200, h:200, r45/180)*Math.PI };
beginGradientFill( "linear", colors, alphas, ratios, matrix );
moveto(100,100);
lineto(100,300);
lineto(300,300);
lineto(300,100);
lineto(100,100);
endFill();
}
Nothing new, it's the same code in as2 then in as1. But it does'nt work.
What is the problem ?? Is 'Math.PI' the problem ?
any ideas, please share.
View Replies !
View Related
Drawing A Shape Behind An Existing Mask
Hi, I have a clip on my stage.
Their is only 1 layer in the shape.
On this layer is a shape which is a mask.
I am trying to place a dynamic fill behind this mask.
(so the dynamic shape is masked by the mask that is in that clip)
I cannot get it to function. I'm just using the draw command - but it keeps ignoring the mask? Any ideas>?
M@)
View Replies !
View Related
Password Box That Recognises Multiple Passwords
Hi all,
Can anyone tell me why this piece of script does'nt work:
on(release){
if(passwordbox.value== 'password'||'123123') {
gotoAndPlay('correct');
} else {
gotoAndPlay('incorrect');
}
}
it's supposed to recognise only the terms 'password' and '123123' as the correct password, and direct all other attempts to 'incorrect'. But it send all attempts to 'correct'. If i take the || out and only have one correct password it works though.
Thanks
Scott
View Replies !
View Related
Drawing A Shape With A Fade From Color Til 0 Alpha
Hi
I was doing some assets loading and thought I would construct some bits of graphics myself, instead of using the ones laid out for me in photoshop.
The "new" drawing API is giving me a bit of trouble regarding fades/transparency.
I drew a simple square and using the gradient box I am trying to make that box fade from color to nothing, becoming completely transparent on the right edge and completely opaque on the left edge..
I have been fondling this script for 2 hours and cannot get it to behave as I wish to: (the above)
Code:
var gloss:Shape;
var fillType:String = GradientType.LINEAR;
var colors:Array = [0xFFFFFF, 0x000000];
var alphas:Array = [0.9, 0.1];
var ratios:Array = [0x00, 0xFF];
var matr:Matrix = new Matrix();
gloss = new Shape();
matr.createGradientBox(198, 36, (Math.PI/2)*-1, 0, 0);
var spreadMethod:String = SpreadMethod.PAD;
gloss.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
gloss.graphics.drawRoundRect(1, 1, 98, 28, 3, 3);
gloss.graphics.endFill();
I can only get it to fade from one color to another, not from one color to another with 0 alpha.
Is there a better way to go around this one.
Thanks
View Replies !
View Related
Using Drawing API Shape To Mask Another Movie Clip
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. Does anyone know how to make this work?
Code:
// CREATE MASK SHAPE WITH DRAWING API
// create empty movieclip
createEmptyMovieClip("mc", 10);
// set total number of points
total = 10;
// set point & control-point coordinates
pt = [];
cp = [];
for (i=0; i<total; i++) {
pt[i] = {x:Math.random()*400, y:Math.random()*400};
cp[i] = {x:Math.random()*400, y:Math.random()*400};
}
// draw function
this.onEnterFrame = function() {
// clear the old drawing
// and draw a new one using
// the points & control-points
mc.clear();
mc.beginFill(0x0088B2, 100);
mc.moveTo(pt[0].x, pt[0].y);
for (var i = 1; i<total; i++) {
mc.curveTo(cp[i].x, cp[i].y, pt[i].x, pt[i].y);
}
mc.curveTo(cp[0].x, cp[0].y, pt[0].x, pt[0].y);
mc.endFill();
// set new positions
// for points & control-points
// and make sure they're inside stage
for (var i = 0; i<total; i++) {
pt[i].x += Math.random()*4-2;
if (pt[i].x<0) {
pt[i].x = 0;
} else if (pt[i].x>400) {
pt[i].x = 400;
}
pt[i].y += Math.random()*4-2;
if (pt[i].y<0) {
pt[i].y = 0;
} else if (pt[i].y>400) {
pt[i].y = 400;
}
cp[i].x += Math.random()*4-2;
if (cp[i].x<0) {
cp[i].x = 0;
} else if (cp[i].x>400) {
cp[i].x = 400;
}
cp[i].y += Math.random()*4-2;
if (cp[i].y<0) {
cp[i].y = 0;
} else if (cp[i].y>400) {
cp[i].y = 400;
}
}
};
// CREATE ANIMATED BACKGROUND
createEmptyMovieClip("background_mc", 1);
//trace(targetPath(_root.background_mc));
onEnterFrame = function () {
r1 = Math.sin(ra1 += .002)*50+51; //default for all: 127+128
g1 = Math.sin(ga1 += .004)*50+51;
b1 = Math.sin(ba1 += .006)*127+128;
r2 = Math.sin(ra2 += .001)*50+51;
g2 = Math.sin(ga2 += .003)*50+51;
b2 = Math.sin(ba2 += .005)*127+128;
col1 = r1 << 16 | g1 << 8 | b1;
col2 = r2 << 16 | g2 << 8 | b2;
matrix = {matrixType:"box", x:0, y:0, w:740, h:466, r:0};
with (background_mc) {
clear();
beginGradientFill("linear", [col1, col2], [100, 100], [0, 255], matrix);
lineTo(740, 0);
lineTo(740, 466);
lineTo(0, 466);
lineTo(0, 0);
endFill();
}
};
_root.background_mc._x=0;
_root.background_mc._y=0;
// SET MASKING - WORKS WITH CLIP CONTAINING IMAGE ONLY
//_root.image1.setMask(_root.mc);
_root.background_mc.setMask(_root.mc);
View Replies !
View Related
Flash Drawing: Fill A Drawn Shape
Hey guys, I'm not familiar with the flash drawing api at all so I've come here
I've got a simple thing that allows you to draw lines. So lets say I draw a triangle or random closed shape with the mouse. How can I fill that with a color or bitmap?
View Replies !
View Related
Mac OS X Dock-type Effect By Drawing A Shape
I'm looking to create an effect similar to how the dock grows in OS X when a user rolls over a particular area of a gradient. Basically, I'd like to draw a gradient on the bottom of the stage, then depending on where the user moves the mouse, the top path of the gradient bows out a bit to follow the mouse's x location.
Has anyone seen any sample code to create this type of effect or done anything similar? If not, can anyone help me get started?
Thanks!
View Replies !
View Related
Trying To Show "drawing" Effect Along Line Of A Shape
I am trying to get a simple shape to "draw".. I found this tutorial
http://actionscript-toolbox.com/shapeDefinedMC.php - that's what I'm going for - just drawing the lines - but this tutorial is over my head!
I created a shape with the Flash pen tool, put it in a MC (shouldn't this then be a 'shape defined MC' at this point?) and tried:
onClipEvent (load) {
this.drawAlong({width:2, color:0x0000aa, alpha:100}, 2, {npts:20, type:'b', fixed:false}, 25);
}
I know I must be missing something... can anybody help?
View Replies !
View Related
Is There A Way To Perfectly Compare Overlapping MC's Shape On Shape?
Is there some sord of hitTest tweak or script/code that can tell whether the two movie clips are overlapping each other SHAPE on SHAPE and not bounding box on bounding box? I have experimented that whenever I use the hitTest code like this.hitTest(anotherMovieClip) it does not work as I hoped.
Don't get what I mean? Well...
Is is possible to compare 2 objects shape against shape by doing a hit-test from object A to compare it against the shape of object B and then another hit-test to compare object B against the shape of object A and if both give true then the shapes are overlapping each other?
View Replies !
View Related
Shape Hint Makes Shape Dissapear
Sometimes (not always) when I add shape hints to shapes to help shape tweening, the tweened images inbetween two shapes dissapear leaving nothing except for the first image on the first frame and the last image on the last frame that i'm trying to shape tween.
This only happens if i'm using shape hints, and if I take them away, it tweens normally.
How can I fix this and still use the shape hints?
View Replies !
View Related
Is It Possible To Get The Dimensions Of An Oblong Shape? Or Can I Replace The Shape?
I am using the loader to load an swf. The swf has movieclips inside that I register to my class using this.clip1 = loadedMov.getChildByName("clip1");
Say clip1 contains only a solid colored, oblong shape. I want to be able to change clip1's color to a gradient fill and retain the oblong shape. What is the best approach to do this? The shape would be a little difficult to draw dynamically. It also would not be practical to redraw it for every possible gradient at design time for my situation.
Seems to me I should be able to replace the shape's color with a gradient like a ColorTransform does for solid colors, or get the vectors of the shape and redraw it with beginGradientFill. Really need help on this one.
Tags: Actionscript 3.0
View Replies !
View Related
Shape To Text Shape Tween Not Responding
I wanted to know if anyone has encountered this problem or can see that I'm doing something wrong. It really doesn't look too complex and I've also done it before with no issue. I'm only running 2gb of ram, but I've done this plenty of times with no latency and for some reason recently it just won't work. I'm using CS3 Pro, AS 3
Set up:
Draw a square in frame one
create a blank keyframe on say, frame 30
write some text on frame 30
shape tween the square into the text
Results:
If I tween the square to a single character-no problem
If I tween the square to a sentence slow tween on preview and publishing
If I tween 3 paragraphs it will bomb out and go into...not responding and I have to shut down the program
Any thoughts?
View Replies !
View Related
Shape Tweening, Shape Hints...
I can't seem to be able to make shape hints affect the morphing of a box...the hint remains red color wherever i place it both in the starting frame and the end frame of the tween. Also, i also cannot set the initial width of the box to be tweened as 1px...if i do that the tween breaks down. But frustrating, i was able to set it a 1 px width the very first time i tried.
View Replies !
View Related
Scrolling Drawing Board? Drawing Without Moving The Mouse
Hello, I'm new to this board and kind of a flash newbie so you could probably help me out.
What I'm trying to build is what you could call a scrolling drawing board - just like a drawing board but when the mouse comes close to the edge of the window, it scrolls and lets you continue your drawing.
I have no problem creating a drawing board with API, but i can't make it scroll. Usually when i want to scroll a background image i make it move along with the mouse when the cursor is near the edge of the window (for example, if the mouse's coordinates are above a certain number, the background image starts moving in one direction so it "scrolls" in the other direction).
So i wanted to do this with the movieclip of the drawing in a drawing board (make it move according to mouse's coordinates near the edge of the window), but when i scroll i have to stop the mouse at the edge of the window because i cant go any further :p so the drawing moves but it stops drawing. Or maybe what i need is some way to draw even when the mouse is not moving. Is that possible?
I'm sorry it may seem a bit confused (moreover english isnt my native langage :p), I'll try to post an example later. In the meantime, if any of you see how i can do that ... thanks
View Replies !
View Related
Shape / Shape HitTest
Another problem:
When I type
Code:
object1.hitTest(object2)
it checks the square around object1 with the square around object2
Code:
object1.hittest(object2._x, object2._y, true)
checks the object1's shape with the center of object2
But I need to check object1's shape with object2's shape. Is it possible?
View Replies !
View Related
|