ActionScript 3.0 :: Sprite X / Y - Values Reference Top Left Corner Or Center

Jun 3, 2010

I've checked this behaviour: If I define a sprite (by programming) as:
var square:Sprite = new Sprite();
square.graphics.beginFill(16750899, 1);
square.graphics.drawRect(0, 0, width, height);
square.graphics.endFill();
return square;
When I check the position of the sprite ( square.x, square.y), they reference the TOP-LEFT CORNER.

If I create a symbol by Flash CS4 and export to Actionscript (I also associate one class which extends Sprite for doing "new()" in my code):
var square: MyClassExtendsSprite = new MyClassExtendsSprite();
When I check the position of the sprite (x, y), they reference the CENTRE of the sprite!

View 3 Replies


Similar Posts:


IDE :: Change Registration Point (left Center Corner Etc) Of Object

Oct 28, 2010

When you create shape on stage and right click and chose create object you can chose Registration point for the object you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?

View 5 Replies

Professional :: Change Registration Point (left Center Corner Etc) Of Object?

Oct 28, 2010

When you create shape on stage and right click and chose create object you can chose Registration point for the object

you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?

View 1 Replies

Flex :: Changing Registration Point From Upper Left Corner To Center?

Mar 31, 2011

I want to learn how you can change the registration point for the Canvas.I want to make a zoom of this component, but the point registration in the upper left corner! How do I move to the center?

View 3 Replies

Flex :: Changing Registration Point From Upper Left Corner To Center

Mar 31, 2011

I want to learn how you can change the registration point for the Canvas. I want to make a zoom of this component, but the point registration in the upper left corner! How do I move to the center?

View 3 Replies

Flash 10 :: Change Registration Point (left Center Corner Etc) Of Object

Oct 29, 2010

When you create shape on stage and right click and chose create object you can chose Registration point for the object..you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?

View 2 Replies

ActionScript 2.0 :: Flip Page Animation - Start Flip From "bottom-left" Corner Till "top-right" Corner

Aug 11, 2009

I am making something flash flip like: [URL] but i want to do it in my banner 1000 width and 299 height problem is that i have few banner images i think 5 to 8 and i want to start my flip from "bottom-left" corner till "top-right"

View 1 Replies

Keep Swf File In The Top Left Corner?

Dec 2, 2009

I want my flash document to stay flush with the left and top of the page, but i can't figure out how.

[URL]

I designed it so that the box with my name in it sits touching the left top corner.When I test it in flash thats what it looks like. But when I up load it it moves over there.

View 1 Replies

Force A SWF From Top Left Corner To The Correct Position?

Sep 27, 2009

how to force a SWF from Top left corner to the correct position.. When I tried to use a container it made the external swf not work at all, though it was in right position

WITH THIS CODE, THE SWF LOADED BUT JUST IN WRONG POSITION :
on (release) {gotoAndPlay(4);
loadMovie("gallery.swf",1);
}

then when I used a EmptyMovieClip it came in as the attachment.

Is there any other way to still use the LoadMovie() and adjust the x and y positions?

View 1 Replies

ActionScript 3.0 :: Getting The Top Left Corner Of A Grid Cell?

Jun 23, 2010

I'm making a map editor for a tile based game. The editor makes a grid:

private function draw
var tileSize:uint= 50;  for(var i:int=0;i<row;i++)  grid.graphics.lineStyle(1,0x000000,0.3); 

[code].....

View 3 Replies

ActionScript 1/2 :: Ship Just Sits In The Top Left Corner Doing Nothing?

Apr 27, 2011

I am following this tutorial and i have got to step 9.http:[url]......I have made a file called Ship.as with this code in.

class Ship extends MovieClip[code]....

When i test the SWF nothing happens. The ship just sits in the top left corner doing nothing.

View 3 Replies

ActionScript 2.0 :: Gallery Goes To Upper Left Corner

Apr 25, 2010

I'm using a gallery maker called "flash slideshow maker professional" , but when it loads, the hole stage goes to the upper left corner!

View 3 Replies

ActionScript 2.0 :: Set The Mouse In The Lower Left Corner?

Jan 29, 2011

like in title, i do labirynt but when i click start mouse is in middle, i want change this, mouse must be in lower left corner

View 1 Replies

