What I need to do is find the rectangle of a rotated rectangle. I have a house that is diagonal and I need to find the rectangle of the bottom of the house so I can check for collisions. I was hoping to use the rectangles to find intersections. Something like - if (playerRect.intersects(houseRect.bottom){ do something };Every time I try to get the rectangle of a rotated rectangle, all I get is the bounding box which is not rotated.
The link elements I'm talking about are single words, so they are not wrapped inside the container, which means that they should have a single bounding rectangle. But how do I go about finding this rectangle? I'm familiar with Flex3 but don't know enough about the new Text Layout Engine in Flex4.
I have a rectangle of any arbitrary width and height. I know X,Y, width, and height. How do I solve the upper right hand coordinates when the rectangle is rotated N degrees? I realized if it were axis aligned I would simply solve for (x,y+width). Unforunatly this doesn't hold true when I apply a transform matrix on the rectangle to rotate it around its center.
I have a BitmapData with 2 red circles. I want to find the rectangle area or each circle. If i use [B]getColorBoundsRect[/B] I get the smallest area enclosed by the 2 circles. How can i go about this and get individual area of the circles?
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.
I downloaded a royalty free flash file, that had a text effect I want for a menu of a project of mine. It didn't had much info, so I bought it, only to find out everything is pretty much done with AS2 (I think, may be AS1).
The thing is I want this menu in diagonal position (4�)
How would I go about making diagonal link like this one.I drew a retangle so that my text would fit in, select both text and rectangle, F8 turn into button,then I turn them 45degree. When hover the text change color the way I want, but the problem is that the button enters the hover state way too soon when my mouse isnt over the rectangle yet.Seems like as long as my mouse falls within x and y coordinates of the text then it goes into hover state.For example my mouse is under the diagonal box, not in yet, but right under the text and it would go into hover state.
instead of the grid fading horizontally or vertically, have the grid fade diagonally, or have it fade corner square, then left square beside it and top square above it (corner square) at the same time, then the ones beside those etc. as transition for the image below it, for a screen saver (5 or 6 images in a row). Also I was wondering if this diagonal grid (assuming it can be done) can be done with other shapes (instead of squares).
How would you script the movement limitations to create a diagonal slider? Im not looking for anything tricky. Just a plain 45 degree, .785 rads, um i think angle movement.My current Horizontal slider is as follows.
i would like to replace the background color with a tiling background-image. i understand that "graphics." can only fill or draw. i understand the chunk of "graphics." in the code above needs to change to something else, but i am at a loss of how to call the following image: background-image: Embed("images/bg-uneditableField.jpg");
I have searched high and low unsuccessfully. I am a front-end developer just stepping in to our Flex 3 environment and am not a strong javascript/.as person. Note: our application needs to stay in Flex 3, upgrading is not an option at this time.
I've been looking for a Snap To Grid effect like this one [URL]. It's the best one I've found so far. It's what I want to create but I want my grid to be on a 45 degree angle and I have no idea how to do that...
i'm trying to restrict the movement of a mc to the diagonal. so even if i click and drag it towards the x direction, it moves the corresponding distance on the diagonal which is, the 45 deg angle line.same with the y direction..so when i click and move the mouse haphazardly, all the object does is to follow it on the diagonal.But i just cant figure out the math for it. i mean, theoretically i think i need to use the x-component of the mouse when its angle is < 45 and the y-component when its angle is > 45. but how do i find those angles in flash?
I'm working on a volume slider for a type of jukebox and what I'm using is an actual drawing that is on an angle, therefore the volume slider and handle aren't in a straight horizontal line.I've done the basic code to keep the handle within the distance of my slider "line" (left to right), but what I have obviously just constrains it to a rectangle.
The slider and handle are both at actual size, that's why it's only 32 pixels wide that I need it to go across and 9 pixels down. I do realize that for what I want, it's much more involved than this simple startDrag code with 4 sets of numbers in it.I'm including the source file in Flash 8/Actionscript 2.0.
i'm working with don't supply me with any symbol/symbols that mean "and" I know || is for "or", ! is "isn't", but if I want to say something like:
if (event.keyCode == Keyboard.LEFT || event.keyCode == Keyboard.DOWN) { }
except instead of ||, I'm looking for a symbol that means "and" I have 8 renders of a walk cycle in 8 different directions. (stored on 8 different movieclips within the main movieclip.) I want to try making an "if" statement that plays the diagonal animations when 2 arrowkeys are pressed at once.
Currently, I am using the code below. But it is telling me that the circle is starting to hit the line when it's y position is 40. But since the circle actually isn't crossing the line itself (virtually) until it's y position is at about 205, I don't want the trace-action called so early.
Code: var circle: Sprite = new Sprite(); circle.graphics.beginFill(0xFF0000); circle.graphics.drawCircle(0, 0, 10); circle.x = 170;
I used some code that I found, I think even from you guys the scale an external swf being loaded onto a background movie clip. Works great with the exception that it clips some text and creates some funny diagonal lines and some poor picture quality. I have a feeling that this is down to a slight difference in sizing some where along the line. The stage size is 2560 x 1440 being scaled down to any size, but as I mentioned I don't think the height and width are quite in sync for the widescreen format.
Imagine two movieclips, both on the same Y axis. I want one MC to be able to diagonally move to the other MC X axis, all while making a perfect diagonal line until it reaches 100y. So just like this picture, that MC moves in a perfect diagonal until it matches the other MC.x, and 100y (no matter what, it can't go past 100y but must equal 100y). I probably made it sound more complicated than it is.