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




Center Point Of An Mc



Hi there

I just recently changed to MX, and I'm very (and I mean VERY) pleased with it. Just one thing.

for this script I used, I have to change the centerpoint of the instance of a movieclip. That function used to be in the Transform area if I'm not mistaking.

Can anyone tell me where I can find it now?

greetings, Robin



FlashKit > Flash Help > Flash MX
Posted on: 08-26-2002, 10:06 AM


View Complete Forum Thread with Replies

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

Center Point
this sounds stupid but i cant figure it out, it seems random, sometimes i can move the centerpoint of a graphic sometimes i cant,i need it to rotate on that changed centerpoint, is there something special i have to do?

Center Point Of Mc
Hello,
I have a movieclip called “box” that contains a movie called “arrow”. I am trying to rotate the arrow inside the box but can not seem to get the center point correct. Can anybody show me how to keep the arrow inside the box?
Thanks.

Center Point
I need to change the center point for a motion guide. I have a pen and I want to make animation of the pen writing so I want to attach the tip to the motion guide. How do I do this?
thanks

Center Point Not 0,0?
ok.. i have a symbol. I have set the center point of the symbol to be at the center.

When i drag that symbol to stage and want the center point to be at x=0 y=0. It's not doing it. It aligns the top left corner of my symbol image at 0,0.

What is suppose to happne is have the center point of the symbol at the top left corner of the stage at 0,0 ..

any reason?

.. and yes..i click the scale tool, drag that white dot to center..etc..too..

Zoom Center Point
When I'm zooming a movie clip with action script it sometimes does it form the upper left corner and sometimes from the center. Changing the center point for the movie clip doesn't seem to make any difference. Isn't it supposed to perform the zoom from where the center point is located??

Anyone?

Can I Change The Center Point Of An MC
I have a got an MC embedded in another MC and I want to change/set the center point of the embedded MC from within the _root . Is this possible..???

Cheers - GF

Changing Center Point..
How do I change the center point of something I've "drawn" in Flash - say a square.

I'm trying to get it to rotate on a different axis, like from one of its corners.

How Do I Edit A Center Point?
I used to be able to edit the center point of an instance or MC. Has that feature been removed from Flash MX? I hope not, it was really useful... please let me know if you know how to do it.

thanks

Janet

Move Center Point In MX?
Hey all

please help on this...

thanks!

Point Of Center When Scaling.
Hi there,

I am very new to the flash actionscript and I am having a nightmare using localToGlobal when I try to do the co-ordinate mapping from my MC to the Stage. I was attached my fla to see if it will help.

Generally, what I want is when user click on the portion of the movieclip -- rsx, the clip will first moved to the center of the stage and scale it to 100% (before is 50%) while maintaining the point of focus which is the center. However, everytime when I scale it, the point of focus was gone and I tried localToGlobal but still no luck.

Can any experties out there can help me out???

Thank you very much,

Kit

Zooming From Center Point
I made one flash map but i used image for the map... So my map is larger then the stage and i added arrows to move it . So i want to know how i can scale my map focusing my screen center point not the map image center point. because in that case my center point change once i move the map.

thanks in advance. if any one can help that will be great for me because all other project is already done...


here is the code i use for scaling the map

if (_root.map.larger == 1) {
_root.map._xscale = _root.map._xscale+5;
_root.map._yscale = _root.map._yscale+5;
}

How Do U Center The Reg Point Using Script?
I've create a new movie clip but the reg point is always on top left corner..

Anyone know the code to move/center it?



var ball = this.createEmptyMovieClip("ball"+i,i);

MovieClip Center Point
hello wanted to know how to put a dynamic center point in a movie clip created in action 3

Center MC X/Y Point To Stage?
I am losing it today - coding way too much!!

I have an MC with a large map inside. I want to center an X/Y value (within the MC) to the center of the stage.

Example:

A user clicks on a button that has an associated X/Y coordinate to a position on the map. I need that position to center on the screen.

Any help would be GREATLY appreciated!!

Edit Center Point
i'm trying to make a graphic that swoops upwards fill with color following the swoop. to do this i was going to mask the graphic and have just a big grey square tween up along the swoop by moving its center point to one of the edges and having it turn

only problem is i can't seem to figure out how to edit center point

