ActionScript 2.0 :: [flash] Drawing A Variable?
Jan 11, 2008How do you draw a variable in simple font? How do you control where it drawn?
View 4 RepliesHow do you draw a variable in simple font? How do you control where it drawn?
View 4 RepliesI have been trying to do some dynamic drawing with flash but can't seem to address a movie clip if I stick a variable in it's name.[code]...
View 2 RepliesI'm attempting to make a very simple drawing programme. There will be maybe 4/5 buttons. Three of them when you click on the change the color of the line the user draws. the other two will change the line thickness. I've tried setting up a variable to set to how thick the line should be depending on the button the user has pressed.But it has no effect - i'm guessing that's because the variable only exists within the confines of the function that I have it in.[code]
View 1 Repliesi've tried to simulate a pencil tool, for drawing above a imagem, but the drawing is below the picture. How fix it?
[Code]....
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.
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].....
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]....
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]...
I am very new to flash and only know the basics, but would like to put together a flash animation similar to this website [url]...
View 3 Replieshow to draw various things, cartoons in Flash.
View 2 RepliesI'm in the process in making a little drawing board using flash Drawing API. Right now i have the lines drawn by using lineTo() but i was wondering if there is a way to erase portions of the line. I know i could just write over it with white but was thinking of a better way. maybe by change the alpha or using a mask something like that. Just wanted to know if anyone came across this before or have a theory that can give me some insight to solve this problem..
View 1 Repliesvar loader:Loader = new Loader();
loader.load(new URLRequest("panghat spa.swf"));
addChild(loader);
want to load panghat spa.swf as a variable by pasing variable from html page in to flash
I have a small flash that I'd like to expand upon, and basically I'm wondering if it's possible to Make a button that lets you erase things on click, rather than clearing the screen.Draw lines of different colours/thicknessHave the Flash output a code for the drawing (similar to Punk-o-Matic 1/2) and be able to put it into the Flash in a text form to have it output the picture. (Thus allowing sharing of pictures).Here's the code.
// 1. SETTING THINGS_root.createEmptyMovieClip("line",1);
// 2. EVENTS IN _ROOT:_root.onMouseDown = function(){ line.moveTo(_xmouse,_ymouse); line.lineStyle(2,0x000000,100); this.onMouseMove = function(){ line.lineTo(_xmouse,_ymouse); updateAfterEvent(); }}_root.onMouseUp = function(){ this.onMouseMove = null;}
Also see included .fla. It's very small as all it features is a default stage that you can draw on, with an Erase button that clears the screen.
I've come across a bug in flash drawing api where if you draw many (24) light opacity layers things get blotched especially if you use bitmap.draw(). I have read somewhere that this is how the draw method has been coded but I don't see any work arounds.
View 24 RepliesWhat's the easiest way to draw a hex grid algorithmically? How should I present them in data?
For example, in a square grid, I could just save x-y coordinates..
I'm creating a flash game which uses time intervals with setInterval and sometimes does heavy calculations. The problem is that on slower machines these calculations can't keep up with the framerate and the movie slows down BUT the timers are unaffected what makes them asynchronous to the movie. Looking back, it was a bad idea to use timers but I can't change it back now. So...is there a way to skip drawing frames?
View 2 RepliesThe issue I am having is how to tackle forming a logo using circles. I have done one letter manually, however it would take forever to do this with every single letter, and so I am asking here if anyone knew of a faster method. Requirements:
- Has to fill non-circular letters(i.e. does not have to be precise, but look like it has edges)
- Circles have to animate in, therefore they need to have drop shadow and seem like they are landing in place
Okay, there are a few things I want to know how to draw in one-point perspective: a toilet, a shower, a bath; basically I want to know how to draw everything in a bathroom.
View 0 RepliesWhy flash slows down while drawing API(?) Is there a way to avoid it from slowing down. Heres just a random script of what i mean.[code]...
View 3 Repliesjust wondering if anyone has ever had any luck drawing spirals in flash? ive had a stab at it a few times, but it always results in a pretty 'boring' looking spiral... this is the code i've been workin on:
Code:
my._x = Math.sin( this.currentTime ) * this.spiralRingSpacing
my._y = Math.cos( this.currentTime ) * this.spiralRingSpacing
where this.currentTime = an incrementer
and this.spiralRingSpacing = a integer
I was hoping to get one that had more control. with a formula I could use to change the 'weight' of the inside and outside of the spiral..
I'm trying to design an application where you can draw lines. This is my code.
Code:
onMouseDown = function (){
original_x = _root._xmouse
original_y = _root._ymouse
[Code].....
value_obtained is true when you click the mouse, and is made false when the mouse is released. original_x and original_y are the coordinates for the point of the first click.
How can I make it so that each created line stays on the screen and is not remade?
This thread is designed to help collect discussion on the Drawing Shapes in Flash tutorial.
View 1 RepliesAs we know whent here is no such variable of null value assignment to a variable or instance flash throws this kind of Error.In one of my Application i need to get more flashVariables, They may or maynot come as FLASHVARS. But when i miss any variable flash thows this error as an alert box. is there any simple solution to avoid this kind of issue
when i use try,Catch statement the issue will not come, But i don't like to write Bunch of try,catch statement for all this kind of variables.
I am trying to do is declare a variable in PHP and pass that variable to my flash file. Right now i am simply trying to do 1 easy variable, more will happen in the future but i need to figure this out first.I have used other forums and they say try this and that, but nothing i do seems to work. here is my code.
PHP Code:[code].....
export a drawing made in flash as a transparent png in actionscript I know you can do it as a jpg with a white background but can you export the transparency?
View 3 RepliesI created a simple drawing app using Action Script 3.0.My son asked if I could set it up so a drawing could be sent as an email. My website use a dynamic text in order to do that and I annot find any references that would help me out.Right now I am using Sprites and Movie Clips.
View 3 Repliesthe short version of what i need to do - via AS3 and PHP - is a user can come to this project and draw something. drawing's no problem, that's done. my issue is figuring out how to take that drawing data, converting it into something i can save to my database ... then reload said data and recreate it on the stage when the user "loads" it.
i guess i'm just searching for a way to take drawn data (just using typical as3 drawing methods) and breaking it down to a string, then bringing that string back in and recreating it. i'm not super versed in ByteArrays - which i suspect is where my answer lies.
user doesn't need to adjust any of this after it's loaded, fwiw. i'd just like to send this drawing data out - then bring it back in and place it back on the stage.
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 RepliesI have imported a lot of paths from an Adobe Illustrator document right into a flash file. The paths exists as Drawing Objects inside the scene. Using pure actionscript, how can I move a symbol following each of the lines, without using predefined Motion Guides.
EDIT: I've attached the Flash file, full of drawing objects.
http:[url]....
The question is: Are these drawing objects accessible through AS3 or I should convert them to symbols / whatever format necessary.
Am currently working on a tool created by a colleague of mine and would like to improve performance. Basically, it's a tool for drawing on screen and uses a combination of Sprites and the Graphics class to draw a line segment every time the mouse is moved when the mouse button is down. Here is the drawing bit:
// on MouseMove
protected function drawLine(e:MouseEvent):void {
if (currentTool.thickness > 0){
//pen
var line:Sprite = new Sprite();
line.graphics.lineStyle(currentTool.thickness, currentColour);
[Code] .....
As you can see, it checks if the line 'thickness' property and draws if it is and erases if it isn't. I did think of using a technique similar to blotting here where it'd draw to a bitmap but I'm not sure this'd give the performance boost I want or if, indeed, there would be any way to have an eraser function. The drawing itself works nicely - this isn't the problem, it's the performance of the subsequent 'drawn' sprites.