Alignment - Centre The Number In Relation To The Rectangle Behind It

Oct 6, 2009

thought I'd posted this but clearly not I created a rectangle and in the centre using the text tool places the number 1 try as I might I cannot find an easy way to centre the number in relation to the rectangle behind it. Is there an easy way? tried the alignment tools but failed

View 1 Replies


Similar Posts:


Alignment - Centre The Two Rows Of Buttons On The Stage

Sep 29, 2009

I've ceated 18 buttons 1-18 on two rows and using the alignment tool made then all gapped the same and in line etc. I now want to centre the two rows of buttons on the stage. I've shift clicked to select all the buttons but no matter what option I pick in window alignment I can't get it to work.

View 2 Replies

Calculate Centre Point Of Rectangle In Flex?

Feb 23, 2012

I have two rectangles: var rect1:Rectangle = new Rectangle(66,147,89,67);

var rect2:Rectangle = new Rectangle(155,147,89,67);

How to calculate the centre point of these rectangles based on their x and y positions. I want the centre point to be calculated with relative to stage

View 2 Replies

AS3 :: Auto-Centre - MovieClip Always Stays In The Centre Of The Stage On Resize?

Jul 22, 2009

Just a quick one. Using AS3, how would I ensure that a movieClip always stays in the centre of the stage on resize?

View 1 Replies

Professional :: Rectangle With Arbitrary Number Of Rectangles?

Mar 27, 2012

I'm trying to figure out how to tile a rectangle (the stage) with an arbitrary number of rectangles. Simple tiling where all the tiles are the same size and simply stacked in a grid.I'm doing this with a resizable layout and a number of tiles that is arbitrary and will change over time.

Given a more or less 4:3 or 16:9 monitor I would like a solution that tends toward minimizing the perimeter of the tile and being similar in aspect ratio to the screen. I realize that if I have a prime number of tiles that I won't be able to make a nice grid, but other than that it seems there should be some way to do this.Lets say I have 231 tiles I need to arrange. The factors are 1, 3, 7, 11, 21, 33, 77 and 231.If the screen is really, really wide 1 x 231. Wide but not not as crazy wide as before 3 x 77. And most likely 11 x 21 is what I would need.So is there an easy way to do this on the fly? Is there a pre-calculated way to make it easy?

View 1 Replies

Java :: Break Up Square / Rectangle Into Large Number Of Randomly Sized Squares / Rectangles

Oct 13, 2011

I'm trying to break up a square or rectangle into a large number of randomly sized squares or rectangles so that none are overlapping.How to fill a square with smaller squares/rectangles?The solution seems to be either through bin packing or some sort of tree map.But what I'm looking for is the actual algorithm in Java, Javacript , actionscript or even C.

View 3 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

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

Flex :: Hibernate Map An Object Without Relation?

Apr 1, 2011

I have a situation where i have relations like this:A person has one or more addresses.A customer has one or more addresses.Person,customers and addresses are separate tables.I used to do this with the @OneToMany relations.This is giving me problems since our flex client is sending me objects wich are created in the client ad have to be created in the DB.If the client sends me a person and customer which reference to the same address hibernate will create two address objects since the two address object are not the same java objects (not the same pointers).This is a problem which is caused by BlazeDS and Dozer which will create new objects when they are send to the server.So what i would like to have is the address id in the person and customer object without an relation so hibernate does not create the objects. But when i read a person object i would like to fill a transient address object based on the stored address id.

View 1 Replies

As3 :: Flash - Moving An Object In Relation To Another?

Jan 17, 2012

i have a character_mc that moves on mouse click, a logtxt dyanamic text box and a mc named $box. The camera follows the character and when the log and $ boxes are staying put.

I want them to stay on the same point on the stage(meaning I want them to stay at the same place on the camera) I was wondering what i might do for this? I have tried to put them in a movie clip but it doesn't really seam like it worked well so i discarded the idea.

Heres the code:

