A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: 2 problems I'm unable to solve with FAQ#5

  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    15

    2 problems I'm unable to solve with FAQ#5

    I referred to FAQ#5 (on this forum) regarding changing audio tracks using external movies. But there are still 2 problems that I'm facing.

    Problem 1. Suppose I keep 2 buttons, one each selecting for TRACK1 and TRACK2. Now suppose that the movie starts with TRACK1 already playing as default and you click on the button for TRACK1, in that case the TRACK1 starts playing from the beginning instead of ignoring the mouse-click.
    Similarly when I click on TRACK2, TRACK1 stops and TRACK2 starts - which is alright but if at this point I again click on TRACK2 then even TRACK2 starts playing from the beginning.

    Problem 2. If I'm using the external movie files for swapping audio tracks, how will I control their volumes(since I want to give the volume controls also)

    I've also uploaded the test file that I've been working on at : http://www.bigmouthpro.com/soundtt/externalsound.html
    (dont bother with the volume controls buttons since they are not working anyways at this time)

    Any help in solving these 2 problems is appreciated

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    for Problem 1.

    what functionality do you want for the track buttons? Do you want them to ignore clicks if the given track is already playing?

    for Problem 2.

    you would use a slider and a sound object. There should be some slider tutorials in the tutorial section. Or you can post your slider code if you already have something you are working from.

  3. #3
    Junior Member
    Join Date
    Apr 2003
    Posts
    15
    Problem 1:
    yes i want the button to ignore click for the track that us already playing, just hte way u've said it

    Problem 2:
    I've got the volume control working but it is not a slider based control but instead I'm using "+" & "-" buttons which go on increasing/decreasing the volume by 10 units on every click.

  4. #4
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    Assuming you are loaing external SWFs for the tracks, one way to do this is to compare the url of the file already playing to the one you intend to play.

    Code:
    // button for track1
    on(release){
       // if the url you want to load is not a substring of the url
       // currently loaded in _level1, then go ahead and load new song.
       // Otherwise the song in _level1 is song1, do not reload and restart
       if(_level1._url.indexOf("urltosong1.swf") == -1){
            _level1.unloadMovie(); // clear old song
            loadMovieNum("urltosong1.swf",1); // load new song
       }
    }

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