How to change the dynamic registration point or rotate any DisplayObject by its Center?

The Rotations3DUtility is written by myselft for any DisplayObject to rotate in its horizontal center, but the effect is not perfect, can someone tell me how to do this?

Thank you!

package com.howall.utility

{

import flash.display.DisplayObject;

import flash.events.Event;

import flash.events.TimerEvent;

import flash.utils.Timer;

public class Rotation3DUtility

     {

Public static const FIRST_END:String = "firstEnd";

public static const END: String = "end";

private static var: timer;

time1:Number private static var;

time2:Number private static var;

fontRotation:Boolean private static var;

private static var target: DisplayObject;

private static var int count = 10;

public static rotationByY(t:DisplayObject,_t1:Number,_t2:Number):void

          {

timer = new timer (t1, count);

               target = t;

               time1 = t1;

               time2 = t2;

timer.addEventListener (TimerEvent.TIMER, onTimer);

timer.addEventListener (TimerEvent.TIMER_COMPLETE, timerEnd);

timer.start ();

          }

private static onTimer(event:TimerEvent):void {}

if (target.rotationY! = - 108) {}

{if(!fontRotation)}

target.rotationY += 72/count;

target.x += target.width/count * 2;

                    } else {}

target.rotationY += 108/count;

target.x = target.width/count * 2;

                    }

               } else {}

fontRotation = true;

target.rotationY += 108/count;

target.x = target.width/count * 2;                    

               }

          }

private static timerEnd(event:TimerEvent):void {}

if (Math.round (target.rotationY) == 72) {}

target.rotationY = - 108;

timer.repeatCount = 10;

timer.delay = 2;

timer.reset ();

timer.start ();

target.dispatchEvent (new Event (FIRST_END));

               } else {}

target.rotationY = 0;

fontRotation = false;

timer.stop ();

timer.removeEventListener (TimerEvent.TIMER, onTimer);

timer.removeEventListener (TimerEvent.TIMER_COMPLETE, timerEnd);          

timer = null;

target.dispatchEvent (new Event (END));

target = null;

               }

          }

     }

}

We can change the registration point of

1. change the position of the content of the display of the object (using the getChildAt() method).

2. with the help of matrix operations (method of transformation point).

[For the first example is attached]

You can also use matrix operations to transform any display object

The transformations of thease include:

Translation (change in position of the display object).

  1. Rotation (rotation of the object at an angle of view)
  2. Tilt (by changing the inclination of the display object)
  3. Scale (change of height and width of the display object)

For more information read the help on the Matrix class.

Tags: Adobe Animate

