www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > Other

    Other Discussion and technical support for any other scripting methods.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 06-30-2004, 05:01 AM
    janice_2k4 janice_2k4 is offline
    Registered User
     
    Join Date: Jun 2004
    Posts: 32
    Question Can Actionscript play client side mp3 files?

    Dear gurus and members,

    I am a newbie in actionscript and other scripting. I wonder whether it is possible for actionscript to read mp3 files located on the client's computer. I have a flash button embedded on my website (online) that should play server side and client side mp3 files alternately. For example: Q1(server)-A1(client), Q2-A2...etc with just a click on a button.

    The following is the code I tested to see if actionscript can play a client side mp3 file:
    Code:
      
    on (release) {
    	  stopAllSounds();
    	  PE14Conv1e = new Sound();
    	  PE14Convle.loadSound("file:///c:/Program Files/Sound Recording/AudioRecorder/NewSong52211.mp3");
    	  PE14Conv1e.start(0, 0);
    }
    I have placed the .mp3 file in the folder correctly but when I tested the movie and build swf file (without uploading to the server yet as there are some difficulties in uploading to my server these few days), it does not play the mp3.

    I did the same method on another button that calls server side mp3 file. However, this one works fine when I tested:

    Code:
    on (release) {
    	  stopAllSounds();
    	  PE14Conv1d = new Sound();
    	  PE14Conv1d.attachSound("PE14_1d");
    	  PE14Conv1d.start(0, 0);
    }
    I have no idea how to solve the problem in playing client side mp3 files from the Flash button on my website. Looking forward t some reply soon.

    Thanks in advance,
    Janice
    Reply With Quote
      #2  
    Old 07-01-2004, 12:51 AM
    buntine buntine is offline
    Super Moderator
     
    Join Date: Jan 2004
    Location: Melbourne, Australia
    Posts: 5,527
    It seems nobody knows the answer! Try posting your question in the forums at flashkit.com.

    http://www.flashkit.com/index.shtml

    Regards.
    __________________
    http://www.andrewbuntine.com
    Reply With Quote
      #3  
    Old 07-01-2004, 01:02 AM
    janice_2k4 janice_2k4 is offline
    Registered User
     
    Join Date: Jun 2004
    Posts: 32
    Thanks buntine,
    This method works fine
    Code:
    on (release)
    {
     stopAllSounds();
    	mySound = new Sound();
    	mySound.loadSound("file:///c:/program files/sound recording/audiorecorder/newsong52211.mp3", true);
    	mySound.start();
    }
    It was my mistake previously. Anyway, How can I make it in such ways that it will play serverside mp3 and client side mp3 alternately from the beginning till the end? For example:Q1(server side mp3)-A1(client side mp3), Q2-A2, Q3-A3...etc? The file name is fixed as: audio# for server side & test# for client side. ('#' = number). I think there should be a var that will check for the number of mp3s from the server and assign the value to a loop to play the mp3s. I would very glad if you could help me as I have no idea at all about actionscript and the language. I am at total lost. Looking forward to some reply soon.

    Thanks in advance,
    Janice
    Reply With Quote
      #4  
    Old 07-11-2004, 11:16 PM
    janice_2k4 janice_2k4 is offline
    Registered User
     
    Join Date: Jun 2004
    Posts: 32
    Hi Buntine,
    I tried playing the mp3 files from both server and client side alternately and currently, it works fine. Though, there is a problem as, if one of the files does not exist, an error will occur and this will terminate the script without continuing playing the mp3s. The code is as below:

    Code:
    on(release){     
    	
    	var iddiscussion = 1;
    	var numberFile = 4;
    		
    	function discussion() {
    		server = new Sound();
    		trace("in new Sound");
    		server.attachSound("PE14_1d"+iddiscussion+".mp3");
    		server.start(0, 0);
    		server.onSoundComplete = function () {
    			client = new Sound();
    			client.loadSound("file:///c:/program files/sound recording/audiorecorder/test"+iddiscussion+".mp3", true);
    			client.onLoad = function(success) {
    				this.start();
    			}
    			client.onSoundComplete = function () {
    				iddiscussion++;
    				if (iddiscussion < numberFile) { 
    				discussion();
    				}
    			}
    		}
    	}
    discussion();
    	
    }
    How can I check for the files whether it exist? If the file does not, it will proceed to the next mp3 files without prompting any error. I would be glad if you could guide me in this part as I am quite lost here. Looking forward to your reply soon.

    Thanks in advance,
    Janice

    Last edited by janice_2k4; 07-11-2004 at 11:26 PM.
    Reply With Quote
      #5  
    Old 07-12-2004, 12:44 AM
    buntine buntine is offline
    Super Moderator
     
    Join Date: Jan 2004
    Location: Melbourne, Australia
    Posts: 5,527
    Im sorry, but im not a flash-man. I am not familiar with Actionscript.

    The Web Site i posted above may be of more help for Flash programming related questions.

    Regards,
    Andrew Buntine.
    __________________
    http://www.andrewbuntine.com
    Reply With Quote
      #6  
    Old 07-12-2004, 02:55 AM
    janice_2k4 janice_2k4 is offline
    Registered User
     
    Join Date: Jun 2004
    Posts: 32
    Hi Buntine,
    Its ok. Do you know any sites or people that could help me in this? Anyway, thanks for the replies. Have a pleasant day.

    Thanks,
    Janice
    Reply With Quote
      #7  
    Old 07-12-2004, 07:28 AM
    buntine buntine is offline
    Super Moderator
     
    Join Date: Jan 2004
    Location: Melbourne, Australia
    Posts: 5,527
    Yes, the guys at FlashKit will help you out. I posted the link in my first post.

    www.flashkit.com

    Regards.
    __________________
    http://www.andrewbuntine.com
    Reply With Quote
      #8  
    Old 07-12-2004, 10:32 PM
    janice_2k4 janice_2k4 is offline
    Registered User
     
    Join Date: Jun 2004
    Posts: 32
    Thanks buntine. Have a nice day.

    Janice
    Reply With Quote
      #9  
    Old 07-13-2004, 11:02 AM
    schizo schizo is offline
    Code Monkey
     
    Join Date: Jun 2004
    Posts: 388
    Having been featured on flashkit and post regularly in their forums, I'd rather recommend visiting were-here's forums for answers relating to actionscript.
    Reply With Quote
      #10  
    Old 07-13-2004, 08:50 PM
    janice_2k4 janice_2k4 is offline
    Registered User
     
    Join Date: Jun 2004
    Posts: 32
    Thanks schizo. I will drop a thread at the site. Have a nice day.

    Cheers,
    Janice
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:04 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.