ActionScript 3.0 :: Sprite's Transformation Point And Insertion Origin

Aug 5, 2011

I am making application which will dynamically create sprites via action script and copy the sprite's image to a bitmapdata object via .draw() function. I would like to store the location of the sprite's transformation point and insertion origin (which would be set within the flash editor when the sprite is created/imported.) Is there a way to access the location of the transformation point and the insertion origin via ActionScript? I just want to read it, I do not need to change it.

View 5 Replies


Similar Posts:


Flash 9 :: Reset Transformation Point/Set Transformation Point?

Feb 8, 2008

When I right-click a symbol the options "set transformation point" and "reset transformation point" come up. They don't seem to do anything for me. I thought it would center them or something. This is not the case. I have the white transformation point in one corner in one keyframe and a different corner in another keyframe I click "reset transformation point" on both frames and they don't move.

View 3 Replies

ActionScript 3.0 :: Change Caret Insertion Point In Input Textfield

Apr 30, 2011

Is there a way to reset the insertion point of the caret to any position within an input textfield. I would like to reset it to position 0. The only thing I can find is caretIndex prop but that is read-only. I tried setSelection(0,1) but that didn't work either.

View 5 Replies

ActionScript 2.0 :: Set Transformation Point In It?

Jul 10, 2009

How would I make this grow from right to left?[code]...

View 1 Replies

IDE :: Change Transformation Point With AS?

Aug 11, 2009

Is there any way to dynamically change the Transformation or registration point of a MC with AS3? I'm trying to dynamically create shadows behind clips that skew to follow the sun.

View 3 Replies

ActionScript 2.0 :: Origin Point Of Movieclip?

Jul 26, 2010

Can anybody tell mw what is the origin point of the movieclip.

View 1 Replies

ActionScript 3.0 :: Origin And End Point Of A Line?

Feb 14, 2011

Can anyone tell me if an instance of a line as origin point and end point properties that can be read or changed? I know that if you create a line with actionscript you have to set them. But can the X and Y coordinates of the points be accessed once the line exists and moved to a different location?

View 3 Replies

ActionScript 3.0 :: Dynamically Setting Transformation Point

Mar 7, 2009

I am creating an interface where a user can pick up "Polaroid" stle photos and shuffle them around a virtual desktop. I want to photo to shift it's transform point to match the point at which the user picked up the photo, to create a "swinging" effect as the photo is dragged.there was an AS2 workaround floating around, but I want to find the AS3 equivalent, and seem to be unable to find it in the Geom/Matrix package/classes.

View 3 Replies

Professional :: Centering Registration And Transformation Point?

Mar 15, 2010

This is giving me such a headache.I have a movie clip and it has a centered registration point but the transformation point is in the top left corner. I want both to be in the center of the MC. I want a little circle with cross-hairs in t in the middle of my MC, if at all possible without moving my MC. But I cannot get that damn cross-hair to budge from the top left corner! When I go into the info window and change the X-Y values of the transformation point, the whole MC just moves to a new position. The infuriating things is, I've done it before but I just can't seem to work out what I did. Please don't tell me to drag the registration point in free transform mode. I can do that, but I cannot drag the transformation point in the same way.

View 9 Replies

ActionScript 3.0 :: Recalculate Point X / Y Value After Matrix Transformation

Jun 16, 2010

I am doing a matrix transformation on a Display Object. I got this function from another site, but basically it scales a display object around any point.
ActionScript Code:
public static function scaleAroundExternalPoint(m:Matrix, x:Number, y:Number, multiplier:Number):void{
m.translate(-x, -y);
m.scale(multiplier, multiplier);
m.translate(x, y);
}

But my problem is that I have to do multiple scales in a sequence and after scaling, the points defined in the XML no longer correspond. Let me first say that all the points being scaled around are located in an XML file. They are all relative to the display object's registration point (0,0) when it is normal, i.e. a scale of 1. Also, I have created a class that retains the target object's original Matrix so that the percentage you pass in is relative to the original scale instead of the scale after each call. But basically, with the scaleAroundExternalPoint function by itself, if I have an object that I scaled to twice it's size, the multiplier would be 2. but say I want it back to it's original size. The multiplier would NOT be 1 since that would just leave it at a scale of 2x. It would have to be .5. The important parts of the class are below.

ActionScript Code:
public function ZoomUIComponent(isKeyboardControlled:Boolean = false, disabledAlpha:Number = .25,
max:Number = 2, min:Number = .5, precision:uint = 2,
seconds:Number = 1, step:Number = .1):void{
this.disabledAlpha = disabledAlpha;
this.inControl = InteractiveObject(getChildByName("zoomIn"));
_isKeyboardControlled = isKeyboardControlled;
[Code] .....

It's retaining the original matrix and then calculating based on that EACH TIME. So how would I find the new X and Y values of the original points so that I can scale around them?

View 1 Replies

ActionScript 3.0 :: Set An Object's Transformation / Registration Point Not The IDE?

Jun 3, 2008

This is probably really trivial, but how do I set an object's ransformation/registration point in AS3, not the IDE?

View 12 Replies

ActionScript 2.0 :: FMX Rotate Symbol On Transformation Point

Nov 11, 2002

I have a triangular symbol that I want to rotate on a transformation point (the pointy tip). The effect is supposed to be like Hollywood searchlights panning around (see pic below). I've done basic rotations with actionscript before, but a transformation point wasn't involved. How is this done? Is the transformation point determined manually on the stage or with actionscript?

View 1 Replies

ActionScript 3.0 :: Senocular Transformation Tool - Registration Point

Jun 27, 2010

I am fiddling around with Senocular's Transformation Tool classes, which allow for a MovieClip to be transformed (rotated, resized, skewed, etc) upon click. Just one tiny problem. I need for the MovieClip registration point to always be centered, so that when I do begin transforming in any way, it transforms from that centered registration point. Here is a picture - I need this done in As3 rather than simply creating a new MovieClip symbol and selecting the center for its registration point, as these pictures are loaded dynamically.

View 6 Replies

Move The Origin Point Of A MovieClip In Adobe Flash CS3?

Sep 2, 2010

How do I move the origin point, or zero point, of a MovieClip to the same origin point of the stage without scripting in Adobe Flash CS3?

Example: While I'm trying to move objects within a MovieClip, the origin point is at (stage) 200,-300. This means that when I put objects in a MovieClip, the objects' X,Y coordinates, as displayed in properties, are off by that much.

This point is way off the edge of the stage and I'd like to move it back to the stage's origin point so that my X,Y coordinates are meaningful.

View 1 Replies

ActionScript 2.0 :: [Flash8] Move Back To The Origin Point

Oct 14, 2008

I tried to create simple animation from this Kirupa's tutorial My aim is to make a circle run from left to right and when it is almost to the edge it will move back to the origin point and it will loop only 3 times. So I came up with totally baby script like this:

[Code]...

But the MC is not move back to the original place. Sorry for not even finish the script for stop looping. Only tweak on play loop it make me very confused. My knowledge is quite in entry level but I eager to learn. Could you let me know what is wrong with the script?

View 5 Replies

ActionScript 2.0 :: Objects Of Attraction - Towards The Mouse Cursor Within 100px And Return To It's Point Of Origin

Oct 29, 2006

How do I take Object_MC and have it attract towards the mouse cursor within 100px and return to it's point of origin when the mouse is 101px + away from the cursor, all while doing an "elastic" like recoil effect, and going from 50% alpha to 100% over that distance to the mouse?

View 1 Replies

Flex :: How To Know If Point Belong To Sprite

Mar 8, 2012

How can I know if a point is contained inside of an Sprite in Flex?

For example:
// My example point
var A:Point = new Point(5,5);
// My example sprite
var s:Sprite = new Sprite();
s.graphics.lineStyle(1,0x000000,1);
s.graphics.moveTo(0,0);
s.graphics.lineTo(100,100);

The point A belong to sprite s because its position is inside of it. Is there any function to know it? I want to do it for all kind of sprites, so use math formulas to calculate linear or quadratic equations (line, circle, rectangle, etc) is not valid for me.

View 1 Replies

ActionScript 3.0 :: Pan Sprite Which Changes Its Size And Registration Point?

Apr 26, 2009

i am succesfully panning an image so far with this code:

Code:
my_mc.addEventListener(Event.ENTER_FRAME, panMe);
function panMe(e:Event):void {

[code]....

View 10 Replies

Actionscript 3 :: Rotating A Sprite Around Its Center Point?

Aug 9, 2011

I searched online and found this script that is supposed to rotate and image but I'm not sure how to use, where to put in the degree angle that I want my sprites to rotate by. Also, I get an error. 1084: Syntax error: expecting identifier before leftparen. 1084: Syntax error: expecting rightparen before leftbrace.

var point:Point=new Point(spr_box.x+spr_box.width/2, spr_box.y+spr_box.height/2);
rotateAroundCenter(spr_box,45);
function rotateAroundCenter (ob:*, angleDegrees) {

[Cde].....

View 1 Replies

ActionScript 3.0 :: Change The Rotation Point Of A Sprite?

Feb 4, 2008

I'm attempting to write a racing game. I've loaded in my image, I brought it to the stage and now, all I want to do is rotate it from its' center and not upper left corner.

The code:

racer.rotation += 5;

rotates from the upper left corner. How do I rotate from the center of the car/sprite? I've tried putting it into a container but I'm unsure on the coordinates of the container because I tried to set the x,y coordinates to half the sprite image but y'know, it's not doing what I expect it to.

ActionScript Code:
if (arrowLeft) {
var container:Sprite = new Sprite();

[Code]....

I will never sneer at another racing game! I didn't think it would be this hard to do a simple rotate of an image!

View 3 Replies

ActionScript 3.0 :: Find Most Left And Top Right Point In A Sprite?

Aug 8, 2009

I once needed to pan a sprite full of movieClips (picture 1) which were draggable with no bounds so you could drag them up and left (higher than sprites registration point).

You could also drag them down and right and expand a sprite that way (as well) but that didnt matter.What did matter was how much is 'up' and 'left' from the sprite registration point so i can include that in my formula for panning.

This was easy to find, i just sorted my array of movieClips, sorted on x and sorted on y after each drag, and thats how i got my up and left points.

Now I am trying to do that same thing, exept my movieclips inside a sprite have a custom rotation (picture 2), so i also have an up and left point, except this time up and left are caused by rotations of movieClips inside a sprite... (and these are dragable as well with no bounds)

View 1 Replies

Actionscript 3 :: Setting Anchor Point Of Sprite To Middle?

Mar 29, 2012

I am generating sprites programatically like this:

this.food = new Sprite();
this.food.graphics.beginFill(0xFFFFFF);
this.food.graphics.drawRect(0, 0, 10, 10);
this.food.filters = [new GlowFilter(0xFF6699, .80, 5, 5, 2, 2, false, false)];
this.food.graphics.endFill();

[Code]...

I basically want the food sprite to spin slowly about its center, not its x and y value which is the top left corner of the sprite. How can I make the anchor the center of the sprite?

View 2 Replies

Actionscript 3.0 :: Sprite Instance Registration Point At Runtime?

Aug 30, 2009

I've looked over many forums and pages to sadly learn that you can not reset/change the registration point of a movieclip dynamically. Though I am curious if or how I could go about assigning the registration point to a sprite instance I create at runtime. To give you a more concrete example of what I'm doing:

I create an instance contentWindow in my code to be animated (a 300px by 200px rect with registration in the top left corner)I create a Sprite instance imageHolder in my code and add it as a child to contentWindow I then add various images to imageHolder through a Loader object referencing an XML file. imageHolder's top left corner is oriented to contentWindow's registration point. (Leaving me with an oddly oriented imageHolder if the contentWindow's registration is centered, and will only re-size from that origin) Since imageHolder will be switching out various sized images it would be much more aesthetic to have the sprite's registration point centered. So since as3 defaults it to top left shouldn't there be a way to alter it at instantiation of the sprite? Then I could set my contentWindow's registration to center and the empty sprite would center all content loaded into it?

View 1 Replies

Flex :: Converting Sprite To Bitmapdata With A Different Registration Point And Rotation

May 22, 2011

I'm trying to convert a Sprite that I have into BitmapData so I can perform some collision detection. There are a few things about the way the Sprites are used that is making this more difficult than I expected:

The Sprite itself is a container which holds another Sprite that actually has a box drawn in it. The inner Sprite is positioned negative half its width & height so that it can be rotated from the center via the container. The container may be rotated at any angle at any given time

So my approach thus far has been attempting to draw the outer Sprite onto a new BitmapData object with a Matrix to account for the difference. Whilst I can use a Matrix to make this work for one particular rotation angle, I cannot find a way to make it work for any rotation.

Here's what I'm doing to draw onto the new BitmapData:

var p:Product = getProduct(); // Product is the container with the inner sprite
var bounds:Rectangle = p.getBounds(stage);
var bd:BitmapData = new BitmapData(bounds.width, bounds.height, true, 0x00FFFFFF);

[Code]....

Translating by the same amount as the previous example will no longer work here, and the box will still be cut off. I've looked around at some solutions posted before or suggestions from other people but they don't seem to work for me due to my container Sprite and rotation.

View 1 Replies

ActionScript 3.0 :: Change The Rotational/scale Point On A Object/sprite?

Jul 31, 2009

When you load a object through flash, you can set the rotational/scale point, but when you load it as a loader object or sprite, how do you change this point?

In this instance, I want to change the height of a sprite that is filled with a rectangle so that it shrinks down, not up.

Right now:

var colored_bar:Sprite = new Sprite();
with (colored_bar.graphics) {
beginFill(0x9e1819, 1);

[Code]....

The way I am doing it currently is moving the y position everytime I take away soem of the height, so it looks like it's moving down, but I'd think moving the orientation point at the beginning would be faster

View 2 Replies

ActionScript 3.0 :: SQL Row Insertion Error?

Nov 5, 2009

I use an AIR made program called sqliteadmin.I created a database called myDatabase.dbCreated a table like:CREATE TABLE cs (req TEXT, res TEXT);then trying to populate:INSERT INTO cs (req, res) VALUES('Hello', 'Hi'); // Error # 3115when executing this query

View 3 Replies

ActionScript 3.0 :: Generic Array Deletion & Insertion?

Jun 23, 2010

I was going through the options the generic Vector class offers to delete and/or insert items from/to an array, and it seems to me that the only way is by using the Splice method. For me, this method does a lot of work I dont utilize in my code (like creating a new array as a result etc.), hence
 
is there an optimized way how to delete a certain item from a vector, instead of calling myVector.splice(idItemToRemove,1) ?

View 1 Replies

ActionScript 3.0 :: Matrix Array Row/column Insertion?

Jan 13, 2011

I'm trying to make game like bubble spinner....I created a grid 2d array for this game... But got stuck at insertion of a new row/ column to the current matrix position.How to insert a row/ column to a matrix after its already created ie, if i have 2d array of size 4x4

[1] [2] [3] [4]
[5] [6] [7] [8]
[9] [1] [2] [3]
[4] [5] [6] [7]...

then i have to add a row like 0,0,0,0 to the 3 rd row and need the shift of 3rd row to 4th and 4th row to 5th.

ie,
[1] [2] [3] [4]
[5] [6] [7] [8]
[0] [0] [0] [0]
[9] [1] [2] [3]
[4] [5] [6] [7]

View 14 Replies

IDE :: 3D Transformation Of MovieClip In As2?

Feb 26, 2010

i am looking for script for movie Clip distortion and 3D transformation in action script 2.0

View 1 Replies

Actionscript 3 :: Class Extending Sprite - Set The Sprite's Width And Height Properties?

Mar 5, 2010

I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.

What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.

package {
import flash.display.*;
public class ScrollBar extends Sprite {[code].....

View 1 Replies







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