1 Replies - 1531 Views - Last Post: 09 August 2016 - 10:29 AM

#1 sawman   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 03-February 07

Getting error 1010 on a MovieClip already defined in class

Posted 08 August 2016 - 07:09 PM

I have a class (PatientView) that is associated with a MovieClip (PatientView). In the PatientView MovieClip there are other MovieClips which are given names inside the PatientView MovieClip. These MovieClips are also instantiated at the top of the PatientView class.



Example:

public var pvtopmc;



When it is time to add the PatientView MovieClip to the stage, the error 1010 fires on the first line that attempts to set properties for one of the MovieClips inside the PatientView MovieClip. Since the first movieclip is pvtopmc, the error is thrown on that MovieClip. I run a trace: trace("pvtopmc is: "+pvtopmc); just before the first line to set a property on pvtopmc and it traces as undefined. This is perplexing because I have many classes identical to this one in this program and they all work fine. So I guess my eyes are getting tired or something and I can't see what I'm screwing up.



here is the code:



package 
{
 import flash.display.*;
 import flash.events.*;

 public class PatientView extends MovieClip
 {
  public var PVScreen:Screen = Screen.mainScreen; // This represents the primary display not calculating task bar/Dock.
               // Display Objects within the bounds of the mainScreen can be
               // hidden under task bar/Dock. Use "visibleBounds" to place
               // display objects without being hidden under task bar/dock.
  public var PVBrowser;
  public var headtype:String = "FullHeader";
  public var title = "https://assistant-cert.emdeon.com/Patient/PatientView?Id=e5835162-39fa-4160-9b0a-203cff9bc b52";
  public var pagetype:String = "fullpage";
  public var pvtopmc;
  public var pvtabs;
  public var pvfooter;

  public function PatientView()
  {
   if(stage)
   {
    initPatientView();
   }
   else
   {
    addEventListener(Event.ADDED_TO_STAGE, initPatientView);
   }
  } // ----------------------------------------------------------------------------------------- ---------- End public constructor function PatientView().
  
  public function initPatientView(e:Event = null):void
  {
   // --- Main
   this.width = PADemo.resizeAsset(1024,PVScreen.visibleBounds.width,1024)-16;
   this.scaleY = this.scaleX;
   trace("PVScreen is: "+PVScreen);
   trace("pvtopmc is: "+pvtopmc);
   // --- Patient View Top
   pvtopmc.width = PADemo.resizeAsset(1024,PVScreen.visibleBounds.width,1024)-16;
   pvtopmc.scaleY = pvtopmc.scaleX;
   //pvtopmc.y = wqback.y;
   pvtopmc.x = PVScreen.visibleBounds.width - pvtopmc.width - 16;
   
   // --- Patient View Tabs
   pvtabs.stop();
   pvtabs.width = PADemo.resizeAsset(1024,PVScreen.visibleBounds.width,1024)-16;
   pvtabs.scaleY = pvtabs.scaleX;
   pvtabs.y = pvtopmc.y + pvtopmc.height;
   pvtabs.x = PVScreen.visibleBounds.width - pvtabs.width - 16;
   
   // --- Patient View Footer
   pvfooter.width = PADemo.resizeAsset(1024,PVScreen.visibleBounds.width,1024)-16;
   pvfooter.scaleY = pvfooter.scaleX;
   pvfooter.y = pvtabs.y + pvtabs.height;
   pvfooter.x = PVScreen.visibleBounds.width - pvfooter.width - 16
   
   PVBrowser = MovieClip(parent.parent.parent.parent);
   if(PVBrowser)
   {
    PVBrowser.scrollArea.update();
   }
  } // ----------------------------------------------------------------------------------------- ------------------ End public function initPatientView().

} // ========================================================================================= ============================= End public class PatientView{}.
} // ========================================================================================= ================================================== End package{}.




Thanks in advance for your help.

Is This A Good Question/Topic? 0
  • +

Replies To: Getting error 1010 on a MovieClip already defined in class

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2365
  • View blog
  • Posts: 7,219
  • Joined: 15-January 14

Re: Getting error 1010 on a MovieClip already defined in class

Posted 09 August 2016 - 10:29 AM

If anyone is wondering, it looks like error 1010 says this:

Quote

TypeError: Error #1010: A term is undefined and has no properties.


It doesn't look like you've defined anything. The pvtopmc, pvtabs, and pvfooter all look undefined. Where do you define those?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1