dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: back button help!

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    back button help!

    i followed my teacher's instruction but my back button in my flash game isnt working >.< its from CS5 can any one help?
    the error is
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Adrianti_tontowifinal_fla::MainTimeline/frame233()
    here is my .fla file
    http://www.sendspace.com/file/irgux1

  2. #2
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    It seems like everything works, but you needed to move the AS3 Frame on 233 to 234 to have the actions affect the object (backBtn) its looking for. I would also change the backPressed function to the below:

    function backPressed(evt:MouseEvent): void
    {
    gotoAndPlay("start");
    }

    If you are using the same backBtn, i would suggest creating a new layer for it, and using the same button for all three layers (credits, game, options).

    Also in frame 1, you don't need "stage.addChild(pointer);" you should delete that line, because the pointer is already on the stage, and once the backBtn worked it created duplicate pointers.
    Last edited by Steven FN; 03-10-2011 at 01:35 PM.

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