i remember being able to do this simply but i can't figure out how to do it in this version of flash. help please and thank you

[cs4][3d] Transform 3D Center Point In AS?
Hi!

Does anyone know if it's maybe possible, in some way, to change the x y z of the transform 3D Center point via AS instead of flash IDE?

Any Way To In BitmapData To Set Center Point?
I'm having trouble with rotation. I load a bitmap, and I can get it to move in XY directions using the matrix just fine. So, I have:

ActionScript Code:
var tBitmap1:BitmapData = loadBitmap(blah);
var tBitmap2:BitmapData = new BitmapData(tBitmap1.width, tBitmap2.height);
var tMatrix:Matrix;
 
var X = 20;
var Y = 30;
tMatrix = new Matrix(1,0,0,1,X,Y);
tBitmap2.draw(tBitmap1, tMatrix);


Now, when I try rotating, it rotates around 0,0, which I suppose is correct. Is there any way I can shift the bitmap before the rotation so that I can change the center of rotation? Applying XY transition AND rotation at the same time doesn't seem to do it.

Changing Center Point Of A MC By Code
Hello,
Does anyone have any kind of idea on how to change the center point of a movieclip by code

Defining The Center Point Of Your Movie
I have a movie that is 760 X 100. How do I define the center point? I want to be able to determine if the mouse is "x" amount to the left of the center point or "x" amount to the right of the center point, and the same thing with the y values(top and bottom).

Can anyone assist?

Thanks.

Lock Center Point Of Object?
I have a flash movie with 4 drag and drop objects. These objects can be dropped anywhere on the background wheel. No problem so far. The problem is that these background wheels can be rotated in cw or ccw direction and I need the drag and drop objects to stay locked relative to their position on those wheels. So if the wheel rotates 20 degrees cw the drag and drop x needs to stay in the same position it was dropped yet rotate the 20 degrees as if it was stuck on to the wheel with a magnet. Can this be done?
It seems like I need to lock the center point of the drag and drop objects to the center of the wheel but I have not been able to find that actionscript code. I'm just a graphic artist - so I get overwhelmed by all the programming sometimes. I appreciate any help I can get.

Finding An Objects Center Point
How do I find an objects centerpoint to make it's _xscale & _yscale change from the center instead of from the upper-left side?

So far I've gotten this far, I'm not a math whiz, that's for sure:

halfX = this._width / 2
halfY = this._height / 2
this._xscale = (this._width + _xmouse) - halfX;
this._yscale = (this._height + _ymouse) - halfY;

Changing The Movie's Center Point
Hi.
I need to change the 0,0 coordinates from the upper left corner to a different position on screen.

I am making a longitude/latitiude system and I need to do this for it to work.

thanks

Drag A Circle Around Its Center Point
Any suggestions on how to make a circle or disk shape that, when the user clicks on it and drags, rotates in place around its center point?
Picture a vinyl record or a clock face for example. If you were looking at it from above and could grab and turn it in place 360 degrees...

I know how to make movie clips, drag symbols, etc. I'm thinking more about how to code a circle that can be spun in place.

Scaling Movie But Not From Center Point
wonder if anyone can help??

i am trying to scale a movie in my flash file but not from the center point of the movie, i want it to scale from the x,y co-ords from another movie file.

It is meant to be a telescope effect, so as you zoom in it makes the movie zoom from the position the telescope that is over the movie.

Am probably not making much sense.

Any help or anyone who knows a site with flash telescope effects would be great

thanks

Changing The Center Point Of A Graphic
hi
i have a bit of code that changes the _height of a graphic in a clip so that it gradually gets taller or shorter - that works fine except that the center point(? - the circle with the little cross in it)is top left, so when the height changes it's the bottom edge that slides up and down and not the top ...

so, how can i change the center point to bottom right?

i know that this is a stupidly simple question but just can't find the thing to do it !!!!!

thanks for any help you can give

Bob

Why MC._x And MC._y Remain The Same After I Change MC Center Point?
I want to change the center point of a MC at design time and get the new _x and y_ at run time, but _x and _y stay the same.

How can I get them??

Thanks

[F8] Zooming To Center, Not Registration Point
I'm sure this topic has come up quite a bit, but despite looking through old posts I'm still having problems zooming to the center of the viewable area rather than zooming to the registration point.

