A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [CS3] Total n00b here, need simple help

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    0

    [CS3] Total n00b here, need simple help

    K, trying to essentially make a multimedia enclosure with audio and video file, and have followed this tutorial in terms of making the buttons trigger the file with the following as:

    Code:
    var loadSnd:URLRequest = new URLRequest("filepath.mp3");
    var thisSnd:Sound = new Sound();
    thisSnd.load(loadSnd);
    
    var sndTrans:SoundChannel = new SoundChannel();
    
    playAudioBtn.addEventListener(MouseEvent.CLICK, playF);
    pauseAudioBtn.addEventListener(MouseEvent.CLICK, pauseF);
    
    function playF(eventMouseEvent):void {
    	SoundMixer.stopAll();
    	sndTrans = thisSnd.play();
    }
    
    function pauseF(eventMouseEvent):void {
    	sndTrans.pause();
    }
    Basically I substituted all instances of "stop" which worked, for "pause" which didn't work. Before I did the stopF worked just fine. Is there a simple way to go from a stop function to a pause function?

    TIA

  2. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    not as simple as you might hope. At least it wasn't in AS2. I haven't messed with AS3 sound but if you go to the help files and search for Sound, then find the sound object you'll find a complete list of all its properties. In as2 there is a position property. Also, it is sound.start() but now is sound.play(). However, you used to store sound.position in a variable and then pass it as a parameter to sound.start(). I doubt too much as changed so you might see if sound.position still exists. Also, there may be a new property I don't know about capable of pausing a sound -that would be nice-. If there is that would be easier. Hopefully this will help you figure it out.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

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