Results 1 to 4 of 4

Thread: Confused about onLoad and loadMovie - help!

  1. #1
    Join Date
    Oct 2007
    Posts
    46
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Confused about onLoad and loadMovie - help!

    I'm creating my first full Flash website and am very new to Actionscript. Everything is coming together well except for my intro. I have an intro splash movie clip which I want to load into an empty "master" movie clip. In that intro splash movie clip is a button which gives the user the option of skipping the movie. Here is how I currently have the main stage set up:

    Frame 1:
    • layer with empty movie clip and instance name LoaderClip
    • actions layer with this code:
    LoaderClip.loadMovie("intro.swf");


    Frame 2:
    • layer with preloader artwork and applicable code

    Frame 3:
    • layer with splash intro movie clip
    • actions layer with stop();

    I have set up a button within the intro splash movie clip (on frame 3) which allows users to skip the movie. I've given it the instance name skipButton. The code I've used for that button is:
    skipButton.onRelease = function(){
    this._parent.loadMovie("home.swf")
    }

    The button works but in my "intro.swf" movie, I have a looping sound track. I have on and off buttons in the intro movie but on no other swf files because the music isn't supposed to play anywhere else. The code above makes the "skip intro" button work perfectly and "home.swf" loads beautifully but the music from the "intro.swf" is still playing. I don't want this. Is there a way to automatically stop the music from "intro.swf" once the user clicks on the skip intro button and the "home.swf" page has loaded?

    Oh, and if the user wants to view the entire "intro.swf" movie, is there a way to automatically load "home.swf" once the intro movie has finished?

    I'm using Actionscript 2.0 and Flash CS3.
    Last edited by ozzie123; 10-16-2007 at 03:13 AM.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Assuming you have loaded the sound via AS...

    Code:
    on (release) {
    	_root.yourSoundName.stop();
    }
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Oct 2007
    Posts
    46
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thanks man...it works!

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Sound is fun.. when it works right. Glad it was the simple fix
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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