ActionScript 3.0 :: Image Grows From Left Corner Instead Of Middle

Sep 14, 2009

I put an image on my stage. Then I created a keyframe out about 25 frames. I then went to frame 25 and grabed the side of the image and drug it in. Shrinking the image by about 30%. This shrank my image from both sides. When I run it, the image shrinks from the left and the right symmetrically. Now after I did this, I clicked on the tween and said to copy as AS3. Then I went to a new layer and tied the new AS3 code to a new image dynamically. It works fine, except that it shrinks only the right hand side of the image. In other words, the images seems to be anchored on the left hand side. How can I make my dynamic image shrink from both sides in?

View 1 Replies

ActionScript 3.0 :: Image Grows From Left Corner Instead Of Middle?

Mar 30, 2010

I put an image on my stage. Then I created a keyframe out about 25 frames. I then went to frame 25 and grabed the side of the image and drug it in. Shrinking the image by about 30%. This shrank my image from both sides. When I run it, the image shrinks from the left and the right symmetrically. Now after I did this, I clicked on the tween and said to copy as AS3. Then I went to a new layer and tied the new AS3 code to a new image dynamically. It works fine, except that it shrinks only the right hand side of the image. In other words, the images seems to be anchored on the left hand side. How can I make my dynamic image shrink from both sides in?

View 8 Replies

ActionScript 2.0 :: Resize Image (Top Left Corner Fixed)?

Jul 6, 2005

This is the souce code for loading and resizing the images from an xml page. The rectangle is autimatically resizing as per the size of the image. But the problem is, in 800 x 600 resolution with small images the rectagle goes down 'coz it resizing happening in aspect ratio (width and height is proportionally changed). I want to change the height and width only downward direction. Top left corner should be fixed. How to alter this code for that.

Code:
MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 3;

[code].....

View 3 Replies

ActionScript 2.0 :: Aligning To The UPPER LEFT Corner Of The Stage?

Aug 27, 2006

I'm sure that many of you already saw things like this ( eg: when winning at FWA S.O.T.D., you get a little "logo" and many sites have it aligned in the upper left corner), so this is what i want to do, let us say i make a MovieClip ( dimensions doesn't matter, but it's quite small ), and i want to align it to the upper left corner of the stage... The thing is that the movie/stage is set to auto-scale, so whenever i scale the browser window then that MC should "refresh" its position and stai at the upper left corner again.

View 3 Replies

IDE :: Stage Position / It's Stuck In Upper Left Corner

Mar 19, 2009

I cannot find any information anywhere on how to change my layout or even the ruler layout in Flash. The stage is stuck in the upper left-hand corner of the pasteboard. If I could get the zero point of the rulers to move (like to the right and down), then I could reposition the stage, but I can't. There is no edit ruler function. The zero points are right in the upper left-hand corner together.I can't see items which I need positioned to the left or above the stage at all. Does anyone know how to change the stage position on the pasteboard or ruler layout?

View 6 Replies

ActionScript 2.0 :: Masked Appears In Theupper-left Corner?

Dec 5, 2001

I made a movie where I'm dragging a mask...

(_x = _mouse
and _x = _xmouse*-1)
you know...

but the picture that is masked appears in theupper-left corner so only quarter of the picture is in the movie...I made it the exact same way and the exact same way as the tutorial (clouds) but ......

View 8 Replies

ActionScript 3.0 :: Shrinking To The Movicelips Upper Left Corner And Its Centerpoint

Sep 12, 2008

I have a button that shrinks an icon on my screen. The problem I am having is that its shrinking to the movicelips upper left corner and need to shrink to its centerpoint. Here is a portion of my code if that helps:

[Code]...

View 3 Replies

Professional :: Flash CS5 Symbol Stage Stuck In Top Left Corner

Apr 19, 2011

In my adobe Flash CS5 when i create a new symbol it opens in a new screen as normal. the stage that I can edit it on however is stuck in the top left when I zoom out and it's starting to drive me nuts. I can't work with it like that.

View 5 Replies

Actionscript :: Flash Stage Is In The Wrong Place 0,0 Is Not In The Top Left Hand Corner?

Jan 17, 2012

I inherited a flash project from someone and if I add a simple movie clip to the stage at position 0,0 it actually ends up in the middle of the screen!

