ActionScript 3.0 :: Drawing Shape And SetChildIndex?
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
Similar Posts:
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
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 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
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
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
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
Nov 30, 2009
ActionScript Code:
package {
import flash.display.MovieClip;
public class Base extends MovieClip {
public var baseHP:int = 50;
var newRect:Shape = new Shape();
1046: Type was not found or was not a compile-time constant: Shape. 1180: Call to a possibly undefined method Shape. What does it mean by "undefined method"? I am somewhat of a newby, so sorry if there are any stupid errors
View 1 Replies
Jun 22, 2010
Whenever I add shape hints to a shape tween the shape disappears in the between frames. I am using CS5 on Vista. I using files from [URL]to practice.
View 2 Replies
Oct 11, 2011
need to draw the shape of a existing movieclip which is irregular shape.
View 2 Replies
Oct 11, 2011
need to draw the shape of a existing movieclip which is irregular shape.
View 1 Replies
Jul 9, 2009
Id like to know if there is a way to do a shape hitTest.Not as the normal hitTest would do, but shape colliding another shape, not the rectangleof a movieclip.It can be in a movieclip.
View 23 Replies
May 28, 2009
I'm trying to use the setChildIndex(); property to move a mc to the top of the stage when that particular mc is clicked on. I'm still not sure what is meant to go in the parentheses? Sorry, still new to AS3.0. The mc has it's own class called Ball and this is where I'm calling the setChildIndex property, in the dragIt function. Here's the code for the Ball class....
[Code]...
View 2 Replies
Dec 10, 2009
know how to set the Child Index for a video inAS3 ? I have a class that extends the video class and I call it from my main class file. In my main class file I have other Movie Clips that I wan to put on top of the video instance
View 2 Replies
Jan 21, 2010
I am trying to set a Sprite's z-index to topmost on mouseOver. In my mouseOver event I am calling:this.parent.setChildIndex(this, this.parent.numChildren - 1);If I trace the index of this before and after the call, the index has changed but my sprite still appears to be behind it's siblings.I am changing the scale of the object on mouseOver as well
View 3 Replies
Nov 28, 2007
For the life of me, I cannot understand this method. The help files are confusing to me, and I can't locate anything else on the web that explains how it works.
What I have is an array of 5 objects closely in a row, that tween and expand on a MOUSE_OVER. Trouble is, I want the object to be in front of the others on the MOUSE_OVER, but part of it is always beneath the object to its right or left. Here's the code I have:
Code:
import fl.transitions.*;
import fl.transitions.easing.*;
addEventListener(Event.ENTER_FRAME, setupVars);
function setupVars(e:Event):void {
trace("Entering setupVars");
//The following removes the Event.ENTER_FRAME listener so that it does not activate 30 times a second.
removeEventListener(Event.ENTER_FRAME,setupVars);
var myArray:Array = [box1_mc, box2_mc, box3_mc, box4_mc, box5_mc];
for(var i:Number = 0; i < myArray.length; i++) {
myArray[i].addEventListener(MouseEvent.MOUSE_OVER, boxOver);
myArray[i].addEventListener(MouseEvent.MOUSE_OUT, boxOut);
myArray[i].buttonMode = true;
}
}
var box:Tween;
var box2: Tween;
function boxOver(ev:Event):void {
box = new Tween(ev.target, "width", Elastic.easeIn, 100, 130, .5, true);
box = new Tween(ev.target, "height", Elastic.easeIn, 100, 130, .5, true);
trace("yay, it works")
}
function boxOut(ev:Event):void {
box2 = new Tween(ev.target, "width", Elastic.easeOut, 130, 100, 1, true);
box2 = new Tween(ev.target, "height", Elastic.easeOut, 130, 100, 1, true);
trace("yay, this one works, too")
}
Could someone be so kind as to help me with the setChildIndex method? I want any particular box to be in front of the others on the OVER.
View 4 Replies
Aug 28, 2009
What I have is an array of 3 pictures in a column, that expand on a MOUSE_OVER. I want the picture to be in front of the others on the MOUSE_OVER, but part of it is always beneath.
Code:
var thumbnails:Array = ["IMG_1258.JPG","IMG_1417.JPG","IMG_1428.JPG"];
var studioGallery:MovieClip = new MovieClip();
addChild(studioGallery);
[Code]....
I tried to add the following line of code on OnOver as I saw it in another thread, but it gives me an error message:
Code:
this.setChildIndex(this.getChildByName(evt.currentTarget.name), this.numChildren-1);
View 1 Replies
Dec 12, 2006
I am creating multiple sprites on the stage using structured classes as shown below, I would like every time I click on one of these sprites to make it go on top of all previously created sprites. I would also like to know if this can be implemented from within the last class "class c" onMouseDown function.
[Code]...
View 6 Replies
Aug 2, 2009
In Flash, some of the objects I put on the stage directly (e.g. mc_), and some of the objects are using "add child" function to be put on the stage.For some reason, I need to use setchildIndex function in frame 15 to bring the object (mc_A on the top my stage.But this causes a problem that is, object A is always there from frame 1-15.Actually I don't need mc_A on frame 1. So in order to remove object I use removeChild or set mc_A.visible=false, but it doesn't work because I got the typeError said "TypeError: Error #1009: Cannot access a property or method of a null object reference." I know it makes sense because mc_A is not in frame 1. Of course, it couldn't access to the object.I attach an example file, hope it could describe my problem more clearly.Attachments:setChildIndex.fla.zip (7.2 K)
View 7 Replies
Oct 4, 2009
So the MouseEvent.CLICK event works just fine when i don't have the setChildIndex, but when i do nothing happens anymore. Here is the code:
var kake:Kake = new Kake();
kake.x = 87.5;
kake.y = 358.5;
addChild(kake);
setChildIndex(kake,2);
[Code]...
View 3 Replies