dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: loadMovie, but only once!

  1. #1
    Junior Member
    Join Date
    Mar 2003
    Location
    Hobart, Australia
    Posts
    19

    loadMovie, but only once!

    Hey,

    The code is as follows:

    on(release) {
    loadMovie(movie, level);
    }

    Text appears below the button. How do I now disable the button so that the movie cannot be "reloaded"? Thanks.
    Nick Balc

  2. #2
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    code:
    on (release) {
    this.enabled = false;
    }


  3. #3
    Junior Member
    Join Date
    Mar 2003
    Location
    Hobart, Australia
    Posts
    19

    Thanks Man

    Thanks for that appreciated! I'm a MASSIVE newbie, so bare with me!
    Cheers.
    Nick Balc

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    By the way the correct syntax to load a movie on a level is...

    loadMovieNum("movie.swf", 5);

  5. #5
    Junior Member
    Join Date
    Mar 2003
    Location
    Hobart, Australia
    Posts
    19

    Disabling JUST the down state

    Newbie - i have only been here a couple of weeks and already i can see you being me best friend! LOL.

    Anyway, is there a way to disable JUST the DOWN state? I have an MC running in the over state that I would like to keep!
    Nick Balc

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Not really!

    What I'd do is set a variable to true and check it on your release script...

    Set a variable on the first frame of your movie...

    _level0.movie_played = false;

    Then on your script...

    on(release) {
    if(_level0.movie_played == false){
    loadMovieNum("movie.swf", 5);
    _level0.movie_played = true;
    } else {
    stop();
    }
    }

    This will have the movie load once, and when it has the variable being set to true, the else is executed, and the movie ain't loaded once again. The button just does nothing on the release actionscript.

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