I have a horizontal slider bar that incorporates the following control to set the zoom level on a map:

Code:
handle.onPress = function() {
this.startDrag(false, 0, 0, 92, 0);

};
handle.onRelease = function() {
this.stopDrag();
};
handle.onEnterFrame = function() {
_level0.Map.targetWidth = (this._x*20)+1133; //20 is zoom multiplier, 1113 is the original width
_level0.Map.targetHeight = (this._x*20)+976 //20 is zoom multiplier, 976 is the original height

};
The above works fine and zooms smoothly, but it zooms to the registration point (obviously).

Is there an easy formula that incorporates the above script and sets the x and y formula according to the zoom level? I know it's been suggested to place the whole map into a new MC and set the new MC registration point to the center, but because of the complexities of the map MC I'd rather change the x and y values on the fly.

Any help would be deeply appreciated! Thanks!

Start Drag Center Point
Hi all,

I am trying to create a clock feature where users can drag around individually the minute and hour hands. I am trying to do this through the startdrag function which works to move the hands whereever on the scene, but I need it to rotate around the center point of movieclip which in this case is at the bottom.
The movieclip instance name is minutehand

Any help or advise on this would be greaty recieved.

LoadMovie And Rotate Around Center Point
I am trying to load a movie into another movie clip and then on the press of a button, rotate the loaded movie around it's center point. Can this be done?

Transformation Point For Center Rotate
I have a MC like a circle .. with a button its rotate 5 degrees:

Code:
_parent.dayereh._rotation+=5;
but this object not moving from center. I selected Free Transform tool and moved transformation point to center but still its rotation from top-left.

thanks

Resizing An Object From The Center Point?
I want to resize an object, but I want it to resize it to where the center point stays in the same spot but it resizes outward. Right now it does this:

start
http://moose.cc/uploaded/resize_ball_1.jpg
after resizing
http://moose.cc/uploaded/resize_ball_2.jpg

You can see that the tops are still aligned, but on the resized one it resized downward, I don't want that, I want to keep the center point the same and expand its size outward.

How can this be done?

Registration Point Not Wanting To Center
I have a circular font character that I want to rotate. I converted the character to a symbol choosing the registration point as being centered. When I go back to the stage, the center point is off a little bit, so the character doesn't rotate in a true circle. I tried dragging the center point manually, but can't get it just right. Is there a trick to getting the registration perfectly centered when this happens? Thanks

Registration Point Exactly Center To Symbol
Hi all, I'm working on a game that has a stationary background and a scrolling foreground. The Character moves a percentage distance towards the mouse like this...(see code below)


It appeared to work fine except I noticed that as you play the game the screen gets off over time. It was driving me nuts and I think I know why. The mouse and the charater are never exactly center. The y coordinate for mouseY is offset to the character y. I tried centering the character in the movie clip but it doesn't seem to work right. Does anyone know how I can make sure the registratoin point is in the center of the character so character.x will center exactly to mouseX and character.y will center exactly to mouseY?

To complicate I have to force the character to stop short of the top of the screen because of the control panel. The mouse can continue up to the panel so that causes a unsync of mouseY since the user can move the mouse in Y farther than the character is allowed to go. Any suggestions how I can fix this? Thanks







Attach Code

var vx:Number = Math.floor((mouseX - character.x ) * easing)-2;
var vy:Number = Math.floor((mouseY- character.y ) * easing)-2;

character.x += vx;
character.y += vy

// Then I use the same formula reversed so the forgroud moves relative to the character...

bkBackGnd.x -=vx;;
bkBackGnd.y -=vy;

How To Center LoadMovie Registration Point
Hello Flash Tech's,
I really having trouble figuring this one out.
I'm trying to use Zoom transition for my photo Gallery which I'm using loadMovie "jpg" from Xml file.
Now the problem is here.
The Registration Point is set to the top upper left corner and I would like it to be in the center of my loadMovie.
The Zoom transition only zoom from left corner and need to be center equal sides.
How do I do this. My image size is "width 400px height 240px
Thanks....

How Do You Find An Object's Center Point?
Hi,

