ActionScript 3.0 :: Tweening A Rounded Rectangle ?

Jul 15, 2009

I would like to tween between a short rounded rectangle and a tall rounded rectangle. (I only want deal with the height - no other parameters). I am programming with ActionScript 3. My tweening engine is TweenLite.I have been tweening a sprite that contains a rounded rectangle. The tweened sprite produces distortion. I suppose that I have been scaling the original image, rather than the height of the rounded rectangle?Here is a simple example of my code:
 
Draw the rounded rectangle:
 
roundRect = new Sprite();roundRect.graphics.beginFill(0x000000);roundRect.graphics.drawRoundRect(0,0,50,15,4,4); //Original Height: 15roundRect.graphics.endFill();addChild(roundRect);
 
Then I listen for a mouse click event on the rounded rectangle.The mouse event triggers a function with the following code:
 
TweenLite.to(this.roundRect, 1, {height:120}); //Final Height: 120

I would like to tween the height of the rounded rectangle itself. I would hope that this would not produce the unwanted distortion.

View 2 Replies


Similar Posts:


IDE :: Can't Get Rounded Corners On My Rectangle Tool To Go Away

Feb 7, 2004

I'm trying to get plain straight corners on a rectangel. I have been drawing a rectangle or even before drawing one, selecting the little tool in the lower left and I put in a value of 0, but as soon as I draw anything it rounds up again. How do I get rid of this problem??

View 2 Replies

ActionScript 2.0 :: Drawing A Rounded Rectangle At Runtime?

Oct 25, 2005

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.

View 6 Replies

IDE :: Make A Rounded Gradient Rectangle Programatically?

Mar 6, 2009

I'm trying to achieve a roundedRectangle in gradient by using just code but i'm getting stuck.I was able to achieve the gradient part but adding the rounded piece its difficult, please see me code,

Code:

