我对BlackBerry Playbook的ActionScript 3.0开发非常新。

我正在与之合作 FP10中的双面3D平面 而且我对此代码有麻烦:

package
{
    import flash.display.Sprite;
    import flash.events.Event;

    public class FlipCard extends Sprite
    {
        private var myPaperSprite:PaperSprite;

        public function FlipCard()
        {
            super();
        }

        private function Flip():void 
        {
            /*
            Create a new PaperSprite:

            If your front and back faces already exist, you can pass them straight
            into the constructor, like so:

            myPaperSprite = new PaperSprite( myFrontMc, myBackMc );
            */

            myPaperSprite = new PaperSprite();

            /*
            Optionally specify a pivot point, in this example the centre is used
            (this is also the default so there is no need to set this normally).

            To pivot around the top left use:
            myPaperSprite.pivot = new Point(0,0);

            or for bottom right:
            myPaperSprite.pivot = new Point(1,1);

            and so on...
            */

            myPaperSprite.pivot = new Point(0.5,0.5);

线 myPaperSprite.pivot = new Point(0.5,0.5); 正在抛出以下错误:

1180: Call to a possibly undefined method Point.

枢轴成员的定义如下:

package
{
    import flash.display.DisplayObject;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.geom.Point;
    import flash.geom.Rectangle;

    public class PaperSprite extends Sprite
    {

        //___________________________________________________________
        //————————————————————————————————————————————— CLASS MEMBERS

        private static const POINT_A:Point = new Point(0,   0);
        private static const POINT_B:Point = new Point(100, 0);
        private static const POINT_C:Point = new Point(0, 100);

        private var _isFrontFacing:Boolean = true;
        private var _autoUpdate:Boolean = true;
        private var _pivot:Point = new Point(0.5,0.5);

        private var _front:DisplayObject;
        private var _back:DisplayObject;

        private var _p1:Point;
        private var _p2:Point;
        private var _p3:Point;

        //___________________________________________________________
        //————————————————————————————————————————— GETTERS + SETTERS

        /**
         * A Point Object used to determine the pivot, or registration point of the 
         * PaperSprite. The values should be between 0 and 1 and are relative to the 
         * dimensions of each face, 0 being far left (on the x axis) or top (y axis) 
         * and 1 being the far right (x axis) or bottom (y axis).
         * 
         * The default value is { x:0.5, y:0.5 } meaning that both faces will pivot
         * around their respective centres
         * 
         * Examples:
         * 
         * To pivot from the centre use: new Point( 0.5, 0.5 );
         * To pivot from the top left use: new Point( 0.0, 0.0 );
         * To Pivot from the bottom right use: new Point( 1.0, 1.0 );
         * 
         */

        public function get pivot():Point
        {
            return _pivot;
        }

        public function set pivot( value:Point ):void
        {
            _pivot = value;
            alignFaces();
        }

问题出在哪里?我究竟做错了什么?

有帮助吗?

解决方案

添加 import flash.geom.Pointflipcard.as 同样,在那堂课中看不到

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top