Similar Questions

  • How to change the alignment movieclip point in time...

    I want to change the registration point of my movieclip which is an image at the click of mouse position please suggest me what I can do.

    I use this Actionscript code for which is also made of ZoomIn and zoom to the image movieclip.

    package {}

    import flash.display.Sprite;

    SerializableAttribute public class Main extends Sprite {}

    public var imgW:Number = 0;

    public var imgH:Number = 0;

    public void Main() {}

    the constructor code

    imgW = IMG_MC.width;

    imgH = IMG_MC.height;

    IN_BTN.addEventListener (MouseEvent.Click, zoomIn);

    IN_BTN.addEventListener (MouseEvent.ROLL_OVER, zoomInOver);

    IN_BTN.addEventListener (MouseEvent.ROLL_OUT, zoomInOut);

    OUT_BTN.addEventListener (MouseEvent.Click, zoomOut);

    OUT_BTN.addEventListener (MouseEvent.ROLL_OVER, zoomOutOver);

    OUT_BTN.addEventListener (MouseEvent.ROLL_OUT, zoomOutOut);

    }

    private void zoomIn(event:MouseEvent):void {}

    If (IMG_MC. < 800 width) {}

    IMG_MC. Width = IMG_MC.width + (imgW * 0.10);

    IMG_MC. Height = IMG_MC.height + (imgH * 0.10);

    }

    }

    private void zoomInOver(event:MouseEvent):void {}

    IN_BTN.Alpha = 0.5;

    }

    private void zoomInOut(event:MouseEvent):void {}

    IN_BTN.Alpha = 1.0;

    }

    private void zoomOutOver(event:MouseEvent):void {}

    OUT_BTN.Alpha = 0.5;

    }

    private void zoomOutOut(event:MouseEvent):void {}

    OUT_BTN.Alpha = 1.0;

    }

    private void zoomOut(event:MouseEvent):void {}

    If (IMG_MC. Width > imgW) {}

    IMG_MC. Width = IMG_MC.width - (imgW * 0.10);

    IMG_MC. Height = IMG_MC.height - (imgH * 0.10);

    }

    }

    }

    }

    Thank you in advance.

    This is not going to work.  This person is doing nothing more that move a displayobject.

    This can be used where the x's are compared to the chronology of the displayobject:

    function changeRegPtF(dobj:DisplayObjectContainer,x:Number,y:Number):void {}

    var r: Rectangle = dobj.getRect (dobj);

    for (var i: int = 0; i

    dobj.getChildAt (i) .x-= r.x + x;

    dobj.getChildAt (i) there = r.y + y;

    }

    dobj.x += r.x + x;

    dobj.y += r.y + y;

    }

  • How to change the style of point of the last lot on multiplot XY graph programmatically?

    Hi all

    I have a multiplot XY Chart.  I want to change the style of the last plot point by program.  Any way to do it?  I tried and it looks like only the first property parcel is changeable by program.

    Thanks for any help.

    Anne

    ergwser wrote:

    Hi all

    I have a multiplot XY Chart.  I want to change the style of the last plot point by program.  Any way to do it?  I tried and it looks like only the first property parcel is changeable by program.

    Thanks for any help.

    Anne

    Nodes property can be resized by dragging down on them.

    resize the property node you re using and use a "Conspiracy Active" property to set the index of the plot of the plot you wan to act on.

    Also note that property nodes are running up and down, so the "active conspiracy" must be above the property where you specify the point style.

    Ben

  • How to change the HDD in Tecra R10 - 10W - any instructions?

    I would like to install windows 7 on my laptop R10 - 10W, but for now only for test.
    I would like to save my current installation of Windows XP on my HARD drive.

    The simplest solution is to change HARD drive but this laptop has no available HARD disk. :-(

    I tried to boot from the HARD drive connected via esata, but it is not functional. :-(

    Anyone have an idea?

    Thanks Karel

    > More simple solution is to change the HARD drive, but this laptop has no available HARD disk
    What do you mean by inaccessible HARD drive?

    If you want to install the Windows 7 only for the test then you don t have need to change the HARD disk or delete the Win XP from the HARD drive.

    One solution might be to an installation of Win 7 on the second partition.
    Create a partition on the HARD drive using a 3rd party like Partition Magic 8 tool. This great tool and allows you to create and manage the partition.

    Another option would be the use of virtualization.
    You know the Virtual PC?
    http://www.Microsoft.com/Windows/Virtual-PC/

    It helps you to install each operating system that you want on the HARD disk without having all partitions.

  • How to change the JNDI dynamically in the adaptor DB and adapter FTP

    Hello world

    Please someone explain ' how to change JNDI dynamically in the adapter adapter FTP and DB ' with screenshots


    Thanks in advance

    YES, very possible. Only with the CRUD on a table is possible.
    Please see the below URL, where you can admire the multiple check box enabled under "Perform an operation on a table" depending on the Type of operation.

    http://docs.Oracle.com/CD/E23943_01/integration.1111/e10231/adptr_db.htm#BDCGADFJ

    (* 7) give points - this is the right label to reward an answering machine (5 - useful; 10 - correct) points for their position if they meet your concerne.*

    Go on, please raise it as a separate thread. While people will get benefited.

    Thank you
    Vijay

  • How to change the color of the Apple Watch pointer?

    How to change the color of the Apple Watch pointer? In the style of color Apple Watch ca change you the color of the masince, complication, brands, etc. However, the needle of the hours and minutes remains white and red dark second pointer. Is there a way to set the pointers to become Gold?

    Hello

    It is not currently possible to customize the color of the hand or the second on the color dial hand.

    If a customization option is not specified for any feature of any particular face watch, then it cannot be customized.

    More information:

    https://help.Apple.com/watch/#/apd6ce85daf4

  • How to change the background color dynamically on the page of the ofa

    How to change the background color dynamically on the page of the ofa

    Hello

    Can you please let me know the dynamic conditions to change the background color?

    Thank you

    Vincent

  • How to change the Point of guide to InDesign

    Hi all

    How to change the reference Point InDesign using InDesign CS3/Javascript/Windows.

    Kind regards

    REDA

    Hey!

    Try this:

    app.activeWindow.transformReferencePoint = AnchorPoint.BOTTOM_RIGHT_ANCHOR;
    

    Values:

    AnchorPoint.BOTTOM_CENTER_ANCHOR
    AnchorPoint.BOTTOM_LEFT_ANCHOR
    AnchorPoint.BOTTOM_RIGHT_ANCHOR
    AnchorPoint.CENTER_ANCHOR
    AnchorPoint.LEFT_CENTER_ANCHOR
    AnchorPoint.RIGHT_CENTER_ANCHOR
    AnchorPoint.TOP_CENTER_ANCHOR
    AnchorPoint.TOP_LEFT_ANCHOR
    AnchorPoint.TOP_RIGHT_ANCHOR
    

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • How to change the size of font IR (only) dynamically

    Hello

    On the http://www.danielmcghan.us/2009/01/that-font-is-too-small.html blog, there was a great example of how to change the size of font IR on the fly.
    Some how seems that it does not have new reagent 25 theme, which is not having "td." If someone could help me.

    I would like to add a few record capacity in other tables (table user preferences)... Penny Please extend this example if possible.

    For this I did on the cloud Apex demo: FONT_SIZE_ADJ_APP

    http://Apex.Oracle.com/pls/Apex/f?p=2354

    Data connection:
    United Nations: guest_admin
    PWD: Qwertz123!

    THX in advance for your help.

    BRG,
    Damir

    The actual code Th example of work seems different from the blogpost

    Might want to try this code (in your page template)

    (-) Save / Reset (+)
    

    To save this in a table of custom user preferences:
    -You can change the application RETURN_NOTHING to insert/update process using the FONT_SIZE_ADJ element

    And add the calculation to set the value in FONT_SIZE_ADJ of the table for the first time user preferences when users login

  • How to change the display of a dynamic array limits?

    Hi people,

    I use DW CS4 and PHP. I have a php page with a dynamic array and the repeating region that I built for my client. This table lists our list any active member. Initially, I built the PivotTable to display records that only 50 to 300 + records because both made a long page. My client wants to now all records on a single page, because he does not like to click on through the first Recordset Paging - next - previous - last list to find who he is looking for. I tried to change the behaviour of repeat in all records (rather only 50) region, but it still shows that 50. I don't know that it is because initially when I set up the dynamic table, I limited to 50 it. Is there an easy way to change the dynamic array of 50 to all records, without rebuilding the whole page? I have looked in many places and cannot find a way to change this. Thanks for your help,

    Gail

    If the page in question is - apart from the table - not too complex, the probably simplest is to...

    (a) copy the table * code * to the Clipboard and paste it in, say, a simple text editor such as Notepad

    (b) to rename the current document to something else for backup purposes

    (c) create a new document and insert a simple recordset (must be named identically to allow an easy transition)

    (d) to paste the code in the table in here

  • Portege S100: How to change the RAID in the BIOS

    Change the BIOS setting for Portege S100 of JBOD to RAID0, I hit space on Exectute creation and enter the key of type string in the manual, and press "enter".
    Settings and then return to existing arrangements and not the new RAID0 configuration setting that I selected.

    I stayed in this part of the day / night looking at different positions, but I don't see anything wrong with the data entered.

    This is the same as that recorded in this link: -.
    [How to change the RAID configuration | http://aps2.toshiba-tro.de/kb0/TSB6901K60006R01.htm]

    I'm now at the end of my home, I just wanted to install new HDD WD and new installation of XP Pro, is - it too much to ask?

    Maybe it s a silly question but; have you installed the second HDD to the Ultra Slim Bay?
    The RAID did feature is available when a second HDDD is installed in Ultra Slim Bay.

    If the second HDD was inserted and then change the RAID in the Windows operating system.
    There should be a Toshiba RAID Console.
    You can use this console to create or manage a RAID array.

    To start the utility, click Start, point to all programs, point to Toshiba, RIAD-tap and click RAID console.
    It of possible to change the RAID1 (mirroring) of a configuration non-RAID (default).

    But note; When RAID1 is set, you cannot change your settings unless you completely restore your preinstalled software.

  • Satellite A200 - 23 X: how to change the app assigned to buttons on the touchpad

    Dear friends,
    I have the Toshiba A200 23 X with Vista.
    I installed the Synaptics pointing for the touchpad device. I assigned in the 3 buttons, 3 different possibilities for that when I touch each of these buttons to start the appropriate application.

    The question is how to change the applications that I assigned?

    The first time, before fix, when I touch for example, the first button, a small window appears asking to attach a request, the same happened with the rest buttons 2.
    But now I want to change these apps that I have attached to these buttons, I know no way th.

    If anyone can help please.

    Thank you very much

    Hello

    I think you can change the settings of touchpad button in the properties of the touchpad.
    You can find properties of * Panel-> mouse-> device (last tab)-> settings button settings *.

    There are a few options. You must choose the option called Dual mode
    You will find the area where new applications could be affected.

    Concerning

  • Pavilion 15-P290NO: how to change the function of the buttons behavior in Windows 10

    I just received my new laptop (a Pavilion 15-P290NO) the other day and installed Windows 10 top immediately. Now I can't figure out how to change the behavior of the function keys so that I won't have to press the fn key if I want for example to use f2 for other functions that turn down the brightness of the screen. Instead, I want him out if I for some reason any really want to turn down the brightness, I hold the fn and f2. At this point, I am open to almost any suggestions.

    Hello

    Shut down the laptop.  Tap away at the esc you key start Notepad to open the Start Menu.  Select the Bios ( f10 ) option, and then change the figure in the document at the following link.

    http://support.HP.com/us-en/document/c02035108

    Kind regards

    DP - K

  • How to change the size of taskbar buttons? I did everything that I've seen proposed in these pages, and nothing works.

    How to change the size of taskbar buttons?  I did everything that I've seen proposed in these pages, and nothing works.

    The buttons of programs open in the taskbar are tiny and square.  I want them to be of normal size (by default).  I have locked and unlocked the task bar.  I moved the "three vertical lines composed small points."  Nothing works.

    If you want to enlarge all the icons in the taskbar, and then increase the point size of buttons of legend to a larger number of advanced appearance settings.
    Follow these steps:

    1. click on start, Control Panel, personalization, window color and appearance.
    2. on the window color and appearance, click "Classic appearance open for more color options" (link below).
    3. in the box "Appearance settings", click on the button "Advanced".
    4. in the box "Advanced appearance" under "Item:" dropdown, choose "buttons".
    5 set your size
    6. click on the OK button.
    7 on the "Appearance settings" box, click on the button 'Aplly', wait.
    8. click the OK button if you are uncomfortable with the size to change, or just click on the "Advanced" button to set the size.

    I hope I could help

  • How to change the duration of the clip in Movie maker

    Im trying to use windows movie maker. does anyone know how to change the duration of the clip. I made a movie of my meetings previous families, but it is different duration time. I'm still doing, help menu does not explain.

    I tried different methods to change the time on the tag's options, but it does not change the duration of the clips

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Hi Rickysbiz,

    You can try to cut the clip and take a fresh start or endpoint for the clip to set the duration. The start trim point determines when the clip will start playing, and the end trim point determines when the clip stops in your project and final film.

    To trim a video clip

    1. If you are in the Storyboard view, click, and then on the timeline.

    2. in the timeline panel, click the clip you want to cut.

    3 use the controls to play under the preview monitor to find the point where you want to cut out the clip.

    4 follow these steps:

    ·        When the playback indicator is at the location where you want the video or audio clip selected in replay, clickClip and then click TrimBeginning.

    ·        When the playback indicator is at the location where you want the video or audio clip selected to stop playback, clickClip, and then click TrimEnd.

    You can access the link below to learn more about wrking with clips in Windows Movie maker.

    http://Windows.Microsoft.com/en-us/Windows-Vista/work-with-clips-in-Windows-Movie-Maker

    I hope this helps. Let us know the result.

    Thank you and best regards,

     

    Srinivas R

    Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for