all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

clearInterval does not run the play();


clearInterval does not run the play(); borbolla
4/27/2005 12:00:00 AM
flash actionscript: Hi,

I just can't get why this is not working, I tried to do it in a new file and
works ok, but if using it in a used file does not work, any ideas ?

stop();

function ContinuePlaying(){
clearInterval(interID);
play();
};

interID = setInterval(ContinuePlaying, 5000);

The timeline stucks in the frame, never play the rest of the file, I have
tried changing variables names, order and nothing, could this be a Flash bug
or something ?

Thanks.
Re: clearInterval does not run the play(); Jeckyl
4/27/2005 12:00:00 AM
Well .. if it works in a new file, and doesn't work in some other file,
there is probably something in that other file that is stopping it from
working. You're only shown us the code that you already know works on its
own .. so what do you expect us to tell you? You really need to make
available the movie that this doesn't work in and tell us where in that
movie you are putting this script.

Also .. before you do, do some debugging by adding trace statements so you
can see if the code is even executing at all.
--
Jeckyl

Re: clearInterval does not run the play(); borbolla
4/27/2005 12:00:00 AM
Ok Jeckyl, let's just forget we have code in the file (I just commented
everything but this), I used trace to see if it's executing:

stop();

function ContinuePlaying(){
clearInterval(interID);
trace("Clears the interval")
play();
trace("It is supposed to play but it doesn't")
};

interID = setInterval(ContinuePlaying, 5000);

I got both messages in the debug, this is on frame 25 and the whole number of
frames used in the file is 50, but never passes from frame 25.

Any idea ?

Re: clearInterval does not run the play(); Flashkernel
4/27/2005 12:00:00 AM
The player may not be getting the reference of the timeline where the play();
Re: clearInterval does not run the play(); borbolla
4/27/2005 12:00:00 AM
I've already tried to use relative and absolute paths:

_root.maincontent.imgmain.play();
this.imgmain.play();

and still the same, got stuck and doesn't play the rest of the file

I'm getting frustrated with this, please someone....
Re: clearInterval does not run the play(); Flashkernel
4/27/2005 12:00:00 AM
Yeah, I copied the code and tested it. It works fine with me also.
This seems to be a bug in the flash ide then.

Better option will be to make a new file altogether and copy paste the code
from your old file and continue.
Re: clearInterval does not run the play(); Jeckyl
4/27/2005 12:00:00 AM
Unlikely that it is a flash but .. almost 99% certain it is a user coding
problem. It would bevery dependant on the context where that code is
placed. Is it in a button. in a clip, in a frame in a clip, or an event,
where is the clip that is being controlled relative to where the code is
defined. Is there other code executing that is telling the script to stop
or go back a frame (so one bit of code fighting another) etc etc. There is
simply not enough info to know what it is you have stuffed up so that we can
tell you how to unstuff it. Please help us help you by providing more
information (eg upload your FLA and provide a link so we can see it).
--
Jeckyl

Re: clearInterval does not run the play(); borbolla
4/27/2005 12:00:00 AM
I will have to follow FlashKernel option, I just made another flash file with
the same frames and objects (although not very organized like the original) and
works perfect, I have had same problem with other jobs, in fact , among those
jobs I have reinstalled OS, and remains the same thing. I have worked with
Flash for several years, and this is nothing but a number of bugs in Flash.

For example, I had a file that worked ok, then when I tried to open the file
and run it 6 or 8 months after, the file didn't work and looked as planned,
that' what Im talking about.


Re: clearInterval does not run the play(); Flashkernel
4/28/2005 12:00:00 AM
Yeah that has happened with me too many a times.
I created a new .fla gave simple shape tween to shape and it didn't worked.
I took the file to another machine and voilaa it was working.
My first machine was amd k6 processor based. and second was amd athlon xp
2800+.
I'm confused.
AddThis Social Bookmark Button