Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




How Do I Get The Coordinates Of The Corners Of A Rotated Box?



look:

so i started by rotating my box, but now i don't know how to get the coords of the corners of the box...then, i could probably run some SAT on it.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 02-03-2008, 06:17 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Rotated Movieclip Coordinates
Hi, guys.

Having the follow problem(forgot already the school trigonometry

1. I have a movieclip that is a simple square.
2. Its rotated via _rotation property.
3. But I need to calculate new corner coordinates.

They were (mc._x+mc._width/2), (mc._y+mc_height/2) originaly for the right top corner.
But how can I calculate them after rotation?

Thank you.

Corner Coordinates Of Rotated Rectangle
I bet there's an easy answer to this one:

How do I get the x and y position of a rotated rectangle's (or an MC that contains a rectangular shape) top-right, bottom-right and bottom-left corners (not its bounding rectangle)?

Thnx!

E

Corners
Hey,

I've made a small thing in fireworx, a little arrow in a box. Now i imported that in flash mx, and put it on the scene, but i don't see the botom line of the box

So i thought, maybe i can draw this in flash itself, i started ... but i don't know how to get the corners right. They never are in 90° angle. You gotta really zoom in to see it ... cuz it's kinda small.
If you use the hairline, it's fine, but the line is to small.

I added the fla file so you could see for yourself ...

Hope you understand what i mean and somebody can help me

Greetz,
DiGiTi

Who Wants To Help Me? - Join Tha Four Corners
1.Help me Rebuild and Layout My Site i have a host already.
a)help me make and intro if you want read B
b)help me and my friend GoGo Anime -Brian make movies

2.Join Tha Four Corners theres already 2 me and brian
a)if you do u get Yourname@frozenflash.com E-mail Fowarding to you.

Please Tell Me which one you can help with i hope u can help with everything.

Rounded Corners
why is it that when u have used rounded corners on illustrator when you go to import it into flash mx it becomes straight edges?? Can anyone help????

Square With Corners
When you draw a square ouline using rectangle tool (using stroke only/no fill) then increase the line thickness the corners become rounded.

How do you draw square corners at this thickness?
How do you make the line thicker than '10'?
+

Radius Corners
Hello Peoples, I am new to this forum and flash in general. My site is http://www.mosaictilecreations.com/. I recently built this site and a friend in Calgary did the animation. The one thing I would like to do is place radius corners on the Mosaic Sea Animation. I dunno, somehow the sharp corners just seem a little harsh. Anyway, if anyone can help me accomplish this I'd be grateful. Cheers, scubes

[F8] Rounding The Corners
i have this quick function to make a box with a green-ish background:


Code:
function makeBox(){
newsBox = imageBox.createEmptyMovieClip("newsBox"+X, imageBox.getNextHighestDepth());
newsBox.init();
//news bg******************************
newsBg = newsBox.createEmptyMovieClip("newsBg", newsBox.getNextHighestDepth());
var newsBm:BitmapData= new BitmapData(300,12,false,0xbcff39);
newsBg.attachBitmap(newsBm, 1);

}
works fine, but is there a way to make the corners rounded, rather than "right angles". Thanks

Rounder Corners
I can draw a rounded rectangle but how do i draw a rounder rectangle with say only 2 corners rounded and a border around the shape?

Rounded Corners
I can draw a rounded rectangle but how do i draw a rounder rectangle with say only 2 corners rounded and a border around the shape?

Sharp Corners
Hi there,
I have a pretty old version of Flash, MX I think and I'm simply trying to draw a box with a 5px outline that has sharp corners. I've checked the 'sharp corners' check box in the custom settings for the outline but I keep ending up with a box that has slightly rounded corners! It's driving me mad, can anyone tell me where I'm going wrong???
Thanks.

Darkened Corners
how can i achieve darkened corners on my flash site, like in http://www.artofdavesilva.com ? i've been playing with the color fill but i don't think thats how to get the BEST looking dark corner. thanks

Why Does It Round My Corners?
Okay...I am just trying to import single vector graphics in MX from Illustrator 10 by exporting them as swf files in Illustrator. My problem is that when import them in flash, the export/import rounds all of my corners on my graphic. For example, in Illustrator, I have a series of small 2x2 pixel squares...in Flash the corners are all rounded. Any ideas???

Stretch To Both Corners, How?
Hi,

