Flex - Move3D Effect



The Move3D class moves a target object in the x, y, and z dimensions. The x, y, and z property specifications of the Move3D effect specify the change in x, y, and z that should occur to the transform center around which the overall transform effect occurs.

Class declaration

Following is the declaration for spark.effects.Move3D class:

public class Move3D
   extends AnimateTransform3D

Public properties

S.N.Property & Description
1xBy : Number
Number of pixels by which to modify the x position of the target.
2xFrom : Number
Initial x position of the target, in pixels.
3xTo : Number
Final x, in pixels.
4yBy : Number
Number of pixels by which to modify the y position of the target.
5yFrom : Number
Initial y position of the target, in pixels.
6yTo : Number
Final y position of the target, in pixels.
7zBy : Number
Number of pixels by which to modify the z position of the target.
8zFrom : Number
Initial z position of the target.
9zTo : Number
Final z position of the target.

Public methods

S.N.Method & Description
1Move3D(target:Object = null)

Methods inherited

This class inherits methods from the following classes:

  • spark.effects.AnimateTransform3D

  • spark.effects.AnimateTransform

  • spark.effects.Animate

  • mx.effects.Effect

  • flash.events.EventDispatcher

  • Object

Flex Move3D Effect Example

Let us follow the following steps to check usage of Move3D Effect in a Flex application by creating a test application:

1Create a project with a name HelloWorld under a package com.tutorialspoint.client as explained in the Flex - Create Application chapter.
2Modify HelloWorld.mxml as explained below. Keep rest of the files unchanged.
3Compile and run the application to make sure business logic is working as per the requirements.

Following is the content of the modified mxml file src/com.tutorialspoint/HelloWorld.mxml.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   width="100%" height="100%" minWidth="500" minHeight="500"
   <fx:Style source="/com/tutorialspoint/client/Style.css"/>
         private function applyMoveProperties():void {
      <s:Move3D id="moveEffect" target="{imageFlex}" 
         xFrom="{imageFlex.x}" xBy="{Number(moveX.text)}" 
         yFrom="{imageFlex.y}" yBy="{Number(moveY.text)}" 
         zFrom="{imageFlex.z}" zBy="{Number(moveZ.text)}" />
   <s:BorderContainer width="630" height="480" id="mainContainer" 
      <s:VGroup width="100%" height="100%" gap="50" 
         horizontalAlign="center" verticalAlign="middle">
         <s:Label id="lblHeader" text="Effects Demonstration" 
            fontSize="40" color="0x777777" styleName="heading"/>
            <s:Panel id="move3DPanel" title="Using Move3D Effect" 
               width="500" height="300">
                  <s:HorizontalLayout  gap="10" verticalAlign="middle" 
               <s:VGroup top="10" left="15">
                  <s:HGroup verticalAlign="middle">
                     <s:Label text="Move By X:" width="70"/>
                     <s:TextInput id="moveX" text="50" width="50"/>
                  <s:HGroup verticalAlign="middle">
                     <s:Label text="Move By Y:" width="70"/>
                     <s:TextInput id="moveY" text="50" width="50"/>
                  <s:HGroup verticalAlign="middle">
                     <s:Label text="Move By Z:" width="70"/>
                     <s:TextInput id="moveZ" text="50" width="50"/>
                  <s:Button label="Apply Properties" 
               <s:Image id="imageFlex" 

Once you are ready with all the changes done, let us compile and run the application in normal mode as we did in Flex - Create Application chapter. If everything is fine with your application, this will produce following result: [ Try it online ]

Flex Move3D Effect