[haXe] Re: Impossible to send backslash followed by "r" string to Neko from Flash - it gets converted to linebreak character \r

Asger Ottar Alstrup asger at area9.dk
Fri Sep 22 10:29:48 CEST 2006


To reproduce this bug, change Flash.hx in example 3 in swhx to this:

class Flash {

    static function main() {
        // connect to the desktop
        var cnx = swhx.Connection.desktopConnect();
        // save a string to the file "hello.txt"
        cnx.App.saveFileContent.call(["hello.txt", "\\rtf1\n"]);
        trace("The hello.txt file has been created !");
    }
}

Open the hello.txt file, and you will see that the expected \rtf has become
a linefeed.

If you change the string to just "\\rtf1" without the \n, it works!

(This bug exists also with SWHX 1.02)

Regards,
Asger

On 9/14/06, Asger Ottar Alstrup <asger at area9.dk> wrote:
>
> Hi,
>
> I'm trying to do this in Flash:
>
>   static var cnx : swhx.Connection;
>   cnx = swhx.Connection.desktopConnect();
>   cnx.Desktop.writeFile.call(["myfile.rtf", "\\rtf"]);
>
> to call a method in Desktop object in Neko world. The relevant Desktop
> code is this:
>
>     // write a file, asking for confirmation if it exists in advance
>     public static function writeFile( file : String, content: String) {
>         // create the file in text mode
>         var f = neko.io.File.write (file, false);
>         // write the content
>         f.writeBytes(content, 0, content.length);
>         // close the file
>         f.close();
>     }
>
> This produces 0x0d character in output, rather than \ followed by r as
> expected. It seems that the problem occurs in interface between Flash and
> Neko-world, because I can use f.write("\\r") in writeFile and that works
> correctly.
>
> Regards,
> Asger
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20060922/1f1c2def/attachment.htm


More information about the Haxe mailing list