I recently wrote an mp3 player.
The main class of as3 to load config. xml in the xml package
Simple code:
UrlRequest = new URLRequest ("xml/config. xml ");
UrlLoader = new URLLoader ();
UrlLoader. addEventListener (Event. COMPLETE, onLoadXml );
UrlLoader. load (urlRequest );
And read the songs in config. xml.
<Song url = "music/a1.mp3"/>
Open player. SWF separately to load xml and play songs.
Only player.swfcan be opened for config.xmland a.mp3.
However, if we put index.swfto the server, the player.swf is stored in index.
An error is reported when I open it from ie.
Error #2044: unprocessed ioErrpr text = Error #2032 stream Error.
Solution:
Because the player calls the xml/config. xml file song relative to itself, it is also relative to its own music/a.mp3 file.
And add player.swf to index.swf. The relative path is not referenced by player. The index is used as a reference.
Therefore, you need to put the xml package and music package in the same directory as index.swf.
Appendix
Solve crossdomain. xml in the Security Sandbox
<? Xml version = "1.0"?>
<Cross-domain-policy>
<Allow-access-from domain = "* .cnblogs.com"/>
<Allow-access-from domain = www.anotherofSite.com/>
</Cross-domain-policy>