ActionScript 3.0 :: GradientFill On Unregular Shapes
Feb 26, 2011
I've got sprite on the stage, let's say it is a graphics of a car. I would like to let the user fill the car with the colors he inserted to xml file.So, if I have square or rect, I do the thing this way:[code]So in the symbol class(Car) I added a public function, which I use for the instance of the Car in the MainTimeLine(as DocumentClass)car.setGradient(fillColor1,fillColor2,fillColor3)but gradient applies to the rect, created with drawRoundRectComplex, which then is added to the car instance. And I would like to fill with gradient the shape of the car.Is it possible [code] instantly took an idea that I could shift this function from Car's class body to the MainTimeline and pass the object to fill as a parameter. But how to incorporate this object between beginFill and endFill methods. The same way I tried to set THIS I mean actual instance to be filled but it doesnt work for me. Wrong code, or it is impossible...:/ but, is it possible to incorporate shapes created with authoring tool and then change its gradient via code?
View 0 Replies
Similar Posts:
Feb 17, 2009
I have a question about shapes (i mean the flash.display.Shape class). Is it possible to import Shapes directly from the library as Shapes and not as Sprites/MovieClips? Shapes are supposed to be faster than MovieClips/Sprites, right? So why is it only possible to import MCs/Sprites from the library? I understand that generally shapes could be created solely by actionscript, but in my case the shape comprises of many points and is curved - so it's quite infeasible.
Is there maybe some sort of plugin to generate code that would draw the desired shape from a drawn shape in CS4? And a last one: Are there any benchmarks out there for performance comparison between sprites/mcs/shapes? How much performance do i loose by using a sprite instead of a shape?
View 2 Replies
Jun 25, 2010
I have applied Horizontal gradient style for vertical scrollbar. See attached screen shot of the output.
But how we should apply vertical gradient style for a horozintal scrollbar. I hope we have to change something in the function createGradientBox. [code]...
View 1 Replies
Sep 22, 2009
I've got a question about a swf that needs to be opaque. I've got a gradient fill in the .swf that creates a nice background. But I want to import this file in a flash/xml website and the file has to be opaque in order to work properly.
[Code]...
View 1 Replies
May 26, 2009
I have a problem with Gradient in AS3. There is a scene with Rectangle created with lineTo():
graphics.moveTo(p1.x, p1.y);
graphics.lineTo(p2.x, p2.y);
graphics.lineTo(p3.x, p3.y);
[code]....
View 1 Replies
Mar 15, 2010
Can anyone make simple script how do change existing movieclip gradientfill on this movieclip click.
View 1 Replies
Apr 26, 2007
I cant get a spotlight effect with gradientfill to work right i create an object that represents the gradient and then i tween it from small to huge... and draw a box the size of the screen and fill it and on each updateMovement I redraw the gradient with a alpha 0 center and a 255 edge...but it doesnt center right at all...no matter what i do. It always is off Center...(oh Im using Stage.width/height since it needs to be dynamically resized based on browser...)
View 2 Replies
Jul 8, 2009
I was working through some animation tutorials with plain round sprites using the following code...
Code:
package {
import flash.display.Sprite {
[code]......
View 1 Replies
Mar 19, 2009
Is this possible? Cause it "masks" just one shape within the mask layer.
View 7 Replies
May 1, 2009
Is it possible? I can't figure out how to do it.
View 4 Replies
Apr 15, 2009
it is possible for me to add cut-out shapes onto Flash? I have cut them out in photoshop and pasted on a transparent background, but when I open them in Flash the background has changed to white.
View 1 Replies
May 24, 2011
Im trying to create a drag and drop module which can be used to build an Image. EX: Using a triangle and rectangles to create a House.
I have created the drag and drop module but I cant make them fix with each other.
I'll explain the functionality a little bit, but forgive my English if any mistakes since it's not my native language. The user is given a set of shapes and a question like "CREATE A HOUSE" so he should be able to drag the shapes that is given and and build the house.
View 3 Replies
Jul 21, 2011
I am drawing three circles in my flex application, using actionscript. But these circles are now pure 2D images, which is not looking good. How can I make it look like 3D using some shadows or shades inside the shape.
View 1 Replies
Feb 7, 2009
Can I add eventListeners to shapes ?
View 2 Replies
Jun 7, 2011
I want to add different quadrilaterals to an array, so summing up this is what I am trying and it isn't working[code]...
View 9 Replies
Aug 17, 2009
I'm working on an IK based character animation, and I have a question about the different IK "types".I've started by creating a charater, created using symbols to represent the various body parts, which works great, and I've created a shape based armature as well to handle the mouth because the shape based animation works perfectly for animating it.Is there a way to "attach" the shape armature to the symbol armature to that the mouth will move with the head during animation? It is difficult to keep the mouth armature aligned with the face manually, and the bones don't "stick" when I drag them from the symbol armature to the shape armature.
View 1 Replies
Mar 17, 2009
Why is it that when I draw with the pencil tool, my lines get auto-reshaped? This is nice but it's not nice when I try to draw a stickfigure and it turns out completely wrong. Sometimes when I draw a circle with the pencil tool it becomes a square. But then again I don't use a drawing pad. I use a mouse.
Somebody told me: "Because Flash is really a vector drawing tool, not a bitmap drawing tool. It is *interpreting* your marks as pieces of a curve. That said I think there may be a setting to remove this smooth - in effect using more line parts for you drawing."
View 2 Replies
Jun 15, 2009
How can I achieve complex text shapes like warp(text on path) effect in photoshop or Wordart in Microsoft Word in flash?
View 4 Replies
Jan 22, 2010
How can i easily break the shape into two pieces so that I can change them into movie clips?I tried using the selection tool combined with shift key to create selections but the selection tool only does squares so it's very frustrating to select a portion of my drawing precisely using it, i've given up
View 1 Replies
Mar 16, 2010
Any way of drawing circles with AS? I'd like to draw a number of small MC's on the stage in a circle actually. My problem is how to draw in a circle.
View 5 Replies
Mar 31, 2010
I want to make my action script shape clickable and to give it actions but I get this error1119: Access of possibly undefined property buttonMode through a reference with static type flash.display:Shape.
View 1 Replies
Jul 5, 2011
I have maze-like game and I'm trying to get the player mc to respond to a collision between the boundary mc.hitTestObject doesn't work since it's not a rectangle. Is there a way to do this?
View 7 Replies
Sep 18, 2009
I'm working on an application where I'm drawing some rectangles on the screen, and then will need to manipulate the shapes (change their size, location). I tried to do something with .drawRect and clearing the shape each time I was manipulating it, but the RAM usage was spiking and then falling (presumeably because i keep reinitializing a new component and then removing it, and garbage collection was cleaning it out). This seems like its probably not the most efficient way to do it.
Is there a way for me to just create a shape once, and then move it around on a canvas (and change its width and height without all this RAM usage?
View 2 Replies
Sep 14, 2010
I'm looking for a method to import Photoshop shapes intro flash. I want to import them as vectors not bitmaps. Is it possible?
View 2 Replies
Jan 24, 2011
I have one left panel in which there are different shapes like start,end connectors..... when i drag line image inside canvas i want to draw line/connector between two shapes how would i do it
View 1 Replies
Feb 9, 2011
I want to develop an image editing application in Flex 4. My initial requirement is to draw various shapes like Line, Rectablge, Triangle, Circle, Star etc in appication. I want to facilitate user to draw shapes using rubber banding like professional applications do.
All shapes would be vector and should look smooth in an size. So, can't use bitmap and scale them.
What are better methods to achieve this?
View 2 Replies
Jul 17, 2011
I made a rounded rectangle in as3 and would like to expand it on click. This is the code I use:
var lesBg:Sprite = new Sprite();
with (lesBg.graphics) {
lineStyle(3, 0x61b157);[code].....
When I click on it I would like it to expand to twice its size. I'm doing this with TweenLite but when I expand it I get ugly pixelated images and the borders expand too.
Tweenlite.to(lesBg, 1,{width: 380});
Is it possible to expand the image so it stays clean and the borders stay intact?
View 2 Replies
Oct 22, 2009
Does anyone know if it's possible to extrude vector shapes using AS3?
View 2 Replies
Nov 12, 2009
I want to detect when a circle collides into a random object. I know this is pretty basic to do with a mouse colliding into a random object but I want to modify this for a circle. I have seen some examples which use circles but they are drawn in script, is it possible to do this with a mc from the library.
View 2 Replies
Dec 29, 2009
I have a code, that draws a horizontal line, then it turns into a slope, and at the end of the slope it draws a circle. Here's a code:
Code:
var xspeed:Number = 1; // defines increments for x of slope
var yspeed:Number = 2; // defines increments for y of slope
var hspeed:Number = 5; // horizontal line increments
[Code]....
Create document 800x700 and put this code into main timeline. Now test movie As you can see, everything works great. But there is a problem. The circle is being drawn at 0 degree angle. But I want the circle to match the angle of the slope, so it looks like the slope and the circle are both at the same angle.
View 1 Replies