Im working on my portfolio.
How can i get it stretched all the way on the right side?

Have a look

http://privat.bluezone.no/stein.sebergsen/issue04.htm

Regards,
Simon

Rotated Txt
How to do it?
I try to created a static text and changed it to MC. But once I rotate it, it disappear. Do anyone know this question?

Box Corners Not Rendering Completely...
Howdy.

I create streaming media modules for various clients using Flash (version doesn't really matter, but I am usually using v5). I create a .fla and then I drop the tuned .swf files into RealPlayer as backgrounds creating an "environment" for the presentation. Frequently I use a box as an outline for the video region, slide region, or whatever region happens to be needed. I have a client complaining that the corners of the boxes are missing the connecting pixel. The boxes use a 1pixel line, and the lines are connected. When I zoom in on the box corner in the .fla file, all is good, but when I publish it out to a .swf, it loses the corner pixel...only at the BOTTOM of the box. Odd eh? Anyone have a way to fix this? My client is driving me nuts about it.

On a related note, how do I make the corners of the box a right angle and not a smooth, rounded corner? Am I missing something? Like my brain. Seems like it should be an easy fix. Thanks a lot. I appreciate any input at all. I am desperate.

Boxes With Straight Corners?
How is it possible to get boxes with straight corners in Flash MX? How does Macromedia do this in their web site's current Flash animation? (This one: http://www.macromedia.com/home_movies/home_fma.swf)

If you look at the top right corner, at the square right of "Navigation", when you zoom in, you can see that the box has straight corners. How did they do this? How would you do it?

I have tried to convert lines to fills, however this does not fix the "smooth corner" problem (when I zoom in, the corners are still not straight).

I thank you for any suggestions.

RCarlton

Round Corners From Scripting?
hi!
How can first make a square using action scripting and how can I set the corners to be rounds?
THNX a lot!!

Squared Corners On Strokes
Even if I check the "Sharp Corners" check box to create a stroke on a rectangle, I still get rounded corners. Is there a way to do it to get sharp corners?

How To Make Square Corners
I notice when applying an outline to an object, the corners are rounded. How do I make them square?

Drawing Square Corners
I'm having problems trying to draw anything without rounded corners. For instance if I use the square tool to draw a square the outside corners of the stroke are rounded. I made sure that corner radius is 0 on the tool preferences and under the custom for the stroke Square corners is checked. The inside of the stroke is square but the outside is rounded. Any suggestions?

Thanks.

Lines With Straight Corners
is it possible to create lines in flash with straigth corners instead of rounded shapes? each end of a line is rounded now, I need a straight end.

any ideas?

thanks

Untidy Rounded Corners
I am currently designing a flash demo where all the windows need to have rounded corners. I have noticed that when using the rounded corners tool in mx 2004 the results are quite poor. The corners are very untidy and jagged. Has anyone else had this problem and if so is there any way to overcome this problem? I've attached a screenshot to show what I mean.

Thanks in advance

Applying Round Corners
I would like to now if there is a way of applying round corners to an existing rectangle.
I need to be able to create the rectangle, then resize it and finally apply the round corners. If I do the corners while first drawing the rectangle, they are distorted when I resize it.
Is there a way?

Rounded Corners Annoy Me
My Flash movie contains a rectangle with rounded corners. Trouble is the stroke never lines up properly on the corners, no matter how careful I am. I've never seen this issue on professional Flash movies. How can I prevent this?

I attach a screenshot of the annoying rounded corner problem! If anyone can solve this problem, I would be extremely grateful!!

Jagged Rounded Corners
Ok I know the topic of jagged rounded corners has been brought up before, but for the life of me I can't figure this out. If I make a rounded rectangle, circle, what have you the rounded parts come out jagged no matter how thick I make the stroke. If I zoom in it gets clear.
So what's the deal? I'm using MX 2004.
Any help would me great.
Thanks

Rounding Corners On Images
Hi everyone,

Need help! Does anyone know how I could round the corners of images using CSS? Is it actually possible to do, or am I beating round the bush?

Thanks

Nikki





























Edited: 02/18/2007 at 12:55:40 PM by Nikki00

Rounded Corners With Border
I need to create a swf with rounded corners and a 3px border for display on a web page that has a gradient background. Therefore the corners must be transparent (rather than a solid color since that will not match the background). I have drawn the rounded corners border in my Flash file and imported images beneath it but cannot eliminate the outside corners when I create the swf. Is there a way to turn off the background color so that the outside corners are transparent in my swf? Also, the only way I have found to eliminate the outside corners from my imported images is to import gifs with transparent rounded corners. Does Flash support transparency in any other file formats since gifs are not good for photos? Thanks for any help provided.

DrawBox With Round Corners?
If I use the drawBox function, how can make the corners round?
I want to set all the corner radiuses of the dynamically created box to 6 pixels.
Maybe later I need to set the corner radius to a different number.
How can I achieve this with scripting?
thanks Attila

Tween Stretching Corners
Hi I have created a tween using Actionscript. The tween increases the height of a shape from 60px to 600px. The shape that I am stretching vertically has rounded corners. I have noticed that when I stretch the object with the tween the corners are also stretched and this distorts the object.

Does anyone have a solution for this?

Thank you in advanced.

Tween Stretchs Corners
Hi I have created a tween using Actionscript. The tween increases the height of a shape from 60px to 600px. The shape that I am stretching vertically has rounded corners. I have noticed that when I stretch the object with the tween the corners are also stretched and this distorts the object.

Does anyone have a solution for this?

Thank you in advanced.

Rounded Corners Issue
Im in a hurry, so don't give me the "please search before post"-talk. 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

'

Block With Round Corners
I always noticed that if you have a block with round corners that the rounds never looked good unless the _xscale/_yscale ratio didn't change... so today I wrote a class to handle it for me. Its all actionscript and draws you a block with round corners. It dosen't handle exactly like a movieclip... but I'll be using it in the future for sure:

SWF: http://jsites.no-ip.com/Flash/exp/ro...roundBlock.swf
AS Class File: http://jsites.no-ip.com/Flash/exp/ro.../roundBlock.as
FLA: http://jsites.no-ip.com/Flash/exp/ro...roundBlock.fla
ZIP: http://jsites.no-ip.com/Flash/exp/ro...roundBlock.zip

Usage:

ActionScript Code:
//initializeround = new roundBlock("uniqueMovieClipName", initialWidth, initialHeight, initialXPosition, initialYPosition, initialAlpha, initialColor);function mover() {this._par._x = 15;this._par._y = 20;//set the postion of the top left corner of the box to (15, 20);this._par.update();//update the boxes postion/look}//set an onEnterFrame function for the boxround.setOnEnterFrame(mover);//clear the onEnterFrame of the boxround.clearOnEnterFrame();//Available properties:_width //set the width of the box_height //set the height of the box_x //the x postion of the left side of the box_y //the y position of the top of the box_alpha //the alpha of the box_roundSize //the width/height of the bevel_bgcolor //the color of the box (0xFFFFFF format)/*------------Use _par as a reference in the movieclip to refer to its parent roundBlock class (as seen in the onEnterFrame function above)--------------You must call the update() function everytime you wish to update the boxTherefore you must use this._par.update() in all onEnterFrame functions*/


I hope that I explained well enough

Drawing API Corners/Curves
This was something I played with a while ago, trying to get a handle on the Flash Drawing API (another post today reminded me of it). Thought someone might be able to use it/learn from it. All code is in the first frame. (Oh, if you wonder why it isn't doing anything just click around a bit.)

Crappy Looking Rounded Corners...WHY?
Is there any way to fix the way flash renders rounded corners like on rounded rectangles? They'll look fine in authoring, but look like crap once published.

Rounded Corners Issue
Im in a hurry, so don't give me the "please search before post"-talk. 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

'

Block With Round Corners
I always noticed that if you have a block with round corners that the rounds never looked good unless the _xscale/_yscale ratio didn't change... so today I wrote a class to handle it for me. Its all actionscript and draws you a block with round corners. It dosen't handle exactly like a movieclip... but I'll be using it in the future for sure:

SWF: http://jsites.no-ip.com/Flash/exp/ro...roundBlock.swf
AS Class File: http://jsites.no-ip.com/Flash/exp/ro.../roundBlock.as
FLA: http://jsites.no-ip.com/Flash/exp/ro...roundBlock.fla
ZIP: http://jsites.no-ip.com/Flash/exp/ro...roundBlock.zip

Usage:

ActionScript Code:
//initializeround = new roundBlock("uniqueMovieClipName", initialWidth, initialHeight, initialXPosition, initialYPosition, initialAlpha, initialColor);function mover() {this._par._x = 15;this._par._y = 20;//set the postion of the top left corner of the box to (15, 20);this._par.update();//update the boxes postion/look}//set an onEnterFrame function for the boxround.setOnEnterFrame(mover);//clear the onEnterFrame of the boxround.clearOnEnterFrame();//Available properties:_width //set the width of the box_height //set the height of the box_x //the x postion of the left side of the box_y //the y position of the top of the box_alpha //the alpha of the box_roundSize //the width/height of the bevel_bgcolor //the color of the box (0xFFFFFF format)/*------------Use _par as a reference in the movieclip to refer to its parent roundBlock class (as seen in the onEnterFrame function above)--------------You must call the update() function everytime you wish to update the boxTherefore you must use this._par.update() in all onEnterFrame functions*/


I hope that I explained well enough

Drawing API Corners/Curves
This was something I played with a while ago, trying to get a handle on the Flash Drawing API (another post today reminded me of it). Thought someone might be able to use it/learn from it. All code is in the first frame. (Oh, if you wonder why it isn't doing anything just click around a bit.)

Rough Rounded Box Corners?
Whenever I use the rounded corner option with the box tool, the corners look muddy or jaggy.

Anyone else?

frozenpeas

Rounded Corners Are Not Smooth
I am trying to make boxes with rounded corners (with a stroke).
No matter what number I set for the points, they come out blurry.

When I zoom in they are clean and smooth but at 100% they are blurry.

Does anyone else get this problem?

Sharp Stroke Corners?
How do I make the corners of just a stroked box sharp? As it is now, the "inside" of the stroke is sharp, but the outside is rounded ... any help? I did a search for this here and couldn't find anything ... Thanks, all

Rounded Corners On Square Obj
If you apply a stroke to an square object with square corners, the corners appear rounded. Why?

BX

Rotated Rectangle
Hi together,
I need a function to create a rotated rectangle (with 4x90°). What I got is the value for rotation, widht and height. So I need the koordinates for x and y. This code with _width/_height just works on the Y-axis:

<CODE>
moveTo(x,y);
...
lineTo(x,_height/(_width/_height));
lineTo(?,_height)
lineTo(_width,_height-(_height/(_width/_height)));
lineTo(?,y);
</CODE>

greetz
Daniel

Rotated Text?
Hey,

I'm working on a game where a ball bounces through some platforms, I've made it that these platform can rotate...

Now I want to put atextfield in each platform wich shows the rotation of the platform...

But when I rotate the platform , I cant see the text Is this becuz Flash doesn't show text wich is rotated? And how can I fix it?

Thnx,
SaphuA

(I cant show current version of the game cuz my server is down for bout a week)

Rotated Text
I can rotate static text... but why won't my dynamic text rotate?

Any clues... seems simple enough to me or is it more complicted??

WinXP Pro, Flash MX

Rotated Canon
Hiya,
How can I make a canon that will be rotated by the mouse angle like in this game-
http://www.squarecircleco.com/games/cannon/index.html

Thanks.

Magnifying The Rotated Mc
I have been playing with this for several hours now and can't seem to figure it out. Please help.

What I have is an instance of an mc that I want to magnify. The magnify part works well, BUT once the mc is rotated the magnify only goes to the original position of the mc instead of the current position.

I am attaching the file I am working with.

If you have any ideas or help I would greatly appreciate it.

Rotated JPG Looks Pixelated...
I have worked with flash for quite a while, but never really worked with imported JPGs.

I was just wondering why when I rotate the JPG I imported it looks pixelated.

I have the JPG quality in the export settings turned all the way up.

Is there any way to fix this besides by rotating the image before importing it?

Thanks in advance.

Rotated Buttons
AS3
hi,
I have an _MClinks with an arry af 26 buttons + URLs wich works 100%;
Now the _MCLinks is rotated -17° on another _MC. But here the buttons_hit area is twisted and does not meet the buttons_area any longer.
Can you give me a simple hint to solve this;
I'm not using a tween class since I want to perform an de-rotated at the end of mij MC.

thanks for your help.
(on deadline/urgent)
frank

Copyright © 2005-08 www.BigResource.com, All rights reserved