package com.callwave.web.fuze.view.skinLibrary
{
import mx.core.UIComponent;
import flash.filters.DropShadowFilter;
import mx.graphics.LinearGradient;

[code]....

View 1 Replies

ActionScript 3.0 :: Draw Rectangle With Only 2 Rounded Corners?

May 23, 2009

is it possible to draw a rectangle specifying which corners should be rounded and which not in a simple manner?

View 3 Replies

ActionScript 3.0 :: Rounded Rectangle With Conditional Corner Rounding?

Aug 28, 2009

create a method for drawing rectangle with rounded corners, but while being able to specify which of the four corners (any, all, none,etc.) you wanted to round.The method below does the trick, but for some reason my corners don't match the same curves that I get using the same radius with drawRoundRect().

In other words, if I call my method (and set all four corners to be rounded) and compare that with the same call to drawRoundRect() the actual curves of the corners are slightly different.

HTML Code:
public function drawComplexRoundedRect(startX:int,startY:int,rectWidth:int,rectHeight:int,radius:int,canvas:Sprite,roundTopLeft:Boolean=false,roundTopRight:Boolean=false,roundBottomLeft:Boolean=false,roundBottomRight:Boolean=false):void{

[code]....

View 3 Replies

Flex :: Graphics - Create A Rounded Rectangle With A Dashed Line?

Jun 14, 2010

How can I create a rounded rectangle with a dashed line? I've seen several routines that draw their own straight lines, but nothing for rounded rectangles.

View 2 Replies

ActionScript 3.0 :: Change Fill Color Of An Existend Rounded Rectangle Primitive?

Feb 12, 2009

Can i change the fill color of an existend rounded rectangle primitive?[code]

View 7 Replies

Flash CS4 :: Made A Small Rectangle In The Flash With The Tweening Effect And Export In To The FLEX?

May 21, 2009

I have made a small rectangle in the flash with the tweening effect and export in to the FLEX. When i publish in the FLEX i could see the rectangle with out tweening effects.How can i see the tweening effects.

View 1 Replies

Actionscript 3 :: Scrollbar With Sprite And Rectangle Won't Move Text, Just The Rectangle It's Painted On?

Mar 8, 2010

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?

View 1 Replies

Draw Rectangle Should See Little Bold Circle To Indicate A Perfect Rectangle

May 20, 2009

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!

View 2 Replies

Motion Tweening Error : Motion Tweening Will Not Occur On Layers With Ungrouped Shapes .....?

Jul 27, 2009

I'm getting the following error: Motion tweening will not occur on layers with ungrouped shapes or on layers with more than one group or symbol. I don't have any ungrouped shapes (it's all text), each layer has 5 instances of only one symbol (keyframes), no objects are grouped and text is all static text.

When watching the animation, the first word (web) looks fine, on the second word (design) the tween fails on the last couple of frames of that clip (the blur filter disappears), the third word (and) is OK, and on the forth word (development) the blur filter is not applied to the last 16 frames of that clip.I broke each animation into its own MC thinking that was causing the issue, but that didn't fix anything.

View 5 Replies

ActionScript 3.0 :: Convert Rectangle To Curved Rectangle?

Aug 2, 2011

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.

View 0 Replies

ActionScript 3.0 :: Creating A Rectangle Inside Of A Rectangle?

Jun 26, 2010

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?

View 10 Replies

ActionScript 3.0 :: Rectangle To Rectangle Collision Response?

May 20, 2011

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.

View 6 Replies

Flash - How To Get Rounded Number In AS 3.0

Jul 31, 2011

How can I round number to up down or to the 0.5 using action script 3.0. For example
4.9 will be rounded to 5
4.7 will be rounded to 4.5
2.4 will be rounded to 2.5
2.3 will be rounded to 2

View 2 Replies

Make My Buttons (pic 1 And 2) More Rounded?

Mar 15, 2009

How can I make my buttons (pic 1 and 2) more rounded ? (pic 3)

View 6 Replies

Draw A Triangle With Rounded Corners?

Nov 23, 2002

It's easy to draw a round cornered rectangle/square but how do you draw a triangle with rounded corners?

View 4 Replies

Flex :: Rounded Menu With A PopUpButton?

Sep 10, 2009

So I have a PopupButton and when I click on the button I want the Menu that pops up to have rounded corners. How would I go about doing this?UPDATE:I found an update similar to what I want to do, it can be found on the following page:The only difference is that I'm showing the Menu with a PopUpButton. So far this is what I have for my custom Menu:

package {
import flash.display.Sprite;
import mx.controls.Menu;

[code].....

View 1 Replies

Flex :: Rect Rounded Corners Be Different?

Jun 21, 2010

When I use <s:Rect> to create a rectangle, I use radiusX to get rounded corners. Problem is all are the same roundedness. Is there something similar to Rect that lets me control the radius for each corner separately? If not, what's the best way to create this from scratch? graphics library or what?

View 3 Replies

Java :: Can 0.99999999999 Be Rounded To 1.0 When Multiplying

Oct 11, 2011

When multiplying a floating point number that is very close to 1 with an int > 0, can it ever be interpreted as 1.

That is, if Math.random() returns its highest possible result (which is 1 step below 1.0), will

(int)(Math.random() * 8)

be 8 or 7?

For a practical example, can this often-used construct give an index out of bounds error:

someArray[(int)(Math.random() * someArray.length)];

I'm specifically interested in answers for Java and ActionScript 3, but I suppose they all use the same rules for floating point arithmetic, and answers for any platform would be useful.

Update: Though I already accepted an answer, I'd still appreciate confirmation that this can't go wrong in ActionScript 3 either, since a colleague reporting that he saw it go wrong once is what partly prompted me to ask this question.

View 2 Replies

Make A Rounded Corner Box In Photoshop CS?

Nov 3, 2005

How do I make a rounded corner box in Photoshop CS? I don't want to "feather" it because that makes it blurry. I just want rounded corners.

View 9 Replies

ActionScript 2.0 :: How To Draw Box With Rounded Corners

Jul 16, 2004

I need to draw a box with rounded corners. I can't get a hang of it. I want to draw it from the following variables:
boxwidth = 200;
boxheight = 200;
radius = 5;
How do I draw this? You should see the artwork I have (by mistake) created while trying to get it right.

View 7 Replies

ActionScript 3.0 :: Rounded Border - Also On Inside?

May 31, 2009

As you can see on the attached image I have a rounded border round an image. The problem is that the border only is rounded on the outside and not on the inside (marked with a arrow). The code I use for the border is:

Code:
border.graphics.lineStyle(10,0xFFFFFF,1,true);
border.graphics.drawRoundRect(0, 0, content.width,content.height,15,15);
container.addChild(border);

View 2 Replies

ActionScript 2.0 :: Creating Rounded Corner In Movieclip

Nov 10, 2009

I am creating one new empty movieclip like this,this.createEmptyMovieClip("vjn", this.getNextHighestDepth());
vjn.beginFill(0x000066);
vjn.moveTo(150, 50);
vjn.lineTo(50, 250);
vjn.lineTo(250, 250);
vjn.lineTo(150, 50);
vjn.endFill();

these lines are creating only the square corner, but i want rounded corner. How can i increase or decrease the radius size. How to create the rounded corner through script.

View 2 Replies

ActionScript 3.0 :: Keep The Same Rounded Corner Even When Want To Shrink It's Width?

May 8, 2010

How to keep the same rounded corner even when I want to shrink it's width?

View 2 Replies

Flex :: Adobe Catalyst: Rounded Corners?

Dec 26, 2009

I've created a rectangle in catalyst and under the "properties" panel, all I can see is Corners 10 for the rectangle. Is there a way to individually define each corner similar to CSS. I can't see any source code view in catalyst to enable me to fine tune it for each of the 4 corners. How do I specify the roundedness of each corner separately?

View 1 Replies

Actionscript 3 :: All Rounded Corners TitleWindow In Flex?

Jun 30, 2010

how can i get a title window with all rounded corners, so that i may make it whole round or circular shape ?

View 2 Replies

Flex :: Rounded Bottom Corners On Window?

Sep 30, 2010

I'm making a flex 3.5a/air2 application and I've made a popup window but I can't seem to get its bottom corners rounded. Setting cornerRadius seems to only affect the top corners. There doesn't seem to be a roundedBottomCorners property like there is for panels, and adding a controlbar with a cornerRadius also has no effect.

View 2 Replies

As3 :: Flash - Draw A Only Bottom Rounded Corner?

Feb 16, 2011

how can i draw a shape, that is only rounded at it's bottom ?

var _myShape:Shape = new Shape();
_myShape.graphics.lineStyle(4,0x000000,1,true,....);
_myShape.graphics.drawRoundRect(0,0,50,50,10);

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved