Skip to main content
February 21, 2013
Question

File.applicationDirectory.resolvePath fails to return the correct path in iOS

  • February 21, 2013
  • 1 reply
  • 733 views

I have click.mp3 file in "assets/sounds/" directory.

When I try to load a sound like below, both works fine when testing on my PC but when deployed on iOS(my iPad2), #1 works but #2 will result in no sound. Am I doing something wrong?

I'm using Adobe FlashCS6 + Air3.4.


#1)

var sound = new Sound(new URLRequest("assets/sounds/click.mp3"));

#2)

var sound = new Sound(new URLRequest(File.applicationDirectory.resolvePath("assets/sounds/click.mp3").nativePath));

then sound.play();

This topic has been closed for replies.

1 reply

February 22, 2013

Please use the following.

var sound = new Sound(new URLRequest(app:/assets/sounds/click.mp3));