Skip to main content
Participating Frequently
May 20, 2007
Question

newb setinterval() help

  • May 20, 2007
  • 7 replies
  • 392 views
Hi,

My flash is simple, I just have to alpha in and out pictures having setinterval() as their delays.

my problem is, the movieclip exported into .swf should be loaded wihtin a .swf files with is mainly the control for the clips using buttons on releases then loadMovieNum x.swf level 10.

now, everything works fine except the setinetrval() how do I make it right?

mycode:

stop();
var interval:Number = setInterval(function () {
play();
clearInterval(interval);
}, 7000);

to delay it 7 seconds. the .swf itself works and delays for 7 seconds but after it has been loaded inside a .swf, the intervals are gone.

please help me. Thanks!
This topic has been closed for replies.

7 replies

kglad
Community Expert
Community Expert
May 23, 2007
you're welcome.
MrLecheAuthor
Participating Frequently
May 23, 2007
hi sir,

in every 7000ms, pictures alpha in, after 7000ms, it alpha outs while another picture alpha in on the same coordinates. it was named rightmovie.swf, the leftmovie.swf does also the same. It all works fine now. Maybe its the cache that make it not work earlier.

I tried opening it on another computer and it works. Thanks!
kglad
Community Expert
Community Expert
May 23, 2007
what is it that you want to occur every 7000ms and what does that have to do with your _level10 and _level11 swfs?
MrLecheAuthor
Participating Frequently
May 23, 2007
hi, it doesn't fully work. I'll explain the flash a littel further:

first i have a control swf named "main.swf" it is embedded in a html. then the main.swf have buttons. for every button that is pressed 2 movies will actually be loaded. 1 in the left side of the main.swf, 2 on the right side of it. at levels 10, and 11 respectively.

so when button "movie1" was pressed the actionscript on release will execute.

on realese, loadMovieNum("leftmovie1.swf", 10);
loadMovieNum("rightmovie1.swf, 11);

sometimes the intervals are ok and sometimes it doesn't. I already double checked that I pasted your code. Thanks!
kglad
Community Expert
Community Expert
May 21, 2007
replace your code with the code in my message.
MrLecheAuthor
Participating Frequently
May 21, 2007
Hi,

I really a noob about this in a way that won't even know how does this work, do I have to paste this and replace everything and it would run ok? I mean I'll try doing it now a hopes everything is fine and I won't have to change anything.
kglad
Community Expert
Community Expert
May 20, 2007
don't use the play() function, use the play() method with the correct movieclip reference: