ActionScript 2.0 :: [Flash8] - Resizing - Movieclip Resize On Center, But I Want Is On Left?
Apr 26, 2007
resizing movieclip using action script. I doing a resize on the width of the moviclip. What i got is the movieclip resize on center, but i want is on left. the code i use as below:
MovieClip.prototype.resizeMe = function(w) {
var speed = 3;
this.onEnterFrame = function() {[code]......
View 2 Replies
Similar Posts:
Jun 27, 2011
I need to make a MovieClip rotate around it's center point to the left or right depending on mouse drag. I got some basic semblance of what i want going, but it's pretty hackish. Normally i calculate the angle and such but i only really need to use the distance the mouse travels and apply it to the movieclip and for flavor add some nice easing when you let go.
public function Main()
{
var wereld:MainScreen = new MainScreen();
addChild( wereld );
[Code]....
View 1 Replies
Mar 6, 2011
I creating a flash gallery(using flash first time) and found one problem. When i resize movieclip(container) it resize its children, so i could't resize them manualy to dimensions what i need. How i can disable resizing of children of movieclip?
View 4 Replies
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
Feb 20, 2009
I have a sprite and a tween created using actionscript.
the sprite resizes correctly but the center of resizing is the upper left corner.
How can I set the resizing point to the center using actionscript ?
View 3 Replies
Jul 15, 2010
I would like to set a fixed width for an input textfield with an embedded font. I would like to have the option to left-, right-, or center-justify the text. This is proving difficult.
If I set myTextField.autoSize = TextFieldAutoSize.LEFT;, I get left-justified text, but the textfield width changes with each keystroke. Same trade-off with TextFieldAutoSize.RIGHT and TextFieldAutoSize.CENTER.
Now, if I use TextFieldAutoSize.NONE, then I can fix the width and height of my textfield, making it the size I want... but the cursor is always blinking in the middle of the textfield. What's the secret to justifying that cursor to the left [or right] and the textfield staying the size I initially set it to?
View 1 Replies
Apr 10, 2009
i have made a sniper style game an hav programme a moment where there is pause between each click (reload time) but how do i make it so that when the gun is reloading the left click is disabled, as it stands now while the gun is reloading the aim doesnt move but if u click on an enemy they still die as it stil sees it as clicking on it, how do i disable it for these 2 seconds while my gun reloads
View 1 Replies
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
Jul 11, 2011
I'm trying to Resize a panel using a Resize Effect using its center as the anchor point. I've been googling for some information and the only thing I have found is to set the horizontalCenter and verticalCenter to 0, but this is not working for me. The panel keeps resizing from top/left corner.
View 1 Replies
Nov 16, 2010
I'm making a 3D room builder. The user places Sprites around the 2D stage and my script converts those Sprites to Papervision3D DisplayObject3D objects. I'm having problems with the 3D object positioning because Sprites have registration points at their top-left corner and 3D objects have registration points at their center. How can I make that conversion?ere's a scheme of how the 2 different coordinate systems work:
I've tried this code:
child3D.x = child2D.x;
child3D.z = child2D.y - child2D.y - child2D.y; // just to make it negative
[code]....
View 5 Replies
Jul 9, 2010
How to accomplish making the knob pan center at 60 for 60 Hz and only go left and right between the ranges of 59.95 to 60.05 in increments of 0.05? I am illustrating synchronizing between two power systems. I got the scope and and voltage wave forms down but making the knobs work the way we need is driving me nuts.
View 0 Replies
Jul 11, 2003
I start with a question: how could I change the registration point of a movie clip created or loaded at runtime? I want to move the registration point from top/left to center.
View 2 Replies
Aug 2, 2006
I am having problems with creating a vertical slider using startDrag. For some reason, when the dragging starts, it jumps to the top left of the stage...
View 11 Replies
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
Oct 3, 2009
1. Is there a way to scale up an object from its center even if its registeration point is at the top left? can that be done using TweenMax?2. can I apply the same tween on two objects at the same time? basically what I want to do is load up an image to the stage, and then tween its scale from 0 to the original size along with another movie clip behind it that would form some sort of a border for the image. and I want to scale them up from the center.
View 5 Replies
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
Dec 28, 2009
Here is myattempt at using swfobject and alternate content:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>[code]........
I seem to be getting closer to this, but I can't get it to NOT resize the swf!
View 4 Replies
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
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
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
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
Feb 7, 2008
I have been creating an XML gallery now got to showing the big images part. I want to create a resizing background [URL]. I can create the effect but it always resizes from the top left not center.
[Code]...
View 2 Replies
Jan 23, 2009
I'm just trying to figure out to get my MC to resize from the center instead of the top left? Can I change the registration point or something in AS?
View 1 Replies
Jan 17, 2012
I have a window witch is resizing on creationcomplete phase according user preference. This part woks well. But inside this window a s:Group (maincontainer2) exists and even if width and height is in percent, the s:Group size is bigger that the new window measure.
<?xml version="1.0" encoding="utf-8"?>
<windowSkin:wCustomWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
View 1 Replies
Apr 16, 2008
I have a listener that calls a function which sets up everything on the stage exactly where and how I want it, works great. However..I also use the same function for my initial setup, and it's not triggered until/unless someone resizes the window, and as a result, everything is a mess until the window is resized.I could just duplicate the relevant bits in a separate function, but that seems needlessly redundant.Is there a way to trigger the function upon the initial load without waiting for a resize event?I would just call the function directly at the end of the script, but it expects a parameter that I can't figure out how to pass it.[code]
View 3 Replies
Feb 12, 2010
How do you resize a sprite without resizing the contents? For example the script below create a sprite, attaches it to the root, creates a button, attaches the button to the new sprite then resizes the sprite. but it scales the button when I try to resize?[code]...
View 9 Replies
Dec 16, 2007
I want to make three MC and when onRollOver I want to scale each one of them to 120% and when onRollOut to go back to 100%. If I write the entire code it works, but when I try to make a function it doesn`t. I�m a complete newbie with flash so I apollogize for asking for help with this.
Instance Names: foto1, foto2 , foto3
Code: zoomin = function (){
this._xscale=_yscale=120
}
[code]....
View 4 Replies
Dec 8, 2010
I am just getting back into using Flash after not using it for about 5 years. I'm having an issue with the simplest thing! I want to be able to type pixel values into the Properties panel to transform/resize an object from the OBJECT CENTER as reference point. If I use the transform tool, it uses the center of the object as the reference. However, if I do as above and type values into the Properties width/height, the object transforms with the top left corner as reference. If I need two or more objects sized exactly the same, or if I want to do a "zoom in" effect, using the transform tool is very ineffecient!
My object seems to be showing that the center is set as the reference point (white circle in center of object). Also, the objects I am working with are jpg's and psd's imported to the library, and made into movie clip symbols.
View 9 Replies
Feb 19, 2009
im creating an xml image gallery and its going well, but for some reason when i add the loaded image to the stage even though i've specified it to go to the center of the stage it doesn't, and won't center until I resize the stage
View 2 Replies
Jan 29, 2009
Imagine I have a movie clip on the main timeline that has text in it. If I use the free transform tool on this clip, it resizes the movie and the text within.
However, if I resize the clip using AS2 e.g. clip._height = x; then the clip is resized but the text isn't.
Is there an easy way of achieving the effect that the transform tool has using AScript or do I have to set all the text params separately when I resize the movie
View 1 Replies