Highlighted

Error 1009

Explorer ,
Nov 05, 2019

Copy link to clipboard

Copied

I have built an app that calls up random movie clips from a bank of 24.  In the beginning it works great with no errors, etc.  After a few minutes, I get that dreaded 1009 error.  I have searched all of the Error 1009 entries and cannot find a relevant solution.

 

Here is my code and the error message.  The debug function shows that the error is in last line of code.  Thanks for any and all help!!

 

var totalb:uint = 24;

function playRandomMovieClipb():void

{

          this["Music_mcb" + Math.round(1 + Math.random() * (23))].gotoAndPlay(2);

}

 

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at RhythmBeeInternationalCompetitionApp1Measure_fla::MainTimeline/playRandomMovieClipb()[RhythmBeeInternationalCompetitionApp1Measure_fla.MainTimeline::frame256:18]

 

JC,

I did find an error in one of my movieclip instance names.  I had misnumbered so that the math that should call that movieclip could not find it because of my error in numbering.  I will leave the app running tonight to be sure it does not throw an error after that correction.

Thank you so much!!

TOPICS
ActionScript, Error

Views

220

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Error 1009

Explorer ,
Nov 05, 2019

Copy link to clipboard

Copied

I have built an app that calls up random movie clips from a bank of 24.  In the beginning it works great with no errors, etc.  After a few minutes, I get that dreaded 1009 error.  I have searched all of the Error 1009 entries and cannot find a relevant solution.

 

Here is my code and the error message.  The debug function shows that the error is in last line of code.  Thanks for any and all help!!

 

var totalb:uint = 24;

function playRandomMovieClipb():void

{

          this["Music_mcb" + Math.round(1 + Math.random() * (23))].gotoAndPlay(2);

}

 

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at RhythmBeeInternationalCompetitionApp1Measure_fla::MainTimeline/playRandomMovieClipb()[RhythmBeeInternationalCompetitionApp1Measure_fla.MainTimeline::frame256:18]

 

JC,

I did find an error in one of my movieclip instance names.  I had misnumbered so that the math that should call that movieclip could not find it because of my error in numbering.  I will leave the app running tonight to be sure it does not throw an error after that correction.

Thank you so much!!

TOPICS
ActionScript, Error

Views

221

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 05, 2019 0
Adobe Community Professional ,
Nov 05, 2019

Copy link to clipboard

Copied

Hi.

 

Please make sure that each Movie Clip instance you're trying to access with this code is in the correct frame when it's called.

 

Because maybe you're trying to call "Music_mcb12", for example, from frame 10, but the instance is actually in frame 12.

 

 

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2019 0
Explorer ,
Nov 05, 2019

Copy link to clipboard

Copied

Thank you for the reply!!

All 24 of the movie clips are loaded onto frame 1 and remain for the entire timeline (1050 frames).

 

The error does not happen all the time, so I have added a loop to the application to give it plenty of time to misbehave.   And the misbehaviour always happens in this frame (256) which is the first call from this bank of movieclips.  I am thinking it may be something with one particular movieclip that throws an error when it is called. 

 

I have checked instance spelling, caps, etc.  But I am going to check all of that again as soon as I click "post."  Is there something else that could be wrong with a movie clip that would cause this error?

Thanks again.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2019 0
Explorer ,
Nov 05, 2019

Copy link to clipboard

Copied

JC,

I did find an error in one of my movieclip instance names.  I had misnumbered so that the math that should call that movieclip could not find it because of my error in numbering.  I will leave the app running tonight to be sure it does not throw an error after that correction.

Thank you so much!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2019 2
Adobe Community Professional ,
Nov 05, 2019

Copy link to clipboard

Copied

Excellent! I'm glad you managed to solve it!

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 05, 2019 2
BuzzyToo LATEST
Explorer ,
Nov 07, 2019

Copy link to clipboard

Copied

The app was still running as it should after 12 hours.  I hereby pronounce that gremlin "dead."

 

Thanks for the guidance, JC.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 07, 2019 0