I'm trying to find an object's center point. I've been using .x and .y (eg. object.x) to find the registration point. From there I've been calculating the center point by adding half the objects width to object.x and half the objects height to object.y. The code below is an example of what I've done.

Or is there a way to set an object's registration point to the center of the object?

Is there a method or property that will give me an object's center point automatically without me having to calculate it?







Attach Code

center.x = object.x + (object.width / 2);

center.y = object.y + (object.height / 2);

Resizing Images In Mc From Center Point
hi guys,
I have an image that loads into an emty mc. When mouse over a button, i want the image to increase in size from the center. I am using a basic script that resizes the mc.


Code:
this.onEnterFrame =function(){
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
this._alpha -= step;
trace(this._width);
if (Math.abs(this._width)>w and this._alpha<=0) {
delete this.onEnterFrame;
}
}
However the image resizes from the top left corner rather than resize from the center.

How do i acheive it so it resizes from the center?

Thanks

Daniel

How To Center LoadMovie Registration Point
Hello Flash Tech's,
I really having trouble figuring this one out.
I'm trying to use Zoom transition for my photo Gallery which I'm using loadMovie "jpg" from Xml file.
Now the problem is here.
The Registration Point is set to the top upper left corner and I would like it to be in the center of my loadMovie.
The Zoom transition only zoom from left corner and need to be center equal sides.
How do I do this. My image size is "width 400px height 240px
Thanks....

Centering The Center Point With The Object?
Hi,

I created a movie clip and dragged it from the Library onto my scene. It had a blue rectangle around it, which made it easy to detect and move. Anyhow, I made some changes to movie clip and somewhere I did something wrong. Now if I drag the movie clip to the scene, I just see a small point. I can move the point around but I don't see my movie. I'm guessing somehow the center point got separated from the movie. I'm not sure. Has anyone else experienced this?

Your expertise is greatly appreciated,
Dan H

Zooming A Clip According To Point In Center Of Screen
I have a clip that is draggable and zoomable (actionscript changes width and height to appear like it is zooming in and out). The problem is when it does this, the point of the movie clip that was in the center of the screen (the point you would want to zoom in on) moves each time the dimensions of the clip change due to the centroid of the movie clip. What I'm trying to do is write some code that accounts for this movement and reposition the clip so that same point is still in the center of the screen, but I can't wrap my thoughts around how to do this. Can anyone help me out?

I mocked up a simple illustration of what I'm trying to do to help you understand better and so you can see my code. I want the little circle inside the gray box to stay right in the center of the screen (marked by the crosshairs) whenever the box zooms in and out.

Adjusting The Center Point Of A Movie Clip
This is probably really simple, but I haven`t been able to figure it out.

A lot of times I somehow end up with movie clips where the center point (where the x & y coordinates are 0) is way off. Is there a way to move the center point to the actual center of the clip? Or (with the same result) moving all of the content to the center at once.

Moving the content in each frame one by one is just too much.

Change MC Registration Point To Zoom To Center
Hi,

I am working on a project in which I have an MC that loads a floorplan from dimensions located in an external XML file...I would like to be able to zoom in on the floor plan, but I am unable to figure out how to get the window to zoom to center as opposed to the top left...any ideas?

Paul

Tween Grow Effect (from Center Point)
I am writing a photo project completely in AS3, basically I just want the images to 'grow' slightly when hovered over.

Example here.
http://www.welcomenowhere.com/static...emo/index.html

Some Code here.

Code:
private function enlarge(e:MouseEvent):void{
var _h:Tween = new Tween(e.target,'height',Strong.easeOut, 75, 140, .5, true);
_h.start();
var _w:Tween = new Tween(e.target,'width',Strong.easeOut, 75, 140, .5, true);
_w.start();

}

private function shrink(e:MouseEvent):void{
var _h:Tween = new Tween(e.target,'height',Strong.easeOut, 140, 75, .5, true);
_h.start();
var _w:Tween = new Tween(e.target,'width',Strong.easeOut, 140, 75, .5, true);
_w.start();
}
I'm sure there is a better way to do this... right?
The image grows from the top left corner, out. I want it to appear to come towards you. So I need it to be resized from the center point, out.

Any help, suggestions would be much appreciated.
Thanks

Pin Point Movie Clip In Center Of Screen
Hi all, I am pulling in external images via xml and ling them up in a row. I have previous and next buttons that moves the row of images across the screen.

I would like to target the movie clip that is front and center and make it 100% alpha, but the rest of the clips around it to be 25% alpha.

I tried this:

ActionScript Code:
if (imageHolder.x == stage.stageWidth/2) {
   imageHolder.alpha = 100;
}

This does not work. Is there a quick way to pinpoint an object in the center of the stage? Any suggestions on how to do this? Thanks!

Attach Movie.... Setting Center Point..
how do i use attach movie and then set the center points to be the same as the movie i am attaching to??


(i know how to do attachmovie it is the positioning that i dont know how to work)

HELP

thanks

Centering Dynamic JPEGs With An MC's Center Reg. Point
Hey gang,

I've created a sliding gallery but i'm having trouble aligning different size images. The images are dynamically loaded with actionscript which is working correctly. However, each jpeg is aligning it's top left corner with the MC's center registration point. What I need it to do is have the jpeg be centered relative to the MC's center registration point. That way I can ensure that when the images slide in, their centerpoint will be the same

Adjusting The Center Point Of A Movie Clip
This is probably really simple, but I haven`t been able to figure it out.

