How to fix 'TypeError: Error #1009' error in ActionScript3.0 Adobe AnimateHow do I get my Flash CS4 buttons to direct the user to another URL?Flash Buttons Don't Work: TypeError: Error #1009: Cannot access a property or method of a null object referenceMoving objects with TimerIs it possible to load a non-Document Class before preloader starts?Actionscript 3 button is using previous codeError loading Audio file from Library using LinkageAdd/Remove Event Listener to/from child Movie Clip in AS3Removing movieclip in timeline - really gone?Game Character - ArgumentError: Error #2109AS3 My code delay doesn't work properly

Extrapolation v. Interpolation

Why are there not any MRI machines available in Interstellar?

Spoken encryption

Film where a boy turns into a princess

Can I pay with HKD in Macau or Shenzhen?

What exactly makes a General Products hull nearly indestructible?

how to add 1 milliseconds on a datetime string?

Why is the return type for ftell not fpos_t?

How to write a sincerely religious protagonist without preaching or affirming or judging their worldview?

How do professional electronic musicians/sound engineers combat listening fatigue?

What is the meaning of "a thinly disguised price"?

The seven story archetypes. Are they truly all of them?

Sitecore Powershell extensions module compatibility with Sitecore 9.2

Company requiring me to let them review research from before I was hired

What do I do when a student working in my lab "ghosts" me?

Can GPL and BSD licensed applications be used for government work?

Invert Some Switches on a Switchboard

Grid/table with lots of buttons

Which creatures count as green creatures?

Why did modems have speakers?

I can't understand how 'static' works exactly

How may I shorten this shell script?

What would be the side effects on the life of a person becoming indestructible?

Other than a swing wing, what types of variable geometry have flown?



How to fix 'TypeError: Error #1009' error in ActionScript3.0 Adobe Animate


How do I get my Flash CS4 buttons to direct the user to another URL?Flash Buttons Don't Work: TypeError: Error #1009: Cannot access a property or method of a null object referenceMoving objects with TimerIs it possible to load a non-Document Class before preloader starts?Actionscript 3 button is using previous codeError loading Audio file from Library using LinkageAdd/Remove Event Listener to/from child Movie Clip in AS3Removing movieclip in timeline - really gone?Game Character - ArgumentError: Error #2109AS3 My code delay doesn't work properly






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I'm setting up a button on the first frame which when clicked will transfer the user to the 2nd frame using this code:



 stop();

Btn_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

gotoAndPlay(2);



and on the second frame, I set up a dynamic text that will perform a countdown using this code:



 var myTimer:Timer = new Timer(1000,60); // every second for 60 seconds
myTimer.addEventListener(TimerEvent.TIMER, onTimer);
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);
myTimer.start();

function onTimer(e: TimerEvent):void
countdown_text.text = String(myTimer.repeatCount - myTimer.currentCount);



function onComplete(e: TimerEvent):void
gotoAndStop(3);



the thing is keep getting TypeError: Error #1009 message after debugging it. I know the fault is in line 7 of the 2nd code but I have no idea what is wrong with it. Pls help!










share|improve this question

















  • 1





    Have you defined countdown_text? Error 1009 is referred about a null object, so if countdown_text is null you can't access to its properties (i.e. text)

    – Joe Taras
    Mar 27 at 8:57

















-1















I'm setting up a button on the first frame which when clicked will transfer the user to the 2nd frame using this code:



 stop();

Btn_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

gotoAndPlay(2);



and on the second frame, I set up a dynamic text that will perform a countdown using this code:



 var myTimer:Timer = new Timer(1000,60); // every second for 60 seconds
myTimer.addEventListener(TimerEvent.TIMER, onTimer);
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);
myTimer.start();

function onTimer(e: TimerEvent):void
countdown_text.text = String(myTimer.repeatCount - myTimer.currentCount);



function onComplete(e: TimerEvent):void
gotoAndStop(3);



the thing is keep getting TypeError: Error #1009 message after debugging it. I know the fault is in line 7 of the 2nd code but I have no idea what is wrong with it. Pls help!










share|improve this question

















  • 1





    Have you defined countdown_text? Error 1009 is referred about a null object, so if countdown_text is null you can't access to its properties (i.e. text)

    – Joe Taras
    Mar 27 at 8:57













-1












-1








-1








I'm setting up a button on the first frame which when clicked will transfer the user to the 2nd frame using this code:



 stop();

Btn_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

gotoAndPlay(2);



and on the second frame, I set up a dynamic text that will perform a countdown using this code:



 var myTimer:Timer = new Timer(1000,60); // every second for 60 seconds
myTimer.addEventListener(TimerEvent.TIMER, onTimer);
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);
myTimer.start();

function onTimer(e: TimerEvent):void
countdown_text.text = String(myTimer.repeatCount - myTimer.currentCount);



function onComplete(e: TimerEvent):void
gotoAndStop(3);



the thing is keep getting TypeError: Error #1009 message after debugging it. I know the fault is in line 7 of the 2nd code but I have no idea what is wrong with it. Pls help!










share|improve this question














I'm setting up a button on the first frame which when clicked will transfer the user to the 2nd frame using this code:



 stop();

Btn_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

gotoAndPlay(2);



and on the second frame, I set up a dynamic text that will perform a countdown using this code:



 var myTimer:Timer = new Timer(1000,60); // every second for 60 seconds
myTimer.addEventListener(TimerEvent.TIMER, onTimer);
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);
myTimer.start();

function onTimer(e: TimerEvent):void
countdown_text.text = String(myTimer.repeatCount - myTimer.currentCount);



