Results are out! Find what you need...fast. Get quick advice or join the chat
Hey there Sign in to join this conversationNew here? Join for free

SIMPLE Actionscript 3 error in Flash - Please help...

This thread is sponsored by:
Announcements Posted on
One quick question - from of our list, who would you most like to see on TSR doing a Q&A? 23-09-2014
Complete this short survey for a chance to win an iPad mini! 22-09-2014
    • Thread Starter
    • 3 followers
    Offline

    ReputationRep:
    I have an error with my flash actionscript, can someone please please help me.

    Thanks

    Code:
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
        function onEnterFrame(event:Event):void {
     
        // ANIMATED EQ BARS CODE
        eqLeft1.gotoAndStop (Math.round(my_channel.leftPeak * 9) ); // 10 is the amount of frames in our EQbar clips
        eqRight1.gotoAndStop (Math.round(my_channel.rightPeak * 11) ); // 10 is the amount of frames in our EQbar clips
        eqLeft2.gotoAndStop (Math.round(my_channel.leftPeak * 16) ); // 10 is the amount of frames in our EQbar clips
    And this is the error generated -

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mp3_fla::MainTimeline/onEnterFrame()[mp3_fla.MainTimeline::frame1:94]
    Any help would be appreciated thanks
    • 0 followers
    Offline

    ReputationRep:
    Hi,

    I haven't touched As3 in a while but here goes:
    This error means that one of the references to an object inside that method (eqLeft1, my_channel etc) doesn't exist.
    In flash, if a movieclip hasn't been instantiated (possibly due to being inside another movieclip, on say, frame 5) then the reference to it will return null if it hasn't reached frame 5 yet.
    It is also possible you haven't correctly 'targeted' one of those objects or the frame.

    I'm sorry i can't help more without more information.

Reply

Submit reply

Register

Thanks for posting! You just need to create an account in order to submit the post
  1. this can't be left blank
    that username has been taken, please choose another Forgotten your password?
  2. this can't be left blank
    this email is already registered. Forgotten your password?
  3. this can't be left blank

    6 characters or longer with both numbers and letters is safer

  4. this can't be left empty
    your full birthday is required
  1. By joining you agree to our Ts and Cs, privacy policy and site rules

  2. Slide to join now Processing…

Updated: April 23, 2012
New on TSR

TSR Freshers' blogs 2014

Read what TSR's freshers have to say as they head off to uni

Article updates
Useful resources
Reputation gems:
You get these gems as you gain rep from other members for making good contributions and giving helpful advice.