ajouter à une classe utilitaire si vous ne voulez pas ajouter une dépendance à fl.motion. *
/**
* Rotates a matrix about a point defined inside the matrix's transformation space.
* This can be used to rotate a movie clip around a transformation point inside itself.
*
* @param m A Matrix instance.
*
* @param x The x coordinate of the point.
*
* @param y The y coordinate of the point.
*
* @param angleDegrees The angle of rotation in degrees.
* @playerversion Flash 9.0.28.0
* @langversion 3.0
* @keyword Matrix, Copy Motion as ActionScript
* @see flash.geom.Matrix
*/
public static function rotateAroundInternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void
{
var point:Point = new Point(x, y);
point = m.transformPoint(point);
m.tx -= point.x;
m.ty -= point.y;
m.rotate(angleDegrees*(Math.PI/180));
m.tx += point.x;
m.ty += point.y;
}
/**
* Rotates a matrix about a point defined outside the matrix's transformation space.
* This can be used to rotate a movie clip around a transformation point in its parent.
*
* @param m A Matrix instance.
*
* @param x The x coordinate of the point.
*
* @param y The y coordinate of the point.
*
* @param angleDegrees The angle of rotation in degrees.
* @playerversion Flash 9.0.28.0
* @langversion 3.0
* @keyword Matrix, Copy Motion as ActionScript
* @see flash.geom.Matrix
*/
public static function rotateAroundExternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void
{
m.tx -= x;
m.ty -= y;
m.rotate(angleDegrees*(Math.PI/180));
m.tx += x;
m.ty += y;
}
Ils sont rotateAroundInternalPoint() de MatrixTransformer et rotateAroundExternalPoint()
Ce serait pour 2d. Pour 3d voir transformAround.
N'oubliez pas de vérifier si les frères et sœurs de mise en page sont mis à jour correctement ou non.
HTH
pourriez-vous donner un exemple mxml simple avec une toile ou un groupe? – Rella
2D ou 3D? Jetez un oeil à Flex4Cookbook (http://books.google.co.uk/books?id=sJl-nUYdZjgC&pg=PA102&lpg=PA102&dq=flex+transformAround+sample&source=bl&ots=OnHH9WkZ93&sig=TxPXU2hTHivqgNtL_PJAInz4-9M&hl=fr&ei=l1cwTMXHB9OQjAeJl8SWBg&sa=X&oi= book_result & ct = résultat & resnum = 6 & ved = 0CDAQ6AEwBQ # v = une page & q & f = false) et cette vidéo devnet: http://graphics-geek.blogspot.com/2009/08/video-transform-effects-in-flex-4.html –