package {
import flash.display.Sprite;
import flash.display.MovieClip;

[Code].....

View 1 Replies

ActionScript 3.0 :: Relation Between Var Count If And Switch?

Feb 26, 2009

this code from the flash AS3 documentation, i am trying to get familiar using filters, it really helped me a lot, there is one section i did not understand, please see the comments at the end of the code:

Code:
var distance:Number = 8;
var angleInDegrees:Number = 225;// opposite of 45 degrees
var colors:Array = [0xFFFFCC, 0xFEFE78, 0x8F8E01];
var alphas:Array = [1, 0, 1];
var ratios:Array = [0, 128, 255];

[Code]...

View 6 Replies

ActionScript 3.0 :: Positioning - GrandChild In Relation To Parent?

Jul 25, 2010

I have 3 swfs which I load into one another- grandChild loaded into child, and child loaded into mainMovie.I am positioning the child to the center of the mainMovie(parent). I also use resizeHandler to make sure the child stays center when stage resizes.When I load the grandChild, I would like to place into on the stage in relation to the mainMovie i.e 100px from the top of the mainMovie.

I tried to write the code in my mainMovie:

child.content.root.grandChild_mc.y=100;

But this only place the grandChild on the stage in relation to the child and not the mainMovie.

View 1 Replies

ActionScript 3.0 :: Relation Between Root And The Document Class?

Aug 27, 2010

How are they related?

Are they the same?

Is using "MovieClip(root)." from anywhere actually equivalent to coding in the document class?

What's different in their effect on the display list?

View 1 Replies

ActionScript 2.0 :: Easing While Moving Something In Relation To Mouse?

Jun 18, 2007

I have a stack of images that I need to move down when the mouse is above y = 250 and up when the mouse is below y = 250. I have this code, but the problem is I don't know how to add easing.

Code:
onEnterFrame = function() {
someConstant = 2342;
lastIndex = picThumbArray.length - 1;

[Code]....

View 3 Replies

Javascript :: Relation Between Client Side Scripts And DBMS

Nov 2, 2011

Today I heared something weird from someone, he said that using Javascript at the front end with Oracle DB that gives high performance than the performance if used Flash(ActionScript) with Oracle, while MySQL have the same performance with any client side scripting. Is that right?, Does client side scripts have anything to do with DBMS ?

View 1 Replies

ActionScript 2.0 :: Play Sound In Relation To Mouse Co-ordinate?

Feb 22, 2009

If mouse position X is between 0 and 100 play "sound1"

When mouse leaves these co-ordinates stop playing sound instantly

If mouse position X is between 101 and 200 play "sound2"

When mouse leaves these co-ordinates stop playing sound instantly

If mouse position X is between 201 and 300 play "sound 3"

When mouse leaves these co-ordinates stop playing sound instantly

And then

If mouse y position is between 1 and 50 volume = 50%
If mouse y position is between 51 and 100 volume = 100%

View 8 Replies

ActionScript 3.0 :: Get Object Bounds In Relation To Transform Center?

Jan 15, 2010

I'm building a class at the moment for transforming and scaling content with align, constrain and scaling options.

This is just just fine if the transform center is LEFT or TOP_RIGHT, or what have you, and always within the object bounds, but I haven't yet tackled situations where objects are NOT nicely aligned, or the transform point is outside of the object bounds.

View 3 Replies

ActionScript 3.0 :: Smooth Out Scrolling Relation To Where The Mouse Is On Teh Screen

Jan 27, 2010

I have some code which moves back and forth through my menu so that it scrolls in relation to where the mouse is on teh screen. The problem is that I cant get it to scroll smoothly and is a little jerky... I want to ass maybe some smoothness or maybe a little lag to it so it just seems more smooth. I have pasted the main code I have so far below.. I am using AS3 at the moment.

[Code]...

View 1 Replies

ActionScript 3.0 :: Make Movie Clip Move In Relation To Another?

Jun 12, 2010

The menu works as follows: My stage is 960px wide. On the stage there is a holding MC called container_mc which is 1900px wide. Within this holding MC there are 6 buttons which fill up the entire dimensions of the MC. This container_mc sits on the stage and the sure can click and drag this container about horizontally thus revealing all of the buttons. When they click it opens up a box. When the box is closed the menu comes back. All of this works perfectly.

I am now trying to integrate a movieclip, lets call it markermc that sits underneath the container_mc on the stage. Now, as the menu is dragged i want this markermc to move relative to the container_mc. So if the container_mc is being dragged left, at the same time i want the markermc to move right or if the container_mc is being dragged right then the markermc needs to move left. The reason i want this is because it will give a visual clue as to where you are on the menu. A working example of this can be seen at [url]...

The container_mc's starting X position is 20px on the stage. This is the same starting position for the markermc. The container_mc can be dragged as far as -960px for its X position. When the container_mc is at this point, then the marker MC needs to be at 960px. Basically i am trying to get the markermc to move inversely to the container_mc.[code]...

View 1 Replies

ActionScript 2.0 :: Relation Between The Layer Of The Masked Movie And The Mask Itself?

Apr 17, 2003

I want to mask a movie clip with another one, the mask is a dynamic square which expands to the whole scene.Anyway, I wanted to now what is the relation between the layer of the masked movie and the mask itself,(should they be at the same level or not?) I use the above script:

_root.createEmptyMovieClip("mask", 22);
_root.createEmptyMovieClip("masked", 21);
masked.attachMovie("home_btn", "masky", 0);
_root.masked.masky.setMask("mask");

[code].....

View 3 Replies

ActionScript 2.0 :: Change Frame Of Movieclip Depending On Relation To Mouse?

Oct 28, 2010

This is a CS4 file so and I have CS5 so if you give me either it will be awesome

I have a movie clip that follows the mouse..

Its not done yet but its gonna be a dog chasing a/the mouse...

I want to have it where the if the mouse is left or right of the following movie clip it shows it walking toward the mouse... so something like

if mouse positions is less the the cursor + 10 (pixels) goto and play frame with dog walking left and one for right up down (I want this to walk till its directly under or over mouse and then laydown or jump only when over or under mouse..

(say its a 20 pixel wide object and 10 on each side will cover the whole thing and not just the exact center pixel, thats what the 10 + movie clip position is for, but Is there a way to tell it to goto and play whatever_frame when mouse is left of any graphic on the sitting dog section??? like the equivalent of onRollLeft or whatever.)

this is the code i have.. its the top statement that doesn't work the bottom 2 do..

Code:

if (_xmouse < detail.x+10) {detail.gotoAndPlay(61);
}
detail.onRollOver = function() {
detail.gotoAndPlay(31);

[Code].....

I already created the shapes and placed them in the appropriate frames.. you should only need to mess with the actions on the instance "detail" (the dog face in frame 1 of scene 1 in layer "follower" ---- just the actionscript needed for that instance is needed in the reply.. you should not need to chage any of the layers, but if you do just tell me what you did and why.

my fla is to big to upload to this form so im placing it on my website here

View 2 Replies

ActionScript 1/2 :: Change Frame Of Movieclip Depending On Relation To Mouse?

Oct 28, 2010

Its not done yet but its gonna be a dog chasing a/the mouse. I want to have it where the if the mouse is left or right of the following movie clip it shows it walking toward the mouse... so something like
 
if mouse positions is less the the cursor + 10 (pixels) goto and play frame with dog walking left
 
and one for rightup down(I want this to walk till its directly under or over mouse and then laydown or jump only when over or under mouse.. (say its a 20 pixel wide object and 10 on each side will cover the whole thing and not just the exact center pixel, thats what the 10 + movie clip position is for, but Is there a way to tell it to goto and play whatever_frame when mouse is left of any graphic on the sitting dog section???like the equivalent of onRollLeft or whatever.)

[Code]...

View 3 Replies

Flash :: Having The Scrollbar Handle Sized In Relation To The Content Height

Jan 22, 2011

I'm having a bit of trouble with this logic. My setup is typical, with a content MC and a handle MC the runs along a track with specified bounds. All I want to do is have the handle height adjust based on content height but in relation to the track height?

View 1 Replies

ActionScript 2.0 :: Moving MovieClip In Relation To Border Of Scaled Object

Oct 20, 2009

I have a frame_mc that get scaled 400 % onPress with a fusekit tween. Now I'll like to anchor a title_mc to the the top edge of the frame_mc without scaling it. How to do that? onEnterframe in the onPress function?

View 0 Replies

ActionScript 3.0 :: How Does Flash Determine The Coordinates Of Movieclip In Relation To The Stage

Mar 28, 2009

Okay this is always something that's puzzled me. If I create a movieclip, place that clip on the stage, then inside that movieclip, create another movieclip, how does flash determine the coordinates of that second movieclip in relation to the stage. The reason I am asking this, is that I have a large movieclip which contains a number of other smaller movieclips. When a user clicks on one of the smaller movie clips, I need the larger movieclip to move so that the clicked movieclip is now centered on the stage.

I figure that this would be easier to know if I knew how to calculate the distance which the second, smaller movieclip is from the center of the main stage in x and y coordinate values. Am I making any sense? If not I'll try to explain again.

View 14 Replies

ActionScript 3.0 :: Get Map Centre Zoom Accordingly?

Oct 23, 2009

I have multiple points on a Google map that i need to pinpoint.How would i find the two points that are farthest away from each other and get my map center an zoom accordingly?[code]Just copy and paste into root time line to test

View 1 Replies

ActionScript 2.0 :: Nested Movie Clip Position In Relation To Root Timeline?

Feb 23, 2009

when I attach an mc inside another movie clip and then during interaction with the movie change the _x of that parent clip to whatever other value than original location, the _x of the child mc does not change as it regards its position in relation to the parent - moving the parent does not move the child within it how do i find the _x of the child in relation to the _root though as opposed to the relation to its parent?

View 1 Replies







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