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.
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.
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?
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. -
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
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. -
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
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.
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.