Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Will Hogben webforumsuser@macromedia.com #1
SEVERE PROBLEM WITH TIMEOUTS! WARNING!
Wow, I am making a game, there is no money involved but it is for a contest. 1 week from the contest and almost 4,000 lines of code into it the game developes the problem of random crashes. Were it that the crashes were when a certain line of code executed it would have been easy to find, however after what seemed like YEARS I have isolated the problem by commenting out 1 line at a time. THIS WAS FREAKING DIFFICULT SINCE SOMETIMES IT TOOK THE GAME MORE THAN FIVE MINUTES TO CRASH > I SPEND 4 DAYS DOING THIS SO YOU DON'T HAVE TO! READ THIS!
The problem it seems is that 1 out of every 200 time a timeout is forgotten before the end of its handler has been reached it can cause the program to crash. 1 out of 200 times! This is a severe problem because it is so hard to find, and the way to fix it is to make sure that you have no code after the timeout("DAMN BUG").forget() line in the timeout's handler. THIS MAY NOT SEEM LIKE A PROBLEM IF YOU TEST IT BUT BELIEVE ME! EVENTUALLY IT WILL CRASH THE PROGRAM!
Will Hogben webforumsuser@macromedia.com Guest
-
Problem Report: Severe memory leak in Flash Player 9.0
Summary Flash player 9.0 is prone to a severe memory leak when playing SWF files produced by Captivate 1 containing full-motion recordings. ... -
A DotNet Severe Limitation ?
I believe I have found a severe limitation of DotNet, with respect to hosting Windows Form Controls in WebPages. It appears this is only possible... -
Severe Frustration!!!
OK, Please excuse the slightly angered tone of this post but I'm in serious trouble and overwhelmed by frustration. I work for a company... -
Uploading problem = weird warning (was: access denied problem.....)
Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the... -
severe instability issues in MX
I was wondering if I couldn't get a little help with getting MX working. I seem to have run into some serious issues (basically I can crash DW MX... -
Scott Southworth #2
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
I've seen this problem before as well. I stopped using timeouts because of
this -- it crashed multiple
apps I wrote until I stopped using them altogether. They can also screw up
the framerate of a movie
as well. There are a couple other weird bugs with them I couldn't even
really quantify but they
are defnitely broken.
-scott
"Will Hogben" <webforumsuser@macromedia.com> wrote in message
news:bnk6f1$f7d$1@forums.macromedia.com...contest. 1 week from the contest and almost 4,000 lines of code into it the> Wow, I am making a game, there is no money involved but it is for a
game developes the problem of random crashes. Were it that the crashes were
when a certain line of code executed it would have been easy to find,
however after what seemed like YEARS I have isolated the problem by
commenting out 1 line at a time. THIS WAS FREAKING DIFFICULT SINCE
SOMETIMES IT TOOK THE GAME MORE THAN FIVE MINUTES TO CRASH > I SPEND 4 DAYS
DOING THIS SO YOU DON'T HAVE TO! READ THIS!forgotten before the end of its handler has been reached it can cause the>
> The problem it seems is that 1 out of every 200 time a timeout is
program to crash. 1 out of 200 times! This is a severe problem because it
is so hard to find, and the way to fix it is to make sure that you have no
code after the timeout("DAMN BUG").forget() line in the timeout's handler.
THIS MAY NOT SEEM LIKE A PROBLEM IF YOU TEST IT BUT BELIEVE ME! EVENTUALLY
IT WILL CRASH THE PROGRAM!>
>
Scott Southworth Guest
-
Will Hogben webforumsuser@macromedia.com #3
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
so what do you use instead?
Will Hogben webforumsuser@macromedia.com Guest
-
Word of Mouth Productions #4
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
You can create your own timer objects using the milliseconds. I would
venture to say that you could probably duplicate most of the functions in
the timeout objects. Once the parent script is done and debugged it's the
kind of thing you should put into an external cast and into your xtras
folder so its accessible at all times.
--
Craig Wollman
Word of Mouth Productions
phone 212 724 8302
fax 212 724 8151
[url]www.wordofmouthpros.com[/url]
"Will Hogben" <webforumsuser@macromedia.com> wrote in message
news:bnmj9b$j7f$1@forums.macromedia.com...> so what do you use instead?
>
>
>
Word of Mouth Productions Guest
-
Will Hogben webforumsuser@macromedia.com #5
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
I don't have enough time before my project is due, could you give your timeout script in return for some graphics work? I am good @ 3D modelling and animating, + texturing.
Will Hogben webforumsuser@macromedia.com Guest
-
Word of Mouth Productions #6
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
I never said I have done it. I haven't used timeout objects as extensively
as you and haven't run into the bug. I still use them. But when I need a
timer with limited functionality I do create my own.
--
Craig Wollman
Word of Mouth Productions
phone 212 724 8302
fax 212 724 8151
[url]www.wordofmouthpros.com[/url]
"Will Hogben" <webforumsuser@macromedia.com> wrote in message
news:bnn099$aev$1@forums.macromedia.com...timeout script in return for some graphics work? I am good @ 3D modelling> I don't have enough time before my project is due, could you give your
and animating, + texturing.>
>
Word of Mouth Productions Guest
-
Robert Tweed #7
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
"Word of Mouth Productions" <lingoboy@spamershaveforcedmetofakethisname.com>
wrote in message news:bnnbbc$qt3$1@forums.macromedia.com...extensively> I never said I have done it. I haven't used timeout objects asAll you need is something like this in your frame script:> as you and haven't run into the bug. I still use them. But when I need a
> timer with limited functionality I do create my own.
property pTimeOutList
on enterFrame me
now = the milliseconds
repeat with i = count(pTimeoutList) down to 1
if( pTimeoutList[i][#timeout] >= now ) then
do pTimeoutList[i][#callback]
pTimeoutList.deleteAt( i )
end if
end repeat
end
on addTimeout me, howLong, callback
pTimoutList.add( [ #timeout: the milliseconds + howLong, #callback:
callback ] )
end
Note that this technique won't work very well if the frame rate of the movie
is very low and you are trying to time something not related to the display
(i.e., background sounds or something).
Also, to add a timeout, do:
sendSprite( -5, 1000, "callbackfunction()" )
This will call callbackfunction() after one second.
- Robert
Robert Tweed Guest
-
Word of Mouth Productions #8
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
That's a pretty basic timer. I was sort of assuming you'd want a
duplication of all of the functionality of a timeout object. But if you
just need a basic list of timers that make a call when timed out, then
Robert's is fine.
I tend to like to be able to have the option of starting and stopping my
timers without their reseting, and be able to accumulate the running time.
I also like to be able to trigger different events during the life of a
timer and in the past have sent a list of times into my custome timers with
a list of "callbacks" so I don't have to instantiate a bunch of timers.
This also allows me to encapsulate functionality and organize calls however
I want. I also like to be able to retrieve the current time of a timer,
it's status, etc.
As Robert pointed out, the disadvantage of doing this purely in Lingo is
that the variability of the current time of a timer that occurs when frame
rates are at a normal rate (1 to 30) may not be acceptable. The
milliseconds will be accurate enough but your trigger could be off by as
much as a second or more if your frame rate is low and there is a lot of
overhead in your frame (s).
--
Craig Wollman
Word of Mouth Productions
phone 212 724 8302
fax 212 724 8151
[url]www.wordofmouthpros.com[/url]
"Robert Tweed" <robertNOSPAM@killingmoon.com> wrote in message
news:bnngp4$3tu$1@forums.macromedia.com...<lingoboy@spamershaveforcedmetofakethisname.com>> "Word of Mouth Productions"a> wrote in message news:bnnbbc$qt3$1@forums.macromedia.com...> extensively> > I never said I have done it. I haven't used timeout objects as> > as you and haven't run into the bug. I still use them. But when I needmovie>> > timer with limited functionality I do create my own.
> All you need is something like this in your frame script:
>
> property pTimeOutList
>
> on enterFrame me
> now = the milliseconds
> repeat with i = count(pTimeoutList) down to 1
> if( pTimeoutList[i][#timeout] >= now ) then
> do pTimeoutList[i][#callback]
> pTimeoutList.deleteAt( i )
> end if
> end repeat
> end
>
> on addTimeout me, howLong, callback
> pTimoutList.add( [ #timeout: the milliseconds + howLong, #callback:
> callback ] )
> end
>
> Note that this technique won't work very well if the frame rate of thedisplay> is very low and you are trying to time something not related to the> (i.e., background sounds or something).
>
> Also, to add a timeout, do:
>
> sendSprite( -5, 1000, "callbackfunction()" )
>
> This will call callbackfunction() after one second.
>
> - Robert
>
>
Word of Mouth Productions Guest
-
Will Hogben webforumsuser@macromedia.com #9
Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!
Actually I found another way, in ym game there were LOADS of timeouts in parent scripts, now I have just one call a universal update fuction which goes through every parent script in the update_me_please list and calls its update command. Wiht just one the likely of a crash is really really low.
Will Hogben webforumsuser@macromedia.com Guest



Reply With Quote

