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

From C++ to PHP, debugging to webhosting; help and discussion about writing your latest program to running your website. NOT for help when your PC won't work.

Announcements Posted on
Enter our travel-writing competition for the chance to win a Nikon 1 J3 camera 20-05-2013
Sign in to Reply
  1. TinFish's Avatar
    • Peer Of The TSR Realm
    SIMPLE Actionscript 3 error in Flash - Please help...
    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. Ever_Dream's Avatar
    • Junior Member
    • Location: Newcastle Upon Tyne, UK
    • Posts: 35
    Re: SIMPLE Actionscript 3 error in Flash - Please help...
    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.
    Last edited by Ever_Dream; 23-04-2012 at 04:27.
Sign in to Reply
Share this discussion:  
Useful resources
Article updates
Moderators

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

Reputation gems:
The Reputation gems seen here indicate how well reputed the user is, red gem indicate negative reputation and green indicates a good rep.
Post rating score:
These scores show if a post has been positively or negatively rated by our members.