A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: MP3 file / Flash MX project dilemma?

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    detroit, mi usa
    Posts
    53

    MP3 file / Flash MX project dilemma?

    Hello Flashkit,

    Here is the scenario; the client has just implemented a new network policy to prevent the downloading of .mp3 files on all users computers within their company network. The dilemma is; I have already deployed 5 large web based Flash MX movies using the loadSound method to dynamically load .mp3 files for each instance that requires a sound. There are lots of instances. I am also in the middle of developing 3 more movies so I have to come up with a solution for the movies in Production as well as the ones in Development.

    My boss does not know his derrière from his derrière so instead of him talking to the client’s network personnel and requesting that they making some simple changes to the .mp3 filter they have just applied I have to come up with the solution.

    I know of one way to wrap sound files in SWFs and use the loadMovie method to dynamically load the sound file… essentially using movie clips to store the sound files, then using stop or gotoAndPlay(frame) to have the sound play. Creating sound files like this and controlling the sounds has never 100% tight. It is spotty at best to consistently to get bytes and total bytes info and to know exactly when the file has finished downloading.

    I want to take the time to program this solution right so I am open and welcome to any suggestions you have.

    Thanks again,
    - Jimmy

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    You didn't hear it from me, but if you rename the .mp3 as .dat it will probably get through the filter and you will still be able to use loadSound.
    So all you need worry about is reconciling your conscience with the certain knowledge of having made a network administrator's life impotent, futile and meaningless through circumventing an entirely sensible rule for the sake of non-essential multimedia.
    Oh ... and editing every single URL in your movies.

  3. #3
    Member
    Join Date
    Apr 2003
    Location
    detroit, mi usa
    Posts
    53

    MP3 file / Flash MX project dilemma

    Hello Gaius Coffey,

    Thanks for the reply. I did exactly what you suggested by changing just the filename to .dat and it works great.

    Sound1 = new Sound();
    Sound1.loadSound("/assets/audio/narrator.dat", false);
    Sound1.start();

    At first I tried to change from .mp3 to .mpz and it failed for some reason...this was just temporary. Must have been a mind block.

    Because then I tried .dat and also tried .mpz again and it worked. Then I thought why not try some arbitrary filename like .abc. Guess what? that works also.

    So you can rename all the .mp3 files to .dat, .abc, or .jimmy or whatever you like and they work. Now I suppose the task at hand is building a utility that can strip the filenames off of .mp3s and name them something else. Do you have any ideas?

    Thanks again,
    - Jimmy

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Ok,

    I have tried out what you did. I have Amadeus for MacOSX. When I omit to create an extension I can add any extension. However, just renaming (altering the mp3 extension) did not work. Are you sure that you can just strip off the mp3 extension and replace with a new one?
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Member
    Join Date
    Apr 2003
    Location
    detroit, mi usa
    Posts
    53

    MP3 file / Flash MX project dilemma

    Hello cancerinform,

    At first just renaming did not work for me, so I concluded no way. Then I built a sample movie and posted it on a web server so that I could see if a file (any file) would download into the browser cache when loadSound is used. The files loaded in cache and played in the movie. Nothing special about it but renaming the file. There is a possibility I am wrong and the mp3 was still in system memory but I do not think so. I'm working on Windows with IE 6

    Let me know if it works,
    - Jimmy

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    May be it depends which program has created the file. Do you have a mp3 file to test where it works what you said? I'd like to play around tonight.
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    Member
    Join Date
    Apr 2003
    Location
    detroit, mi usa
    Posts
    53

    MP3 file / Flash MX project dilemma

    Hello again cancerinform,

    I have put an example on the Internet here but geocities does not allow it to work. http://www.geocities.com/bp_tek/

    I have also uploaded all of the files in an WinZip file
    here which should be able to be opened on a Mac.
    For Flashkit.zip

    Let me know how it comes out.
    - Jimmy
    Attached Files Attached Files

  8. #8
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I look at it tonight.
    - The right of the People to create Flash movies shall not be infringed. -

  9. #9
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    It works fine if you add onLoad:
    mySound1 = new Sound();
    mySound1.loadSound("library/assets/audio/narrator.abc", false);
    mySound1.onLoad = function() {
    mySound1.start();
    };
    - The right of the People to create Flash movies shall not be infringed. -

  10. #10
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    afaik, the extension means very little - tried figuring out the difference between .htm and .html files years ago and learned you can rename it to just about anything (or nothing) and it'll work fine if linked to (e.g., myfile.html renamed to myfile.moagrius or myfile with no dot or trailing letters all function identically). never did figure out the diff between htm and html tho

  11. #11
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    A missing "l" in htm
    - The right of the People to create Flash movies shall not be infringed. -

  12. #12
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    Originally posted by cancerinform
    A missing "l" in htm
    ^^ a scholar and a gentleman

  13. #13
    ___________________
    Join Date
    May 2004
    Posts
    3,174

    Re: MP3 file / Flash MX project dilemma

    Originally posted by Jimmydetroit
    Hello cancerinform,

    At first just renaming did not work for me, so I concluded no way. Then I built a sample movie and posted it on a web server so that I could see if a file (any file) would download into the browser cache when loadSound is used. The files loaded in cache and played in the movie. Nothing special about it but renaming the file. There is a possibility I am wrong and the mp3 was still in system memory but I do not think so. I'm working on Windows with IE 6

    Let me know if it works,
    - Jimmy
    Originally posted by cancerinform

    May be it depends which program has created the file. Do you have a mp3 file to test where it works what you said? I'd like to play around tonight.
    useless info:

    the .whatever is an instruction to the os i believe; you can rename .psd files to .doc, my computer > tools > folder options > file types, set .doc to photoshop, and it'll open fine - and the browser (ie anyways) tries to open the file before anything else, failing that offers the user a download - so the rename thing should work on any non-binary file which is virtually all web script. not sure how it'll do with binaries, but i'd guess it'd be totally fine with binaries set to run in-browser (.mov, .swf, etc) and not at all with those that aren't - i.e., the net result should be functionally identical.

  14. #14
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Originally posted by cancerinform
    I have Amadeus for MacOSX.
    Macs are different. They have a fork rather than an extension.
    Windows uses the extension to map based on its own database of filetypes. Mac has a filename fork and a filetype fork.

  15. #15
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Thanks, didn't know that. But if you have a mac Amadeus is a great program and inexpensive.
    - The right of the People to create Flash movies shall not be infringed. -

  16. #16
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Moagrius,

    here is the answer to htm or html:

    http://www.htmlite.com/SD007.php

    ask Google if you don't know
    - The right of the People to create Flash movies shall not be infringed. -

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