function onComplete(e: TimerEvent):void
gotoAndStop(3);



the thing is keep getting TypeError: Error #1009 message after debugging it. I know the fault is in line 7 of the 2nd code but I have no idea what is wrong with it. Pls help!







actionscript-3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 15:24









mafiq1102mafiq1102

11 bronze badge




11 bronze badge







  • 1





    Have you defined countdown_text? Error 1009 is referred about a null object, so if countdown_text is null you can't access to its properties (i.e. text)

    – Joe Taras
    Mar 27 at 8:57












  • 1





    Have you defined countdown_text? Error 1009 is referred about a null object, so if countdown_text is null you can't access to its properties (i.e. text)

    – Joe Taras
    Mar 27 at 8:57







1




1





Have you defined countdown_text? Error 1009 is referred about a null object, so if countdown_text is null you can't access to its properties (i.e. text)

– Joe Taras
Mar 27 at 8:57





Have you defined countdown_text? Error 1009 is referred about a null object, so if countdown_text is null you can't access to its properties (i.e. text)

– Joe Taras
Mar 27 at 8:57












1 Answer
1






active

oldest

votes


















0














I should see your source fla, but it is most likely related to countdown_text not being accessible in that frame. Error description is "Cannot access a property or method of a null object reference", that means it cannot find the reference which is "countdown_text".
It is very very bad practice to write AS directly in frames. Convert code into a class and assign it as a document class.
You can find Adobe documentation for document class here: https://helpx.adobe.com/animate/using/actionscript-publish-settings.html






share|improve this answer























  • It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

    – user1234567
    Apr 2 at 7:24











  • True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

    – PippoApps.com
    Apr 2 at 11:28











  • I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

    – user1234567
    Apr 2 at 12:05










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360759%2fhow-to-fix-typeerror-error-1009-error-in-actionscript3-0-adobe-animate%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I should see your source fla, but it is most likely related to countdown_text not being accessible in that frame. Error description is "Cannot access a property or method of a null object reference", that means it cannot find the reference which is "countdown_text".
It is very very bad practice to write AS directly in frames. Convert code into a class and assign it as a document class.
You can find Adobe documentation for document class here: https://helpx.adobe.com/animate/using/actionscript-publish-settings.html






share|improve this answer























  • It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

    – user1234567
    Apr 2 at 7:24











  • True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

    – PippoApps.com
    Apr 2 at 11:28











  • I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

    – user1234567
    Apr 2 at 12:05















0














I should see your source fla, but it is most likely related to countdown_text not being accessible in that frame. Error description is "Cannot access a property or method of a null object reference", that means it cannot find the reference which is "countdown_text".
It is very very bad practice to write AS directly in frames. Convert code into a class and assign it as a document class.
You can find Adobe documentation for document class here: https://helpx.adobe.com/animate/using/actionscript-publish-settings.html






share|improve this answer























  • It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

    – user1234567
    Apr 2 at 7:24











  • True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

    – PippoApps.com
    Apr 2 at 11:28











  • I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

    – user1234567
    Apr 2 at 12:05













0












0








0







I should see your source fla, but it is most likely related to countdown_text not being accessible in that frame. Error description is "Cannot access a property or method of a null object reference", that means it cannot find the reference which is "countdown_text".
It is very very bad practice to write AS directly in frames. Convert code into a class and assign it as a document class.
You can find Adobe documentation for document class here: https://helpx.adobe.com/animate/using/actionscript-publish-settings.html






share|improve this answer













I should see your source fla, but it is most likely related to countdown_text not being accessible in that frame. Error description is "Cannot access a property or method of a null object reference", that means it cannot find the reference which is "countdown_text".
It is very very bad practice to write AS directly in frames. Convert code into a class and assign it as a document class.
You can find Adobe documentation for document class here: https://helpx.adobe.com/animate/using/actionscript-publish-settings.html







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 2 at 7:08









PippoApps.comPippoApps.com

4813 silver badges16 bronze badges




4813 silver badges16 bronze badges












  • It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

    – user1234567
    Apr 2 at 7:24











  • True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

    – PippoApps.com
    Apr 2 at 11:28











  • I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

    – user1234567
    Apr 2 at 12:05

















  • It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

    – user1234567
    Apr 2 at 7:24











  • True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

    – PippoApps.com
    Apr 2 at 11:28











  • I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

    – user1234567
    Apr 2 at 12:05
















It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

– user1234567
Apr 2 at 7:24





It is not necessarily bad practice. For some simple and straightforward application, there is absolutely no need to go the extreme of writing everything in classes. Best practices only go as far as it serves you.

– user1234567
Apr 2 at 7:24













True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

– PippoApps.com
Apr 2 at 11:28





True, although this doesn't seem the case at all to me. A real pitfall, re-instanciating timers whever playhead goes on frame 2. Plus, it seems the user will benefit from understanding the use a document class, that would make what he is trying to do much simpler and bug free. He probably wounldn't even have to post a question here with some cleaner code.

– PippoApps.com
Apr 2 at 11:28













I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

– user1234567
Apr 2 at 12:05





I think it really boils down to how complex the project is. For simple page by page application OP is doing, the amount of time saved and the reduced complexity of using timeline far outweighs the small memory setbacks like re-instantiating a timer. I too am in favor of using classes, but sometimes a ugly solution is smaller and more understandable. I get where you are coming from though.

– user1234567
Apr 2 at 12:05








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360759%2fhow-to-fix-typeerror-error-1009-error-in-actionscript3-0-adobe-animate%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해