dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] AS 2.0: Trying to clear interval in external swf from main movie

  1. #1
    flash grasshopper
    Join Date
    Feb 2005
    Posts
    156

    resolved [RESOLVED] AS 2.0: Trying to clear interval in external swf from main movie

    Hi everyone!

    The basic situation is this: I have an external swf, which uses an interval to space out the loading of JPEGs.

    This swf is loaded into the main swf using the movieclip loader class. I unload the external swf when a button is pressed - and I am also attempting to clear the interval at this point. However, it's not working for me - when I click on another button to go back to the frame that loads the external swf, it is obviously running additional intervals. The JPEGs start loading faster and faster.

    This is my code:

    External swf -

    PHP Code:
    var fadeInterval:Number setInterval(fadeIn750); 
    Main swf -

    PHP Code:
    var mclLoader:MovieClipLoader = new MovieClipLoader();
    createEmptyMovieClip("external"3);
    mclLoader.loadClip("flashElements/pics_home.swf"external);

    test_btn.onRelease = function ()
    {
        
    clearInterval (external.fadeInterval);
        
    mclLoader.unloadClip(external);
        
    gotoAndStop("about");
    }; 
    Now the second bit of code is what I've come up with after trawling the internet for answers. I've come across more than one forum where people are having this exact problem, which is seemingly fixed by the above. However for me, no dice.

    Any input would be appreciated!

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    117
    if you can get the external swf to read variables from the other swf then do an if statement in the external swf and put the clear interval part in the external swf within the if statement

  3. #3
    flash grasshopper
    Join Date
    Feb 2005
    Posts
    156
    Thanks for the suggestion, but doesn't it seem like there should be an easier way than that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center