« New mr.doob's websi... Weird bug in Flash ... »

Oooh... Sandbox sandbox, what a shame...

Feb 11th, 2007

I've spent a lot of hours today trying to do something that I thought it was going to be quite easy. While I was doing the Effect01 of the audioVisualizations I realised that testing different mp3s on it just to see how the visuals were going to react was actually very fun. After a couple of mp3 tests I found out that there was something else, the experiment was showing me parts of the tune that I never paid attention before. So I had the idea to make it 'public', so anyone could test it with their own mp3s and have some fun too.

Easy concept, same experiment but with a inputBox where you paste the link to the mp3. Unfortunately I wasn't aware of flash sandbox limitations on that matter. Apparently you can't load mp3's from other servers that doesn't have the policyFile.xml.

I know that you could do a php script to jump the sandbox, but this would mean a lot of bandwidth on my server, which I don't fancy right now :P

This is how I left the project:
http://mrdoob.com/lab/PV3D/vis/effect01/custom/

In fact, if you try it with a link to some MP3 (you can find a lot here), the swf loads the tune, you can listen to it, but the ENTER_FRAME stops and if you're running the debug version of the player it warns you with the limitation.

Do you know any solution for this besides the php script?

#permalink

Share:
Digg! ~ del.icio.us ~ Stumble ~ Furl ~ Reddit
Same thing happens with BitmapData... you can load and show any image, but you can't read the pixel info if it's on another domain. I think its BS... and I have no idea how this could improve security.
Feb 11th, 2007
Cay
Yeah, I did read about that somewhere. I with Adobe/Macromedia justified why they introduce each limitation.
Feb 11th, 2007
mr.doob
Oh! I got and idea but I'm not too sure how will it work. Using htaccess.

You tell flash to load something in your server, like
http://myserverrulez.com/ getfile?server=anotherser ver.com&file=/directory/f ilename

Then in the htaccess you add a redirect so that each time your server gets that request, you actually forward the script to another place (which is the actual one).

Would it work?
Feb 12th, 2007
sole
and I broke your layout... oh well... O:)
Feb 12th, 2007
sole
Or maybe you didn't ;) I just added to the code the function I did for xplsv.tv's comment parsing.
Feb 12th, 2007
mr.doob
That solution sounds interesting, we could try it this evening ;)
Feb 12th, 2007
mr.doob
Webs / Print / Logos... everything I do will be listed here.



If you're looking for my Actionscript experiments, here you have: