ActionScript 2.0 :: Drawing In MX - Confined Area For Specific Shape
Jun 7, 2004
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 > [URL]. I'd like to try and keep it confined to the notepad area. I think it might be a hitTest thing with if/else. 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.
View 2 Replies
Similar Posts:
Jun 7, 2004
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 > url...I'd like to try and keep it confined to the notepad area.I think it might be a hitTest thing with if/else. 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.
View 2 Replies
Oct 12, 2011
By the way i want to make a visualization about a math process to show partial function graph.
I think i can make a scene which in 1000x1000 pixels. I'll start from top of scene and when i press a button i'll move camera to second section which i want to do sketch. I want to make a sketchpad which can draw in a 2 part movieclip. First part is -X section of XY Axis Graph. Second part is +X section of XY Axis Graph. I'll put image of XY Axis Graph to -X and +X section of XY Axis Graph. So it'll be seem like one part. And i'll draw to -X section. After that i'll skip to second sketchpad with camera. And i'll make same thing. But for now i'll draw to +X. And when i press conclusion button camera will skip to bottom of scene and move -X of figure1 and +X of figure2 to bottom. So i can see figure1's -X section and figure2's +X section as merged in bottom. So it'll show to me partial function graph.
But problem is sketchpad is drawing to _root. So i'm unable to move sketch or shapes on XY Axis Graph. But if i can draw that to movie clip i can move it like an object with drawing and merge it like i want.
So i want to make a sketchpad which make drawing in limits of movieclip.
how i can do it ? Also i'm using following code:
Code:
import mx.controls.Loader;
// 1. SETTING THINGS
// ----------------
_root.createEmptyMovieClip("line",1);
[Code]....
View 2 Replies
Nov 6, 2007
I'm trying to modify a mouse trailer I've found somewhere else so that it only reacts within a specific area on the flash page - say an area 780x549 on a 1024x700 flash file.Here is the code I am starting with - The file is written in AS2 for Flash 8+
//mouseTrailer
i=0
onMouseMove = function () {
var cur_x = _xmouse;
[code]...
View 1 Replies
Nov 10, 2011
I just want to do not allow editing at some area of text area in flex. How it can be done?let suppose text length in text area is 50 characters, i want to allow editing if cursor position is less than 15, and if cursor position in text area is greater than 15 it should not allow user to add more text in text area.If user press any key it should not add any character in text area.[code]
View 1 Replies
Mar 7, 2011
I'm making an android air application for school, a sketch app.But I'm facing an annoying problem, when I'm drawing I can draw over my bar and my menu, here's some code:
[code]....
--> so this is the function for drawing a shape on stage the shape is declared as
Actionscript Code:
public static var brushDraw:Shape = new Shape();
now the problem is that I can draw over my menu and everything. Putting the setChildIndex of brushDraw to 1 doesn't work, it gives some error...
View 1 Replies
Mar 20, 2011
How can I create such a shape using the Drawing API? where red means filled and white means not filled
View 1 Replies
Oct 22, 2011
The 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
View 1 Replies
Oct 23, 2003
how to make a self-drawing shape with actionscript
View 2 Replies
Feb 12, 2009
Is it possible to draw a border around an arbitrary Shape (or Sprite) dynamically with ActionScript? From the IDE is really easy, just select the line color and click the Shape with the paint tool (S).
View 3 Replies
Sep 26, 2011
Is it possible to draw a strokeless shape with the pen tool (as in Illustrator)? It is quite tedious to have to go back and remove strokes from my shapes.... especially since I can't see how to do it without clicking on each segment and hitting "delete"!
View 2 Replies
Oct 20, 2011
I'm trying to draw an image in actionscript, I set it as a BitmapFill within a rectangle. The problem is that if I move the rectangle away from the origin(0,0), in my case I start drawing the rectangle at (20,35), the bitmap background doesn't follow along. The background is always drawn at (0,0) and then repeated, so I don't get a centered image but rather 2 halved images. Here's what my code looks like:
public class PageTileRenderer extends VBox
{
private var sp:Shape;
[Code]....
how to move the background fill origin. Or is there another solution to draw the image centered.
View 2 Replies
Oct 13, 2009
This is my first meeting with the Shapes; which don't seem cooperating, at all. Following is the Class code:
Code:
package
{
[code]......
View 2 Replies
Oct 28, 2009
I have 2 shapes, in different color, and i would like to have this effect ( see the attached file ).
How can i achieve that by using pure actionscript 3, or using source like TweenLite, TweenMax etc...
View 4 Replies
Jun 18, 2009
I'm using actionscript to place a bitmap into an empty movieclip like so:
var bitmap_mc:MovieClip = new MovieClip;
addChild( bitmap_mc );
bitmap_mc.addChild( bitmapPNG );
bitmapPNG is an irregular shaped png of a person, but when I use the movieclip as a button, the hit area is the square shape of the movieclip, not the silo. How do I make the irregular shape of the silo the hit area, and not the surrounding square of the moviclip?
View 2 Replies
Jun 29, 2010
Since at least cs3, Illustrator, InDesign & Photoshop has all had the Alt + mouse wheel zoom function. I have wondered when this would become available in flash. I just installed my cs5 design premium and immediately noticed that the zooming function has been further improved in the other programs but still nothing has happened in flash.
Am I missing some way to enable this zoom function or is there some third party plugin that can help me? It is annoying and time consuming to have to press z then click around to get the right zoom level and then click whatever tool I was using before instead of just pressing alt and scrolling a bit.
View 5 Replies
Feb 15, 2011
I want to enable drawing in a certain area. It works quite well and everything besides the fact that I can't stop the drawing function.
ActionScript Code:
import flash.events.Event;
import flash.events.MouseEvent;
var lineo:MovieClip = new MovieClip();
[code]....
View 2 Replies
May 13, 2009
I'm trying to create a drawing application in flash CS4, but I need the viewers to draw in a certain area only, and I want the cursor to change into a brush when I am hovering over that certain area. I tried adding an if statement to check if the cursor is in that certain area, but now it doesn't draw at all.
stop();
var drawIt:Boolean = false;
var startX:Number;
var startY:Number;
[Code]....
View 11 Replies
Jan 7, 2010
i have been tasked to create a rollover state that has dynamic irregular shapes that surround the movieclip target. The target is always a rectangle and the shapes will look roughly like:I think i will have to draw this old school without using the easy predfined shape classes. I first thought about doing two rounded rectangles to fake it, but the line cross over (pointing green arrow) will overlap. Anyone have ideas on how to approach this? If i go with the drawing api, is there a formula to working out the rounded curveTo angles on the corners to always be the same radius?
View 2 Replies
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
Mar 18, 2010
How can you make the entire thing for drawing bigger? Not just the white space. Cause I'm making a scroller game..
View 1 Replies
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
Sep 21, 2011
Im giving a action script for drawing a predefined process shape that is used in flow chart. There are action script to draw a square, rectangle, circle and triangle. Can anyone in the forum give code for drawing the shape.
View 1 Replies
Aug 8, 2011
If I draw a rectangle or trapezium, how might I go about drawing bitmap data into that shape? I need to give a slight perspective to a loaded photo. Native 3D rotations seem to leave the bitmap really blurry, and a full 3D engine is too heavy for this project.
View 3 Replies
Oct 7, 2011
I drew a line (stepVoltage) in a fla using the graphics class. Once drawn, I want to move it to the right in an update function, but am having trouble. I tride just moving the line with statements like stepVoltage.x = newX; stepVoltage.y = newY; but this didnt work. Then I tried to delete the previous line and draw a new one with a clear () function (see below) but this blocked the next drawn line from showing up.
The code:
var stepVoltage:Shape = new Shape ();
stepVoltage.graphics.lineStyle(2,0x000000);
addChild (stepVoltage);
[Code]....
View 1 Replies
Jun 10, 2011
Want to get custom image and which should be dragabble into drawing area...Below is the sample design which exactly i am looking for.
How to get custome image which i have rounded in red mark aslo i t should have input and output ports for ex:For TwoWaySplit.EU.OTHERS it contains IN as inputport and for Outputports:OTHERS and EU.same in the case with TwoWaySplit.US.OTHERS it contains IN as inputport and for Outputports:OTHERS and US and for main component it contains one input port and three output ports as shown in the diagram.Along with that node it should also display those ports and also when we move the node those ports should also move.
View 1 Replies
Sep 8, 2006
I have got it to drag around and such, but i tried to use the drawing API to define the hotspot area but its not working.
Code:
function makeWords(){
yVar = 20
for (i=0; i<25; i++) {
_root.createEmptyMovieClip("symbolName"+i, getNextHighestDepth());
[code]....
View 2 Replies
Jul 14, 2004
I need to know how to script the drawing board as in the user can only draw on a specified area. For example, on a 800x600 layout, only 1/4 of it is the drawing board.After the user has drawn the image, when he/she clicks on a button, the image will be replicated on another area in the same 800x600 space. So far, I can only manage to make a drawing board on the whole 800x600 space and erasing.
View 2 Replies
Sep 29, 2009
I've made a functions which creates rectangles:
function makeSquare(sgu:String,clo:uint):void {
var squ:Sprite = new Sprite();
addChild(squ);
[code]....
Now my problem is; that i'm from another function would like to make a call, that deletes a specific rectangle previously generated by the above function.
View 9 Replies
Nov 2, 2010
I'm currently using a script I picked up from these forums to attach movieclips from the library based on how many child's there are in an XML document.I was wondering if it was possible though, to have each movieclip placed in a random location on the stage; but restrict that random location to a SHAPE I draw? For example if I drew a giant star, and wanted the movieclips to randomly attach anywhere within the boundaries of the star?
I know there are methods of restricting the random placement by using x and y values to keep it below or above a certain line, but is it possible to restrict placement within custom drawn shapes?
Here is the script I'm using atm:
Code:
function loadXML(true) {
if (true) {
xmlNode = this.firstChild;
title = [];
[code]....
View 4 Replies