Movie Clip Center
i have figured out how to get a background image in my flash movie to scale and cover the whole browser window, now i need to figure out how to keep the main content and navigation to stay centered and at a consistent scale like here:
http://www.animallogic.com
see how the nav stays the same size and in the middle ? any tips on this would be helpful. thanks.
FlashKit > Flash Help > Flash Newbies
Posted on: 01-03-2008, 06:24 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Center This &%$#@? Movie Clip
I've been working on this all weekend and am a little frustrated (if you can't tell from the title).
Background - Photographers' web site (mine). I have a floating palate to call up jpgs into a centered movie clip. No problem with that (even though I thought it would be the hard part)
My issue is with the movie clip I'm trying to load the images into. They just won't center, the little buggers. Is it the registration? Do I need to write it into ActionScript? Is it something else?
Attached is the file. What am I doing wrong?
Center A Movie Clip.
Ok... the maths are pretty simple for centering a movie clip on the stage, but here's my problem. I want to mimick Director, ie: the main movie stays the same size in a hairline black box in the center of the screen, no matter how large the resolution is. To do this I need to measure the size of the screen when the movie loads and fullscreens, then position my content movie clip according to that info so that it's central in the screen.
Any ideas? Does Flash have such a function for getting screen size built in?
Cheers,
G
Movie Clip Is Off Center In HTML
Hey, i'm still a newbie, so i'm sorry if this seems like a 'dumb' question.
But when I publish my movie clip into html (F12) it shows up 'off' by a pixel. This is what I mean:
I'll have a rectangle, and it will have a white outline, and when I try to match the size of the rectangle to the stage, it will match width just fine, but when i press F12 to publish, the movie clip will only show 3 of the 4 outlines of the rectangle. The right side gets 'chopped off'
here are some links to show you what I mean..
http://www.geocities.com/nics01/Movie1.swf
http://www.geocities.com/nics01/Movie1.fla
http://www.geocities.com/nics01/Movie1.html
I appriciate any help I can get with this.
[F8] Center Loaded Jpg In Movie Clip
I have a logo.jpg that I am loading in logo_mc . I dont know how to go about having the jpg center in the logo_mc instead of loading in the top left.
[F8] Xscale Movie Clip From Center?
how on earth can I scale my movie clip from the center easily? I have the following code attached to my button which scales the x and y up 5 when rolled over, but it does it from the upper left corner, not the center of the movie. This has always been a stupid quirk in Flash to me, as I usually would want the movies to default to the center, so how do i go around it?
I have these buttons placed specifically on the stage, thus don't want to dynamically attach them and use some suggested method where I place one clip inside another and use uneccesary math to decipher the center point of the outer clip...I just simply want to tell it to scale from the center rather than the left corner, and changing its orientation point on the stage doesn't do anything. There must be a way to do this though, otherwise how would it know to do it from the upper left corner?
if (_root.portfolio.briars.hitTest(_root._xmouse, _root._ymouse, true)) {
if ((_root.portfolio.briars._xscale<=105) && (_root.portfolio.briars._yscale<=105) ){
_root.portfolio.briars._xscale = _root.portfolio.briars._xscale + 5;
_root.portfolio.briars._yscale = _root.portfolio.briars._yscale + 5;
}
}
else {
_root.portfolio.briars._xscale = 100;
_root.portfolio.briars._yscale = 100;
};
}
Rotate Movie Clip About Center
I have a movie clip that I want to be able to rotate about it's center. I would like to do this is by grabbing one corner of the movieClip and drag or rotate it.
I created a movieClip and I can drag it but I am not sure how to rotate it about its center.
Any help appreciated.
Always Center A Movie Clip On Stage
I'm trying to load images into a mc (imageHolder), then center the mc on stage. Everytime a different image loads, image's dimensions are different so imageHolder's _x, _y has to be assigned dynamically... How can i always center the imageHolder on stage..?
Center A Movie Clip On 100% Stage
Hello Community
How i can get a Movieclip centered on a 100% Stage?
Stage.align = T; doesnt work :/
and this also not works :/
mc._x = (Stage.width/2)-(mc._width/2);
mc._y = (Stage.height/2)-(mc._height/2);
Thanks in Advance
Oliver
Center Movie Clip In Window
Hi there- I realize this is an incredibly stupid question, but I haven't found any information on how to do it so far. I want to center an object in the window. Of, of course I can set _x and _y to a certain pixel value, but I want it to automatically adjust no matter what the size of the window is. This is easy enough; I should just need to take the window's height and width and divide each by two. But what object and property would that be? Thanks!
Moving The Center Of The Movie Clip For A Frame
im making a game and when u shoot the bullet is calculated where it should be by -140 from the center of the movie clip and when the character jumps the movie clip isnt in the middle of his body is there some way to fix it?
for a example go to http://afflicted.netfirms.com/fuzzynew.html <-- press shift then control in mid air and the bullet will appear where it should be when standing...
Zoom In And Center On An Arbitrary Movie Clip
I am working on a system that uses a floor plan. It gets the information for it from PHP and MySQL. All of that works fine.
What I'd like to be able to do is have the user select an object on the map, and tell it to zoom and center this. I can write the code for the PHP just fine for this. My problem is with the Actionscript.
For the time being, I'd just like to be able to stick into my onClipEvent(load) something that will zoom in and center the movie clip that I specify. From there, I can figure it out.
I've been messing around with the _x and _y positions, but am having no luck.
How To Center A Loaded Jpeg In A Movie Clip?
Hello fk.
I want to load jpegs in using loadMovie. I have a container or "empty" movie clip that I want to load these jpegs into. The catch is that I want them to be centered in that empty movie clip. Can this be done?
Also, I would like the code to be adaptable. For example. If I make my container movie clip a certain size, say 450 x 450 using an obect like a square at alpha 0, can the code carry over to a container that is 400 x 600. I just don't want to go back and tweek code if I change my design. I wish I new more about functions and the like but I don't. Any insight appreciated.
Spinning A Movie Clip On Center Axis? (and More)
Hey fellas,
I have a movie clip on the stage, which is a record.
What I want, is for the user to be able to move the mouse over, click down, and spin the record left and right. To confuse matters, I would like to keep the record spinning (tapering to a stop) after they let go and flick the cursor across the screen. So if they hold the mouse down, the record will rotate with the mouse. and perhaps some lag which will be easy enough.
Anyone know how to do this? I also need to set a maximum velocity (?), whereby when it is spun hard enough, an event is triggered.
I guess the most essential thing is to be able to rotate the object, with tapering etc being secondary. I'm told it uses fairly simple pythagoras etc, but i'm yet to even use a simple rotate command.
My teacher did send a good detailed example, but I had a fair bit of difficulty making heads or tails given that there were rotation limits imposed, etc
Any ideas? cheers
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.
Center Image Within Empty Movie Clip?
Hello, I have been following this tuorial for creating a dynamic photo gallery using xml.
right now, when loaded, the top left hand corner of each image is aligned to the 0,0 coordiante of the empty movieclip. My images vary in size and shape so I would rather that they were aligned centrally to the 0,0 coridinate. is this possible?
I hope I've explained myself ok, any help would be greatly appreciated
Here is the actionscript.
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Call Movie When The Clip In The Center Of The Screen
Dear All,
I want to creat a movie like this, http://www.actionscript.org/showMovie.php?id=293
I want to make the inside movie clip to play when it is enter the center of the screen, how can I do. Out of the center of the screen, I want to call the inside movie clip to stay in the "Graphic "
The test File at http://www.dreamscale.net/~horaceli/test.fla
Thanks,
Horace
Is it useful to make it:
_root.onEnterFrame = function() {
if (_ymouse < 100) {
// then check if you are already playing the desired animation e.g.
//if (target_mc._currentframe > 10)
// target_mc.gotoAndPlay(1);
} else if (_ymouse > 100 && _ymouse < 200) {
// etc...
}
}
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!
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?
Center Movie Clip In The Stage - ActionScript 3
Hi,
How to make sure that my movie clip is always centered in the stage?
For example if the flash movie is resized, my movie would take the screen width and always be placed in the center,
i think it has something to do with stageWidth, but i am not sure about the correct syntax,
can anyone help?
How To Center On Stage A Loaded Movie Clip
Hi everybody,
I have the code below, and I am using it to load an external mc. I would like the loaded movie centered on the stage, after it is loaded, but I can't find a way to do it. Could anyone please help me?
Thanks
Code:
var movieLoader:MovieClipLoader=new MovieClipLoader();
var loaderL:Object = new Object();
loaderL.onLoadInit= function(target_mc:MovieClip){
target_mc._x=Stage.width/2 - target_mc._width/2;
}
movieLoader.addListener(loaderL);
movieLoader.loadClip("main.swf", holder_mc);
Using Actionscript To Change The Center Point Of A Movie Clip
I have asked this before, but the answer was not exactly what I needed (unfortunately).
I need to be able to move a movie clip by using its "_x" and "_y" properties. But I also need to be able to change the centerpoint of the clip.
Example:
I have a clip that has a box-shaped button in it 100px wide and 50px high. The centerpoint of this clip is at 10,35. By clicking somewhere else on the clip, lets say 26,15, I need to be able to set those coordinates as the centerpoint.
I managed to find a way of doing it, but it doesn't work as planned if i dynamically alter the "_xscale" and "_yscale" of the clip (which i need to do). And the method I used does not alter the centerpoint, it just moves the clip in regards to the 0,0 coordinates of the root. The result is what I wanted, with the glitch that if I change the scale of the clip, the action is no longer accurate.
Please help me out ...
Thanx in advance.
When I Load A Movie Clip Into A Target It Doesn't Appear In The Center
Hi I really need some help on why the movie clip I load into a target doesn't load in the center. Instead it loades on the bottom right corner!
here is the website http://www.hostultra.com/~dushhhhhh/ Click on the "Home" button. It is supposed to load in the box to the right but is out of place. I know the flash is not nice but my main concern is why it wont load in the center. You can download the .fla's I used which are only very small in the bottom part.
Thanks for your help.
When I Load A Movie Clip Into A Target It Doesn't Appear In The Center
Hi I really need some help on why the movie clip I load into a target doesn't load in the center. Instead it loades on the bottom right corner!
here is the website http://www.hostultra.com/~dushhhhhh/ Click on the "Home" button. It is supposed to load in the box to the right but is out of place. I know the flash is not nice but my main concern is why it wont load in the center. You can download the .fla's I used which are only very small in the bottom part.
Thanks for your help.
Change Dinamically Movie-clip Center (or Fake It)
Hi all!
I would like snapping the edges of two figures programmatically, being these next one to another and with different rotation.
My first idea was "changing dinamically the movie clip center", so I would simply snap to one point, then rotating the figure till both would share a common edge.
Here is a graphic sample, so you understand what's going on:
http://homepage.mac.com/julifos/flash/sample.swf
And the related fla file (if you wanna experiment):
http://homepage.mac.com/julifos/flash/sample.fla
Thanks!
Easing A Movie Clip To The Center Of The Stage On Resize
hey guys!
Im trying to get a movie clip to ease to the center of the stage on window resize:
onClipEvent(load)
{
targetX = Stage.width / 2;
targetY = Stage.height / 2;
}
onClipEvent(enterFrame)
{
targetX = Stage.width / 2;
targetY = Stage.height / 2;
speed = 5;
this._x = this._x + (this.targetX - this._x) / speed;
this._y = this._y + (this.targetY - this._y) / speed;
For some reason it doesnt center properly???
any ideas?
}
A Simple Question On Sprite Or Movie Clip For Center
I simply draw a line using AS3 in flash environment. but i used moveTo for center. but if i run this it is simply taking x,y axis 0,0 and move around. I want to move this from center of the stage. please help.
below is my code
var line:Sprite = new Sprite()
addChild(line);
var cx:Number = stage.stageWidth/2;
var cy:Number = stage.stageHeight/2;
var radius:Number = 1;
var increase:Number = 0;
line.graphics.lineStyle(1, 0xff00ff);
line.addEventListener(Event.ENTER_FRAME, onEnter);
function onEnter(event:Event):void
{
increase += radius;
//trace(increase);
//line.graphics.moveTo(cx, cy);
line.graphics.lineTo(cx + increase, cy + increase);
line.rotation += 0.1;
}
Help Photo Gallery Tut - Center Images Within Movie Clip?
This could be a really asinine question, and I'm sorry if it's already been asked (read through almost all of the posts and came up with nothing...).
The Photo Gallery tutorial is just fantastic and my little gallery is coming along great, EXCEPT that I can't make the images centered within the movie clip.
Have tried dragging the movie clip almost off the stage, which works, but is disorganized and I have a great deal of trouble figuring out where to put the forward and back buttons...
Can anybody help? Is there a piece of code that will automatically center my images within my movie clip? If it's a matter of x and y coordinates, should I just use trial and error to figure out what numbers to put in, or is there some sort of trick...?
Thanks!
Dynamically Loaded Image ..border And Center Of Movie Clip
Hi all,
I am working on a image gallery where i am loading the images from xml. Now my problem is On click of the thumbnails a larger image should load...I like to give a outline to the image based on the orientation horizontal and vertical and should fit to the image loaded.
I am using the following script to load images.
/*Scrip starts here*/
import flash.filters.DropShadowFilter;
var dropShadow:DropShadowFilter = new DropShadowFilter(3, 45, 0x000000, 0.4, 7, 7, 2, 3);
big1.frm.filters = [dropShadow];
big1._visible = 0;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
th = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
th = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
}
loadmc(); // will assign the th to the movie clip name th_loader//
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
Any help will be appreciated.
Thanks & Regards,
kakas
Center A Dynamic Created Movie Clip With Action Script
Hi all,
I have got a movie clip that is dynamically created with actionscript
I then load an external swf into that movieclip. My problem is having it centered when I view it in my browser..
How do place I center that dynamic created movie clip?
I was trying this but it's not seeming to work.
Code:
var container:MovieClip = this.createEmptyMovieClip("container_mc", 0);
container._x =Stage.width/2;
container._y =Stage.height/2;
Any help appreciated. Thanks
How To Align Horizontal Center Of An External Image Load Into A Movie Clip?
Hello,
I can now use MovieClipLoader to load an external image into a movie clip of my flash file.
However the position (x, y) of the movie clip is fixed. Since the width of external image may be different. Is it possible to align the movie clip horizontal center in the flash movie?
Thanks and best regards
Alex
Controlling A Movie Clip In A Loaded Swf ... "Journey To The Center Of Flash"
I thought I had figured this out, but I was wrong. Here's the scenario...
I have a "master" swf ("main.swf"). This "master swf" contains controls (play, pause, ff, rr) and a movie clip called "player" which contains a holder movie clip called "mc".
Another swf, "test.swf" is loaded into the holder ("mc") in the "player" movie clip in the "master" swf. "test.swf" is one of four locations which will contain buttons inside the specific location.
The "test.swf" is a pic of a room which will have various objects placed in it. The "test.swf" also has a holder for loading other swf's. This holder is called "holder". In the room, I have one button called "button". When the "button" button is clicked, another swf ("subject.swf") loads into the "holder" in "test.swf".
"subject.swf" contains just one movie clip "mc0". This is the movie clip I want my controls in the "master.swf" to control.
I have had this work before on a different project. I tried using the same code, but it just isn't working.
I thought this code would work, but it is not. This code is put on the "pause" button which is on the main timeline of the "master" swf:
Code:
on (release) {
_root.player.mc.stop();
}
I've tried many variations of this code with no luck. It's probably something simple but I'm not seeing it...
Any help would be greatly appreciated!
-john
Can't "center" A Movie Clip
I want to bring a swf onto the stage and center it(a flipping book program), and after the book is centered and opened, how do I keep it centered with an actionscript?
How To Center A Clip When I Click On It
This is my problem:
im using only AS3 for this.
this is the sequence
i load the external swf, then i scale it to some number
i can drag it and zoom it, but i cant center it where i clicked with the mouse
where is my code:
//-------------------------------------------------
//librerias
import fl.transitions.*;
import fl.transitions.easing.*;
//codigo
var mouse_presionado_estatico; //bandera cuando el boton es apretado sin mover el mouse ---> Zoom
var request:URLRequest = new URLRequest("contenido.swf");
var loader:Loader = new Loader()
loader.load(request);
mc_map.addChild(loader);
function mouse_presionado(event:MouseEvent):void{
mouse_presionado_estatico = 0;
aviso.text = "mousepresionado";
mc_map.addEventListener(MouseEvent.MOUSE_MOVE, mover);
}
function mover(event:MouseEvent):void{
mouse_presionado_estatico = 1;
aviso.text = "mousepresionadomoviendose";
mc_map.startDrag();
}
function mouse_liberado(event:MouseEvent):void{
mc_map.stopDrag();
aviso.text = "mouse liberado";
mc_map.removeEventListener(MouseEvent.MOUSE_MOVE, mover);
if(mouse_presionado_estatico == 0){
aviso.text = "mouse click sin movimiento";
mc_map.scaleX = mc_map.scaleX * incremento;//hace el zoom del 12%
mc_map.scaleY = mc_map.scaleX;//hace igual el tamaño largo y ancho
}
}
function reportClick(event:MouseEvent):void{
xcords_cont.text = event.localX.toString(); //Coordenadas en el contenido
ycords_cont.text = event.localY.toString(); //Coordenadas en el contenido
xcords_mc.text = event.stageX.toString(); //Coordenadas en el contenedor
ycords_mc.text = event.stageY.toString(); //Coordenadas en el contenedor
}
//Variables
var incremento:Number = 1.2;
mc_map.addEventListener(MouseEvent.MOUSE_DOWN, mouse_presionado); //listener para cuando se presiona el mouse
mc_map.addEventListener(MouseEvent.MOUSE_UP, mouse_liberado); //listener para cuando se libera el mouse
mc_map.scaleX = .2;//asigna el tamaño del mapa
mc_map.scaleY = mc_map.scaleX;//hace igual el ancho y el largo del mapa
mc_map.addEventListener(MouseEvent.MOUSE_MOVE, reportClick);
//------------------------------------------------------------------
so when i click on the area to zoom in it, i cant find a way to center it where i was clicked before.
TY
Clip The Sides Of Swf And Center
Hey, been having a problem figuring this one out. This is what i got. I have a main large flash file that loades another external flash file into the center of it. The main large flash file is basicly just background eye candy. (like little animated bleeps and flashes and stuff like that). But the main content of the site, the important part is in the center of it. Now, when the viewr is viewing my website at the same resolution i made it in there is no problem, but if it is larger or smaller, then either the main content is off center, or cut off the screen to the right. What i'm wondering is, how would you go about making it so that the movie will clip (not shrink but get clipped) equally from both sides as the screen resoluation gets smaller, or expands to show more of it if it gets larger (doesnt make it larger, but just reveiles more of the swf that would have been clipped if the screen was smaller res). Also, i dont want a bottom scroll bar when the movie file is clipped, i want the movie to just automaticly center in the viewable region and clip the two sides. Ty :). (obviously i'm not asking you to do the work for me, lol. That wouldnt be fair :P. But if somebody could point me in the right direction that would be great. ty :).
EDIT: O yeah almost forgot :P, preferebly if possible would like it to update dynamicly if the window is resized after the site is loaded also, to where the main content would continue staying in the center.
Edited: 06/27/2007 at 12:07:17 AM by NoRefund17
True Center Of A Clip?
I want to find the true center of a clip
Code:
Stage.width/2
Does not do it. I have attached an example I want to find the cursor's distance from the blue line (center) at any point. But as you will see if you compile what i have its just a little offCenter.
If you compile it move the cursor around I a have sometext boxes on the stage that show all the vital stats, X mouse pos, center, distance from center, etc...
BTW this will be a scroller at one point so all that other stuff in the code will one day effect that. Any help would be awsome
True Center Of A Clip?
I want to find the true center of a clip
Code:
Stage.width/2
Does not do it. I have attached an example I want to find the cursor's distance from the blue line (center) at any point. But as you will see if you compile what i have its just a little offCenter.
If you compile it move the cursor around I a have sometext boxes on the stage that show all the vital stats, X mouse pos, center, distance from center, etc...
BTW this will be a scroller at one point so all that other stuff in the code will one day effect that. Any help would be awsome
Center Mc Clip With Easing
Hey all...
I saw the earlier post on centering the MC to your stage. I was wondering if there is a way to do that with easing the mc when the browser size changes.
ie.
this.onEnterFrame = function() {
X = this._x;
x_dif = Stage.width-X;
this._x = X+(x_dif/8);
};
just curious. thanks J
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.
Center Dynamic Text VERTICALLY On Clip ?
Hi,
I have this thing that LOOKS so easy ....
I have a button (quiz game) on which I want to add a dynamic text loaded at game time. This text that may take one line or 2 depending on the length of the text loaded.
How can I deduce the number of lines that the dynamic text will do (or even better, the real Height of the dynamic text) so that I can center the text vertically on the button ? Indeed, depending on the variable width of chars, the same nb of chars may take one line or 2.
HELP, I have spent 10 hours on this and am now ready to make myself a Monk
Pedro
|