A lot of times I somehow end up with movie clips where the center point (where the x & y coordinates are 0) is way off. Is there a way to move the center point to the actual center of the clip? Or (with the same result) moving all of the content to the center at once.

Moving the content in each frame one by one is just too much.

How To Change Center Point Of A Movie Clip
Ok, I'm just getting into some game development. What I'm trying to figure out right now is how to move the rotation point of a movie clip.

The idea behind this is that I'm making an overhead view game. My main character will stay fixed near the bottom of the screen and only face up. the Left and Right keys will be used to rotate his direction - but in reality the ground is what is rotating, since the main character never actually changes positions.

The problem is that when i get away from the center of the ground movie clip, it's more like I'm swinging around the image, because it's rotating the ground movie from the center of the movie clip, rather than my hero's center position. How can i get the rotational point of the ground to always be at the center of my hero character?

Math Help For Zoom/scale On Center Point
Hi,

First I must admit (obviously) that I am very bad with math terminology but am fascinated by how things work, so I usually end up figuring things out but my solution is not always elegant. My problem is on how to use the correct math/functions to achieve some zoom functionality. Here is how my application works.

There are two main windows/views (movie clips)
One is what I call the "proxy"
The second is the "main" view

The proxy window displays the "main" window's full contents, but at 25%. The contents of the "proxy" do not change size or position etc.

The "proxy" window has a mini view finder that you can drag around.
The drag bounds are the inside of the "proxy"
When you drag the "finder", the contents of the "main" window move, in the opposite direction. The idea is what you see in the "finder" is what you see in the "main" window. The "main" window's contents are actually bigger than it's size, but you can only see what is currently inside (mask) of the "main" window.

This "finder" is an empty square with border, and it's size and position represent the current zoom level and position (respectively) of the "main" window's contents.

There is also a "zoom" slider.
When you slide the zoom from 100% (default and lowest setting), the "main" windows contents get bigger, zooming to the center point of the "main" window. The "proxy"'s "finder" then gets smaller focusing in on the center point.

Once you zoom in above 100%, you can then drag the contents of the "main" window. When dragging, the "proxy"'s "finder" also moves to show what is currently being displayed in the "main" window.

The sizes of the "main", "proxy" and "finder" are all proportionate.

If you zoom out (towards 100%), the contents of the window should zoom out from the current center point in the "main" window. For example, if the contents are a map of the United States, and you are zoomed in on Boston, when you zoom out a level, you should still see Boston in the center but zoomed out.

If you are zoomed in on an area at the edge, the center point should dynamically move towards the center of the contents. Example, because Boston is at the edge of the contents (farthest east on the US map), when you zoom out, it should not show the empty are to the right and stick to that center point, but should instead lock/anchor the "main" windows contents to the right. The same should happen to the "proxy"'s "finder".

I know this is all very difficult to understand without seeing.

If someone could point me in the right direction(s) (website, examples) as to where I could go to get help or even tell me what kind of math is involved (trig, geom, alegebra?) then I'd be in better shape.

Thanks for your time,

M

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