2011-03-16 40 views
0

我对于Blackberry Playbook的ActionScript 3.0开发非常新颖。1180:调用一个可能未定义的方法Point

我与Double Sided 3D Plane in FP10工作,我在与这个码的烦恼:

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(); 
     } 

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

+2

加进口flash.geom.Point到FlipCard.as可见为好,因为它不是在该类 – 2011-03-16 11:23:59

+0

能看得见你在平板电脑上调试?我在osx上遇到了问题。 – 2011-03-16 11:24:30

+0

@George:给出答案... – weltraumpirat 2011-03-16 11:24:51

回答

3

添加import flash.geom.PointFlipCard.as为好,因为它不是在该类

相关问题