What I can see is that when I open the stage in the library, in it's properties

X=350 and Y=262,05 all the subsequent movie clips which are added to the screen as by magic are added at position X=-350 and Y=-262.05

I would really like to return to a situation where 0,0 is top left corner. Does anyone have any idea what's going on here?

View 1 Replies

ActionScript 2.0 :: Fullscreen The Video Object Loads In The Top-left Corner Of The Stage?

May 8, 2008

I'm working in a xml videogallery and I'm using a video component... The problem is that when I go fullscreen the video object loads in the top-left corner of the stage (is a 800x600 movie) tough I publish my movie with 100% x 100% dimensions.

[Code]...

As you can see after the first fullscreen the stage remains in the Top Left corner. Is there any way to make the stage return to the center? I need to do it when I return from fullscreen to normal mode... or.. what can I do? I tried to put the gallery inside a MC and center it but still fails cos the video object loads in the registration point of the MC (like in the first example I've provided)...

View 4 Replies

ActionScript 3.0 :: Little Red Squares On The Lower Left Hand Corner Of A Movieclip In The Actions Panel?

Sep 22, 2011

What do the little red squares on the lower left hand corner of the movieclips in the actions panel mean? [Fig. 1]I'm working off this template in Flash CS3, that's using ActionScript 2.0 actually. I don't know whether or not that means anything in regards to the above inquire?

View 7 Replies

ActionScript 2.0 :: Make Textbox Dynamic In Size But Anchored From The Bottom Left Corner

Jan 28, 2009

Got a dynamic textbox that I want to be fixed in width and increases in size upwards (i.e its anchored from its base) upon retrieving larger text. Here's the code.

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();

[Code]....

View 2 Replies

AS3 ::Create A Close Button At Top Left Corner Of A Full Page FLash File In It?

Jul 6, 2009

I need to create a full page flash file that overlays a webpage. Something like the example in this link.

I have figured out how to create the flash file which will overlay the page, with all elements centered, from here: kirupa forums tutorial.

The only thing I cannot figure out is how to attach the Close button which would come at the top right. AS3 is not allowing me to attach any behaviour to the button, neither does it allow me to put actionscript there. I am in dire straits.

View 3 Replies

ActionScript 2.0 :: Registration Point - When You Load A Picture Into A Movie Clip, It Loads Into The Top-Left Hand Corner?

Jul 27, 2007

So when you load a picture into a movie clip, it loads into the Top-Left hand corner.I really want it to load into the Top-Right hand corner. Is there a way?I am loading it via AS - not placing it manually, as I have a variety of images which are of different dimensions....

View 4 Replies

IDE :: Set Somethings X / Y To Be Its Center And Not Its Top Left

Oct 15, 2010

how do i set somethings x/y to be its center and not its top left.i know that i can do X = mc.x - mc.width/2 but i think its possible to set its default to understand that its already centered in this way, just im not sure how

View 2 Replies

ActionScript 3.0 :: Rotation Around Center With Registration In Top Left

Jun 20, 2011

I coded an entire file based on the top left registration point of my movie clip. I want it rotate it to point at the cursor, but since the registration point isn't in the middle.. its not a perfect rotation around the center of the mc. Is there anyway to rotate it around the center of the movie clip without changing the registration point?

ActionScript Code:
stage.addEventListener(Event.ENTER_FRAME, aimBall, false, 0, true);
function aimBall(event:Event):void {
ball_mc.rotation = getAngle(ball_mc.x, ball_mc.y, mouseX, mouseY) -90;
trace(ball_mc.rotation);
} function getAngle(x1:Number, y1:Number, x2:Number, y2:Number):Number {
var radians:Number = Math.atan2(y1-y2, x1-x2);
return rad2deg(radians);
} function rad2deg(rad:Number):Number {
return rad * (180/Math.PI);
}

View 9 Replies

ActionScript 3.0 :: Off-center Rotation Of A Sprite?

Aug 19, 2010

As is well demonstrated by a Google search, the rotationX, rotationY, and rotationZ properties turn a display object around the center.

That's all well and good, but I want to rotate a display object about a different point.

I can't believe there isn't a way to do this, but I don't see anything that addresses this question specifically.

View 3 Replies







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