A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Can you set a flash movie to play only once?

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Posts
    15

    Can you set a flash movie to play only once?

    Hey everyone, I have a question - if anyone can help it would be much appreciated.

    Is there an actionscript that I can use to make it so that my flash movie plays only once? That is, when I land on my homepage the intro plays, but then after I've been surfing around my site and I come back to the homepage I don't want it to play again. Right now it plays every single time I come back to the homepage. The site is www.greatlakeshomeandresort.com.

    Any suggestions?

    Thanks,

  2. #2
    Junior Member
    Join Date
    Feb 2004
    Posts
    27
    play or load again? cauze you could make a frame on the end on that movie with a stop(); on it. and when you press on the home button you say
    Code:
    on (release) {
    	tellTarget ("your_home_mc") {
    		gotoAndStop(10);
    	}
    }
    and at frame 10(could be any frame you want) it would have the image or mc... whatever you want

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    If I understand you correctly, you should simply condition the playing of your "intro" movie clip. Simply set a variable ( like _level0.intro_has_played = true; ) at the end of your "intro", and start it off whith a check of that variable on a first blank keyframe...
    code:

    if(_level0.intro_has_played == true){
    this.stop();
    }else{
    this.play();
    }


  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Unless your whole site is Flash, you probably want to use a cookie or a shared object (shared objects are like cookies but are created and used within Flash) to set whether someone has viewed the intro before or not.

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