A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: TypeError: Error #1009 - Scroll Pane Component issue?

  1. #1
    Member
    Join Date
    Nov 2007
    Location
    Los Angeles, CA
    Posts
    32

    Question TypeError: Error #1009 - Scroll Pane Component issue?

    I am getting the following error message:

    "TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at fl.containers::ScrollPane/endDrag()"

    The problem occurs when I like this:

    1. I click a button on the Main Frame which takes me to frame #2
    2. I go back to the Main Frame and then come back to the frame #2
    3. When I go to Frame #2 I get the error message.



    I suspect the problem is occurring because I am not emptying the "scrollPane_1" component on exit. In the code below scrollPane_1 is a scroll pane component. This is occurring on all pages that I have the scroll pane on.

    Also the scroll pane component is on stage and has an instance name of "scrollPane_1"

    This is an Air for iOS file.

    Here's the code:


    __________________________________________________

    Actionscript Code:
    top();


    scrollPane_1.source= myText_1;
    scrollPane_1.setSize(600,585);

     
    //This is just button code and I suspect does not have any thing to do with the problem.
    bnt_home_1.addEventListener(MouseEvent.CLICK, bnt_Goto_home_1);

    function bnt_Goto_home_1(event:MouseEvent):void

    {

        gotoAndPlay("1");

    }

     

    bnt_home_schedule1.addEventListener(MouseEvent.CLICK,gotoSchedule_home 1);

    function gotoSchedule_home1(event:MouseEvent):void

    {

        gotoAndPlay("1","Main");

    }

     

    bnt_gotoThurs.addEventListener(MouseEvent.CLICK, gotoSchedule_thursday);

    function gotoSchedule_thursday(event:MouseEvent):void

    {

        gotoAndPlay("Thursday");

    }

     

    bnt_gotoFri.addEventListener(MouseEvent.CLICK, gotoSchedule_friday);

    function gotoSchedule_friday(event:MouseEvent):void

    {

        gotoAndPlay("Friday");

    }

    ________________

    Also, when I use "scrollPane_1.source= myText_1;" do I need to reset or clear the source when the user exits the page? Does this operate like a variable? If so, how do I do this?

    Any thoughts would be helpful.

    ______________________________

  2. #2
    Member
    Join Date
    Nov 2007
    Location
    Los Angeles, CA
    Posts
    32
    Through trial and error I have identified the source of the problem.

    When the "scrollDrag" property is checked in the Components Parameters panel I get the error

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at fl.containers::ScrollPane/endDrag()"


    Does anyone have any thoughts on how to avoid this error?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center