Change “import lime.net.URLRequest;
” to “import openfl.net.URLRequest;
” at the top of the file.
je l’avais déjà essayé ! mais ça ne fonctionne pas.
Alors, repartons du début, sous FlashDevelop 4.7, je crée un projet Haxe/openFL. Je laisse tout par défaut, donc, compilation target = “custom build” et test project=“run custom …”.
Je suppose donc que ces choix repose à présent sur le fichier project.hxml.
dans le menu déroulant de compilation proposé par FD, je sélectione neko simplement parce que j’ai remarqué que c’est le plus rapide.
le code de Main.hx est le suivant:
package;
import openfl.display.Sprite;
import openfl.media.Sound;
import openfl.net.URLRequest;
/**
* ...
* @author Alain Mazy
*/
class Main extends Sprite
{
public function new()
{
super();
var url:URLRequest = new URLRequest("lib\flo.mp3");
var snd:Sound = new Sound("lib\flo.mp3");
snd.play();
}
}
Et j’ai l’erreur suivante:
src/Main.hx:19: character 38 : Invalid escape sequence
Build halted with errors.
Try “lib/flo.mp3” or “lib\\flo.mp3”
Be aware, though, due to the $2000 (or $3000?) licensing cost PER GAME for MP3 (according to Fraunhaufer) we’ve elected not to support it (no one has told me they want it for that price ) so OGG will work on native and some browsers, MP3 works in some browsers and on Flash, WAV works on native, Flash and most browsers
If you target HTML5, it will automatically look for the same file (sans the file extension) in all three formats to try and support all browsers
Discours seems to escape a double ‘’, so “lib\\flo.mp3”.
thanks, I missed that