Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
  1. #1
    Member Tristessa's Avatar
    Join Date
    Nov 2004
    Location
    Kingston, Ontario
    Posts
    94
    Member #
    8215
    :ermm:

    I have a project at work where I need to have one image fade to white and load another image. I grabbed a script off another website and attempted to tweak it to fit our needs, which is: Have it auto play and change the image every 7 seconds.

    I added in some 'delay' code that I used in a previous project (which worked before).

    I was wondering if there was anyone on here who would be able to help me out! :nervous:

    The code which is located below will auto play and change images, but it is not listening to my clearInterval code, so the images just keep on playing without the pause.

    Any help would be greatly appreciated!

    Feel free to change the images which are loaded for testing. I currently have the numbers 26 - 01 there which were the names of my local images.

    Code:
    var baseurl = _url.substr(0,_url.lastIndexOf("/")+1);
    var dir = baseurl;
    var images = ["26","25","24","23","22","21","20","19","18","17","16","15","14",
              "13","12","11","10","09","08","07","06","05","04","03","02","01"];
    
    function wait() {
    	    this.gotoAndStop(dir + "/" + images[0] + ".jpg");
    }
    myTimer = setInterval(wait, 7000);
    
    //Auto Play
    
    
    playFade = function(){
    	this.gotoAndStop(this._currentframe + this.speed);
    }
    loadFade = function(){
    	var lod = this.fader.contents.getBytesLoaded();
    	var tot = this.fader.contents.getBytesTotal();
    	if (lod && tot && lod == tot){
    		this.speed = -1;
    		this.onEnterFrame = playFade;
    	}
    }
    // pressForNext = function(){
    //	this.speed = 1;
    //	delete this.onPress;
    //}
    
    fading_symbol.onFadeOut = function(){
    	this.speed = 0;
    	this.fader.contents.loadMovie(dir + "/" + images[0] + ".jpg");
    	images.push(images.shift());
    	this.onEnterFrame = loadFade;
    }
    fading_symbol.onFadeIn = function(){
    	this.speed = 1;
    	clearInterval(myTimer);
    //	this.onPress = pressForNext;
    }
    
    fading_symbol.gotoAndStop(fading_symbol._totalframes); // straight to onFadeOut

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Where's the actual fading code? Or... What's your problem, exactly? I'm not sure I'm clear on that.

  4. #3
    Member Tristessa's Avatar
    Join Date
    Nov 2004
    Location
    Kingston, Ontario
    Posts
    94
    Member #
    8215
    I uploaded the .fla for reference.
    I took the code from: http://www.senocular.com/flash/source.php?id=0.141

    and tried to tweak it to set a 7 second delay before it switches to another image and I will be adding "previous", "next" and "pause/play" buttons.

    Its due on Monday, I may just have to work around it

    The FLA can be found here: http://www.kellykruschel.com/news-02.fla

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Ah yes, FLA files. I don't actually own a copy of Flash, I'm afraid, so we'll have to wait for someone who does to help

  6. #5
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    I can't open it! Can you save down to MX?
    choosy developers choose gif!
    website | paintings | blog

  7. #6
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    Here it is, v8 is as far back as I could find to save it.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  8. #7
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    Thanks Chris! But, I have MX not MX 8, so I still can't open it
    choosy developers choose gif!
    website | paintings | blog

  9. #8
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    Do you have a way to decompile it if I save it as a .swf?
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  10. #9
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    I don't think so...
    choosy developers choose gif!
    website | paintings | blog

  11. #10
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    I am out of ideas. Maybe Tristessa will be able to do it for ya.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

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

Search tags for this page

matchcatchers

Click on a term to search for related topics.
All times are GMT -6. The time now is 02:08 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com