Relative path for a music file in Flash CS5 Actionscript

AXISHK used Ask the Experts™
Any idea how to refer a music file in Actionscript if the referenced music file is one lever lower than flash file ? I'm using Adobe Flash CS5.

In myFlash.fla
song=new URLRequest("music01")

eg. \myFlash.fla

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
The song path will be like this:

var songPath:String = new URLRequest("music/music01.mp3");

Hope this helps.

Warm Regards
Deepanjan Das
Paths to external files which are a level lower should be referenced like this:


Are you using AS2 or AS3?
Right ayanaculis,
I just made a typr of using the urlrequest:

var songPath:String = "music/music01.mp3";

Warm Regards
Deepanjan Das
Then that should do it. Is this a standalone project or are you going to embed your file on a html file? If so, remember to set your path relative to the html file

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial