Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    1
    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
    Offline

    0
    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
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.

Updated: April 23, 2012
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Brexit voters: Do you stand by your vote?
    Useful resources
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Write a reply...
    Reply
    Hide
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.