Hey there! Sign in to join this conversationNew here? Join for free

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

Announcements Posted on
At uni? What do you think of the careers support? 12-02-2016
How proud of your uni are you? Take our survey for the chance to win a holiday! 09-02-2016
  1. 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
  2. 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
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Today on TSR

Find out who won!

TSR community awards 2015

Poll
Would you be influenced by unis giving flexible offers (so you can miss by a grade)?
Useful resources
Quick reply
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.