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;
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
add a comment |
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
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
add a comment |
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
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
actionscript-3
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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