A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [F8] background music...

  1. #1
    Disenchanted
    Join Date
    Jan 2007
    Posts
    25

    [F8] background music...

    :P questions again

    I've made several scenes and I want to include some background music.
    Where should I put it in order to make it play continuously??
    Flash newbie

    Long Live The Black Parade

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    use the Flash Sound Object, details at -

    http://www.kennybellew.com/tutorial/

  3. #3
    Disenchanted
    Join Date
    Jan 2007
    Posts
    25
    Thx!
    I'm reading it but I got a few questions...

    does "same timeline" = "same scene" ?
    and does "globally" includes all scenes?
    Flash newbie

    Long Live The Black Parade

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    does "same timeline" = "same scene" ?

    when you are in the authoring environment, you can create many timelines,
    the timelines of each Scene, and the timelines of each movieclip.
    when the fla is compiled to a swf file, all layers in all scenes and movieclips
    are flattened to become one layer, and all timelines are joined to become
    one continuous timeline

    and does "globally" includes all scenes?

    "globally" does exactly what it says on the box
    global variables are open to the scope of all
    timelines in all movies in the Player session

  5. #5
    Disenchanted
    Join Date
    Jan 2007
    Posts
    25
    thx!!! thank you for answering my questions

    it really helps me a lot =]
    Flash newbie

    Long Live The Black Parade

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    you're welcome
    Good Luck

  7. #7
    Disenchanted
    Join Date
    Jan 2007
    Posts
    25
    Oh now I got another problem...

    Because the game will jump from the first scene to the third one, the music will suddenly stop!!!



    help.... :'(
    Flash newbie

    Long Live The Black Parade

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    hard to answer without knowing what you have done

    my take would be -

    create a new file - music.swf - import your wav/mp3 to the Library
    and give it a Linkage ID - mySound.
    add code to frame#1 to make a global sound object -
    Code:
    _global.sndtrack = new Sound(this);
    sndtrack.attachSound("mySound");
    sndtrack.stop();
    in the main fla, load to a level and start the sound
    you now have access to all of the sound object properties,
    and the soundtrack will play across all Scenes -
    Code:
     loadMovieNum("music.swf",1);
    vol = 50;
    
    this.onEnterFrame = function(){
    if(_level1){
    sndtrack.setVolume(vol);
    sndtrack.start(0,999);
    delete this.onEnterFrame;
    } 
    };
    hth

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