Results 1 to 6 of 6

Thread: Method stop() in flash

  1. #1
    Join Date
    Jan 2010
    Posts
    119

    Method stop() in flash

    Hello,
    I am trying a code in action script for my friends web site and now the problem is that I can not get the stop() method to work correctly. I have tried a number of attempts but now of them have really worked. So, if you have a code or if you can just let me know why he stop() method is not working, if would be great. Thank you for your replies.

  2. #2
    Join Date
    Dec 2009
    Posts
    192

    Re: Method stop() in flash

    Try the following code and see if the stop() method is working

    Here is the code
    Code:
    var test_snd:Sound = new Sound(); test_snd.loadSound("song1.mp3", true);
     
    stop_btn.onRelease = function() (
         trace("sound stopped "); test_snd.stop();
    ); play_btn .onRelease = function() (
         trace("sound started"); test_snd.start();
    );

  3. #3
    Join Date
    Nov 2009
    Posts
    518

    Re: Method stop() in flash

    I use this code , see if this can help you
    Code:
    var snd: Sound = new Sound ();
    snd.loadSound ("address or url to mp3 file", false);
    stp_bn.onRelease = function () (
         trace ("sound stopped");
         snd.stop ();
    )
    play_btn.onRelease = function () (
         stopAllSounds ();
         trace ("sound started");
         snd.start ();
    )
    var snd2: Sound = new Sound ();
    snd2.loadSound ("address or url to mp3 file", false);
    stp_bn2.onRelease = function () (
         trace ("sound stopped");
         snd2.stop ();
    )
    play_btn2.onRelease = function () (
         stopAllSounds ();
         trace ("sound started");
         snd2.start ();
    )

  4. #4
    Join Date
    Dec 2009
    Posts
    204

    Re: Method stop() in flash

    Here is the code that will help you

    Code:
    var sound:Sound = new Sound();
    / / if the sound loads, play it; if not, trace failure loading
    sound.onLoad = function(success:Boolean) (
         if (success) (
         sound.start(); example.text = "Sound loaded";
         ) else (
         example.text = "Sound failed";
         )
    ),
    / / load the sound
    sound.loadSound("song1.mp3", true);

  5. #5
    Join Date
    Dec 2009
    Posts
    211

    Re: Method stop() in flash

    Check out this code

    Code:
    var sd:Sound = new Sound();
    sd.loadSound("song1.mp3", true);
    
    stop_btn.onRelease = function() {
        trace("sound stopped");
        sd.stop();
    };
    play_btn.onRelease = function() {
        trace("sound started");
        sd.start();
    };

  6. #6
    Join Date
    Aug 2009
    Posts
    124

    Re: Method stop() in flash

    Help with the following part of code
    Code:
    <action name="move">
    		test(plugin[button].x,500,distance(500,5),linear);
    		test(plugin[button].y,500,distance(500,5),linear);
    	</action>

Similar Threads

  1. Replies: 9
    Last Post: 06-03-2012, 07:21 PM
  2. Method to stop Apple OS X Lion running startup apps
    By Elili in forum Operating Systems
    Replies: 6
    Last Post: 06-01-2012, 07:19 AM
  3. How can I stop Internet Explorer 8 asking me to install Adobe Flash?
    By The-Tiago in forum Technology & Internet
    Replies: 3
    Last Post: 18-02-2011, 02:19 PM
  4. Nokia N900 eMMc PR1.3 flash frequently stop
    By Goldenbodied in forum Portable Devices
    Replies: 4
    Last Post: 17-01-2011, 10:53 AM
  5. How to write code for pause or stop method in HTML
    By TechPredator in forum Software Development
    Replies: 3
    Last Post: 10-08-2009, 02:39 PM

Tags for this Thread

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
  •  
Page generated in 1,713,906,500.47617 seconds with 17 queries