As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Flash help (actionscript 3.0)

DissociaterDissociater Registered User regular
edited September 2009 in Help / Advice Forum
I hate actionscript 3.0 so much, it makes me want to puke blood.

I just want to make a simple friggin button that moves me to a new frame on the timeline. The only flash experience I have is with 2.0 and it was so easy, it would take maybe 2 minutes, but I've been at this for 3 hours and I have made no progress. Every tutorial I try doesn't work and gives me error messages.

I have a button on frame 1. Frame 1 is stopped.

I want to click the button and move to frame 2.

Why is this so hard?

Dissociater on

Posts

  • Options
    sYnistersYnister Registered User regular
    edited September 2009
    what command are you using? its been a few months since i tackled any AS3 but i believe the command is "goToAndStop ()"

    so in your case it would be goToAndStop (2);

    sYnister on
  • Options
    DissociaterDissociater Registered User regular
    edited September 2009
    It's insane. I've got this going now:
    page_flip.addEventListener(MouseEvent.CLICK, flip);

    function flip(evt:MouseEvent):void {
    gotoAndPlay(2);
    }

    Now what's happening is it's going to the reqested frame but repeating the following error message over and over until I kill the movie:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at CRSpage_fla::MainTimeline/onFrame()

    Dissociater on
  • Options
    NotYouNotYou Registered User regular
    edited September 2009
    you can't just put this code on the btn?

    on(release) {
    gotoAndStop(2)
    }


    ??

    NotYou on
  • Options
    DissociaterDissociater Registered User regular
    edited September 2009
    No, that's actionscrip 2.0. For some reason they wanted to make 3.0 significantly harder for people who don't have computer science degrees.

    Dissociater on
  • Options
    NotYouNotYou Registered User regular
    edited September 2009
    lame

    NotYou on
  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited September 2009
    It's insane. I've got this going now:
    page_flip.addEventListener(MouseEvent.CLICK, flip);

    function flip(evt:MouseEvent):void {
    gotoAndPlay(2);
    }

    Now what's happening is it's going to the reqested frame but repeating the following error message over and over until I kill the movie:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at CRSpage_fla::MainTimeline/onFrame()

    Looks like you have code on an onFrame() event handler that's trying to access a null property. It's amazing what actually reading your error logs can do for you.

    Your click event handler is fine, your other code is the problem.

    Jasconius on
  • Options
    DissociaterDissociater Registered User regular
    edited September 2009
    I'm reading the error logs but I don't know what they're telling me.

    It seems the problem is that I didn't carry over an image to frame two that was referenced in code that was in frame one.

    The stupid thing is that I didn't carry the code over to frame 2 either. So I don't get why the file is still accessing that code.

    Dissociater on
  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited September 2009
    I am unaware, but it sounds like you have a preference on your compilation set incorrectly. It's rare for something on Frame 1 to get magically lost on frame 2 unless you have an option on a non-default setting.

    Jasconius on
Sign In or Register to comment.