A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 27
  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    7

    Lightbulb

    I have 5 audio clips that a user can choose as well as off/on. These are loaded into a _root.musicload clip. I did this so I could call a variable/clip name.

    I built a volume control, and I wish to adjust the volume in the loaded movie clip/music.swf. Doesn't seem to work. I believe there is a problem with interacting with the loaded movieclip/music.

    Anyone out there that can solve this one!!!

    If so, "I'M NOT WORTHY!!, I'M NOT WORTHY!!

    Would be way cool!

    my mail: masha@logicdata.com

  2. #2
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697

    Hi and welcome to Flashkit :)

    Have you tryed to combine the tell target and useing the level that u have loaded the swf into and with the soundobject ? I think that will do it

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    1,180
    Hi..
    Whenever you load a sound swf file you need to change the way you set up the sound file. For instance, you would normally set up your sound object as follows:

    s = new Sound();
    s.attachSound("mySound");
    s.start();

    When you test this it works fine, fine that is until you load it into another movie at which point it will cease to work. The reason for this is that the loaded movie loses it's connection to the linked sound.
    To remedy the problem you need to force the sound file to refer to itself. You do this by adding the 'this' keyword:

    s = new Sound(this);
    s.attachSound("mySound");
    s.start();

    Hope this helps.

  4. #4
    Junior Member
    Join Date
    Apr 2001
    Posts
    7

    Re: Hi and welcome to Flashkit :)

    [b]onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y+73;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    root.musicload.setVolume(100-(_y-top));
    }
    }
    [b]
    this is the above code that I'm using. I tried out a couple of things but I still wasn't able to capture the desired results.

    Originally posted by GmF
    Have you tryed to combine the tell target and useing the level that u have loaded the swf into and with the soundobject ? I think that will do it

  5. #5
    Junior Member
    Join Date
    Apr 2001
    Posts
    7
    As of now, the Volume controls are located on the Parent Time Line.

    Originally posted by Marx
    Hi..
    Whenever you load a sound swf file you need to change the way you set up the sound file. For instance, you would normally set up your sound object as follows:

    s = new Sound();
    s.attachSound("mySound");
    s.start();

    When you test this it works fine, fine that is until you load it into another movie at which point it will cease to work. The reason for this is that the loaded movie loses it's connection to the linked sound.
    To remedy the problem you need to force the sound file to refer to itself. You do this by adding the 'this' keyword:

    s = new Sound(this);
    s.attachSound("mySound");
    s.start();

    Hope this helps.

  6. #6
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697
    Take a look at this , its not for a external swf but for a movieclip http://www.gmf.as/downloads/volume_in_levels.html

    I think you can take advantage of it .

  7. #7
    Junior Member
    Join Date
    May 2001
    Posts
    1

    You know how to, can you help?

    Originally posted by bigtoe2000
    I have 5 audio clips that a user can choose as well as off/on. These are loaded into a _root.musicload clip. I did this so I could call a variable/clip name.

    I built a volume control, and I wish to adjust the volume in the loaded movie clip/music.swf. Doesn't seem to work. I believe there is a problem with interacting with the loaded movieclip/music.

    Anyone out there that can solve this one!!!

    If so, "I'M NOT WORTHY!!, I'M NOT WORTHY!!

    Would be way cool!

    my mail: masha@logicdata.com
    Ok, so im trying to figure out how to do this, can you tell me how you created your background aduio user buttons?

  8. #8
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697
    I dont know if its me you are talking to but if it is , download it and have a look. If not.....

  9. #9
    Junior Member
    Join Date
    Apr 2001
    Posts
    7
    shellag,
    ~~ Setup your files/control panel
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    1.)I created a control panel looking thing that contained a list of various song styles and an on/off.
    2.)Each Song Style and On / Off were then converted to Buttons for a total of 7 buttons.
    3.)I opened up 5 new movies, one for each Song Syle.
    4.)Saved each song style example: hip-hop.fla , New-Age.fla etc.
    5.)Set the movie size for each movie to 18x18 (which is as small as it will go)

    ~~ Importing the music
    ~~~~~~~~~~~~~~~~~~~~~~


    1.) Open up one of the new song style movies
    2.) In the Timeline, Select the first frame and IMPORT the music file. This will bring the Music file into your library.
    3.) Drag the musicClip from the library onto the canvas. You should see a wavelength appear in the first frame of your timeline.
    4.) Go to Window>Panels and select the Sound Panel
    5.) Now select the frame containing the wavelength and this should populate the sound Panel with information regarding your soundclip.
    6.) Sync should be set to event and loop to 999
    4.) Test your movie to hear the music

    ~~ Actionscript in main Movie
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    1.) open up the music control panel you created.
    2.) select one of your music buttons and enter in the following:

    on (release) {
    unloadMovieNum (20);
    loadMovieNum ("yoursong.swf", 20);
    }

    unloadMovieNum (20); <-- This will clear the current song
    loadMovieNum ("yoursong.swf",20); <-- This will load your song on level 20 and play it

    Repeat this with every button except for the On/Off. yoursong.swf will be replaced with your song file name.

    3.) for the On button enter in the code above.
    4.) for the off button simply clear out the loaded movie

    on (release) {
    unloadMovieNum (20);
    }

    ~~ Starting a song on entering your site
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    1.) On the main time line, decide when you want the music to start. Select that frame and enter in code that will load the sound upon entering that frame.

    enter in the following code.

    loadMovieNum ("yoursound.swf", 20);

    I hope this helps, this may not be the most effecient manor but it certainly works and reduces the file size of your main movie!!

    Lots a luck!!




  10. #10
    Junior Member
    Join Date
    Feb 2001
    Posts
    7

    ("yoursong.swf", 20);

    ("yoursong.swf", 20);
    I see this alot in movies. I understand the syntax up to the "20" what does the 20 do?

    Thanks in advance, Jase

  11. #11
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697

    Hi and welcome to Flashkit :)

    If you load your music into level 20 you can be sure that yuo dont unload it with another (I use this as a default soundlevel) . Top flore.

  12. #12
    Junior Member
    Join Date
    Feb 2001
    Posts
    7

    Not sure what "level 20" is

    sorry can you explain a little bit more? What is level 20? When you say load your music into level 20 I understand that syntax to be ("yoursong.swf", 20); but what exactly is the level 20? Is it the 20th layer of the main timeline?

    Thanks again,... Jase

  13. #13
    Junior Member
    Join Date
    Apr 2001
    Posts
    7

    Re: (

    Originally posted by Taelo
    ("yoursong.swf", 20);
    I see this alot in movies. I understand the syntax up to the "20" what does the 20 do?

    Thanks in advance, Jase
    Essentialy you have two options when you call/dynamicaly import a .swf file into your movie during runtime.

    You can imort the .swf file then stick it into a movieclip or you can place on a layer/level that will sit on top of your movie.

    ("yoursong.swf", 20); means, load yoursong.swf into level 20.

    Its simply a virtual space to put your song. A residence so to speak.

  14. #14
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697
    Thanks for the post 2000.


    You should read the helpfile that comes with Flash , its all written down in details . (a must)

  15. #15
    Junior Member
    Join Date
    Feb 2001
    Posts
    7
    ok so the 20 is a made up space that we create? It is not a physical location on the timeline or anything right? Just making sure I understand this correctly

    Jase

  16. #16
    Junior Member
    Join Date
    Feb 2001
    Posts
    7
    Originally posted by GmF
    Thanks for the post 2000.


    You should read the helpfile that comes with Flash , its all written down in details . (a must)

    Actually I did read the help file,....thats why I am here. The flash help manual is the worst I have ever seen. At least here I can get some examples and some interation from real people

    Jase

  17. #17
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697
    Worst ? I think it depends on howe you use it and read it Yeah, this place rocks .

    Loading and unloading additional movies

    To play additional movies without closing the Flash Player, or to switch movies without loading another HTML document, use the Load Movie action.

    The Unload Movie action removes a movie previously loaded by the Load Movie action.

    These are some sample uses of the Load Movie action:

    Playing a sequence of banner ads that are SWF files, by placing a Load Movie action at the end of each SWF file to load the next movie.
    Developing a branching interface that lets the user choose among several different SWF files.
    Building a navigation interface with navigation controls in level 0 that load other levels. Loading levels produces smoother transitions than loading new HTML pages in a browser.


    To load a movie:

    1 Select the frame, button instance, or movie clip instance to which you will assign the action.
    2 Choose Window > Actions to display the Actions panel.
    3 In the Toolbox list, click the Basic Actions category to display the basic actions, and select the Load Movie action.
    4 In the Parameters pane, for URL specify an absolute or relative URL for the SWF file to load.
    For use in the Flash Player or for testing in Flash, all the SWF files must be stored in the same folder and listed as file names without folder or disk drive specifications.
    5 For Location, choose either Level or Target from the pop-up menu.
    6 If you choose Level for Location, enter a level number as follows:
    To load the new movie in addition to existing movies, enter a level number that is not occupied by another movie. (To keep the movie and update the variables with new values, use the Load Variables action; for more information, see ActionScript Help.)
    To replace an existing movie with the loaded movie, enter a level number that is currently occupied by another movie.
    To replace the original movie and unload every level, load a new movie into level 0.
    The movie loaded first is loaded at the bottom level. The movie in level 0 sets the frame rate, background color, and frame size for all other loaded movies. Movies may then be stacked in levels above the movie in level 0.
    For more information on levels and targets, see the movie clips chapter of ActionScript Help.
    7 If you choose Target for Location, specify a movie clip that will be replaced by a loaded movie.
    The loaded movie inherits the position, rotation, and scale properties (attributes) of the targeted movie clip. The loaded movie's upper left corner is placed at the registration point of the target movie clip (the cross hairs location in symbol-editing mode).
    8 For Variable, choose a method for sending variables for the loaded movie to the location listed in the URL text box:
    Choose Send Using Get to append a small number of variables to the end of the URL. For example, you would use this option to send the values of the variables in a Flash movie to a server-side script.
    Choose Send Using Post to send variables separate from the URL, as longer strings in a separate header. This method lets you send more variables and lets you post information collected from a form to a CGI script on the server. For example, you can send variables to a CGI script, which generates a SWF file as its CGI output.
    Choose Don't Send to not pass any variables.
    See the Web applications chapter of ActionScript Help.
    In the following example, clicking a button loads a movie into the root directory at level 0, replacing any existing movie, and sends variables to the loaded movie using the Get method:
    loadMovie ("someFile.cgi", 0, "GET");

    where "someFile.cgi" outputs a Flash movie in SWF file format.



    To unload a movie from a Flash movie window:

    1 Select the frame, button instance, or movie clip instance to which you will assign the action.
    2 Choose Window > Actions to display the Actions panel.
    3 In the Toolbox list, click the Basic Actions category to display the basic actions, and select the Unload Movie action.
    4 For Location, choose one of the following options from the pop-up menu:
    For a loaded movie, select Level and enter the level of the movie that you want to unload.
    To target a movie to unload, select Target and enter the path of the movie that you'll target to unload. To enter an expression that evaluates to a level or movie, select Expression and enter the expression. For example:
    unloadMovie (3);

    targets the movie on level 3 and unloads it.



    To test a Load Movie or Unload Movie action:

    1 If you're testing a Load Movie action, make sure that the movie being loaded is at the specified path. If the path is an absolute URL, an active network connection is required.
    2 Choose Control > Test Movie.

  18. #18
    Junior Member
    Join Date
    Feb 2001
    Posts
    7

    ok,...then answer me this

    right now I have managed to get 1 audio clip to toggle on using a button and have also got the volume slider functional. I understand about the loadmovie with the various .swf files. My question is how would I make it so my volume control is funtional for all the audio clips (.swf's)?

    Jase

  19. #19
    Senior Moderator ®
    FK´s Banning Machine ™
    GMF ™'s Avatar
    Join Date
    Feb 2000
    Location
    Oslo, Norway
    Posts
    5,697
    Have the sounds in the same level

  20. #20
    Junior Member
    Join Date
    Feb 2001
    Posts
    7

    GMF,....my point is

    that I had no idea that I was supposed to use the load movie action until I came here. This real world examples is what gives you experience. At least here I can ask questions

    Jase

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