I'm trying to create a rectangular mask - located at x:0, y:173 (1 pixel high ) - that will be stretched (_yscale) to the bottom of the image using the Flash Tween Class. Trouble is, the entire rectangle moves as if if were using "_y" instead of "_yscale". Tweening "_height" doesn't work any better. Can someone spot the problem with this file? If you comment out this line
var mask_tween:Object = new Tween(maskClip, "_yscale", Strong.easeOut, 0, 100, 1, true);
then you will see the correct placement of the mask rectangle. It just doesn't tween/scale properly.
I would like to have an invisible drop target so I can dropand item and have it go to another part of the training. However,if I create a rectangle as a sprite and don't fill it in, itdoesn't recognize it as an area apparently because nothing happenswithout a fill color. I tried just a regular rectangle, shape, etc.
I'm trying to draw a rectangle with my mouse using actionscript. I found a script online for elispes. I used that and it worked just fine. But when I change it to a rectangle, it doesn't work.
Code: var color:Number; stage.addEventListener(MouseEvent.MOUSE_DOWN, startDrawing); stage.addEventListener(MouseEvent.MOUSE_UP, stopDrawing);
public function onMouseDownHandler(e:MouseEvent) { //trace("mouse down clicked!");
[Code]....
I am drawing a rectangle with the above code in as3 inside a area. Problem is that, when i try to acees the drawn rectangle x and y position it is showing 0,0. if i drag the drawn rectangle and try to access the x and y position then also it is calculating from the 0,0 position. first time when i draw the rectangle it is drawing well by dragging the mouse but why the x and y axis is 0,0; if i try to set the x and y position manually then when i try to draw by dragging , it is not drawing relative with the mouse.
I have two options and I want to know whats faster. I have a pool of 1000 sprites objects in as3 on screen. When its needed each sprite has to resize itself. I can 1- Make each sprite a simple container to use graphics to draw a rectangle, that is, call a 'spriteInstance.graphics.' ,draw the rectangle and on each 'refresh', I do graphics.clear and redraw the rectangle but with the new size, this for each sprite. or 2- Create each sprite with a border and on each refresh, resize it Whats better?
I have a button that when clicked is supposed to draw a rectangle behind my mask layer but when I try to run it I get this error: 1067: Implicit coercion of a value of type Class to an unrelated type flash.display:BitmapData.
Here is the related ActionScript Code: fabric_mc.phoenixFab.addEvenetListener(MouseEvent.CLICK, changeFabric); function changeFabric(event:MouseEvent):void{ this.graphics.beginBitmapFill(phoenixFabric); this.graphics.drawRect(181, 46, 319, 319); this.graphics.endFill }
I've seen a few tutorials on this site that discuss the Drawing API, What I'm wanting to do is draw a rounded rectangle at runtime to a particular size.I initially tried resizing an already-created rectangle, but as the movie clip resized, the radius on the corners got distorted.
I want to draw a rectangle (1px border, no fill) and then scale it using ActionScript. If I scale the movieclip, obviously the border scales as well. Is there any way to scale a dynamically created shape in ActionScript?
I want to draw a rectangle (1px border, no fill) and then scale it using ActionScript. If I scale the movieclip, obviously the border scales as well. Is there any way to scale a dynamically created shape in ActionScript?
I have a line within a rectangle.The line can draw outwards 360 degrees.I need to determine which of the rectangle's 4 sides the line is drawing out of.
I am drawing a rectangle at 0,0 with a line-style-thickness of 4px. It has height 100% and width 50%. The right-hand edge has a border 4px wide, but all 3 other sides are only 2px, suggesting the mid-point of the edge is classed as the border. Why isn't the edge drawn 'inside' the rectangle?
I need to to incorporate a functionality where the user can use his mouse to draw a rectangle by dragging his mouse over the canvas - much like the Rectangle Drawing Tool in the Flash Authoring environment. The requirement is something like a rubberband tool where the user can define a portion of a map by drawing a rectangle over it. The coordinates needs to be captured.
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.
I need to to incorporate a functionality where the user can use his mouse to draw a rectangle by dragging his mouse over the canvas - much like the Rectangle Drawing Tool in the Flash Authoring environment. The requirement is something like a rubberband tool where the user can define a portion of a map by drawing a rectangle over it. The coordinates needs to be captured. Can anyone help me with the actionscript.
I've received a number of graphics from an Illustrator user - they imported as symbols containing drawing objects. When I opened one of these symbols and tried to tween (fade out) the drawing object, I don't have the Alpha option. I don't use Illustrator myself and I had to install CS4 so I'm not used to that either.
i am creating a simple set of a few rectangles stacked on top of eachother (going to be like a stack of postcards) and i want to have the user click on the top rectangle and it moves to reveal the one underneath it. i have it all set up to work except i can't think of a way to stop it from being clickable after it's been moved to the side and the 2nd rectangle is revealed. does this make any sense? here is my code:
I need to draw a circle in certain amount of time. I found this code but it uses an enter frame. Is there way this could be written so it can be controlled by time? Code: var speed:Number = 0.05; var radius:Number = 50; var angle:Number = 0; var xpos:Number; var ypos:Number; [Code] .....
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.
For those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class do the various steps of getting it and loading it for you.So I needed to get a Scrollbar, which I got hereThe thing is, it works with Sprites.After trying to get it to accept TextFieldExtended, I bumped into a block, since the scrollbar relied heavily on a Sprite property that TextFieldExtended didn't have or could have.
So I tried adding the TextFieldExtended instance to a Sprite instance using addchild.A problem occurs here that I do not know how to handle. It seems that a Rectangle is drawn and the Text is drawn on that. I say this because the scrollbar moves the Rectangle up and down a bit, but the text doesn't scroll, just the Rectangle it is positioned in and the text then moves along with it.My question: can this be fixed, or is does this implementation of scrollbars need a lot of adaptations before this is possible?
I draw a rectangle i should see a little bold circle to indicate a perfect rectangle, I seemed to lost mine, can somebody please tell me how to get it back!
I am trying to convert a rectangle(actually multiple rectangles) to a curved rectangle. I think it should be pretty easy but I guess i am stupid. Basically I would have a start position and stop position (many of these), and they would be converted to curved rectangles and follow in a cicrle around.
I would like to create a rectangle inside of a rectangle, starting approximately 15% inward from the right side of the other rectangle.
I know how to create rectangles with:
Code: var newHotRect:MovieClip = new MovieClip(); newHotRect.graphics.beginFill(0x00FF00); newHotRect.graphics.drawRect(0, 0, 100, 100); addChild(newHotRect);
But how would I make another rectangle on top of that (the black one pictured) that is approximately 15% from the right?
I toyed around with .right, and .bottomright with no success. Can anyone lead me in the right direction? or even finding the x and y of the upper right or bottom right side of a rectangle?
how to respond when a rectangle hits another rectangle? I already know how to detect the collision, I just don't know how to respond to it. I'm just trying making a simple side-scrolling platform game where I have platforms I can walk on and bump against on all sides. I have searched everywhere and just can't find the tutorials I'm looking for.