Flash loader problem

.NET Edition of the F-IN-BOX
vsesh02
Posts: 23
Joined: Mon Oct 12, 2009 7:51 am

Flash loader problem

Postby vsesh02 » Mon Oct 19, 2009 1:12 pm

Hello,

I've found a problem.
preloader doesn't work for flash / as3, when streamTostream used. All old movies (as2) work well.
The problem is new movies don't get the correct size of a file that should be loaded (ProgressEvent.bytesTotal = 0. Seems they get it from the headers instead of as2 that gets it directly from a stream).

// translated by admin

---

Добрый день! Вот заметил такую ошибку.
Не работает прелоудер у flash на AS3, когда используется streamTostream. Все старые ролики (as2) работают нормально. Проблема в том, что новые флешки не получают размер загружаемого файла (ProgressEvent.bytesTotal = 0. Видимо, они берут из headers, а as2 из самого потока).

пример

Code: Select all

            WebRequest request = WebRequest.Create(URL);

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            Stream FromStream = response.GetResponseStream();


            FromStreamToStreamWriter writer =
               new FromStreamToStreamWriter(
                  FromStream,
                  Stream
               );

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon Oct 19, 2009 4:40 pm

Thank you for your question.

Just set the length:

Code: Select all

 Stream FromStream = response.GetResponseStream();

Stream.SetLength(FromStream.Length); // <-- here!


            FromStreamToStreamWriter writer =
               new FromStreamToStreamWriter(
                  FromStream,
                  Stream
               );


Thank you.
Last edited by Softanics on Tue Oct 20, 2009 5:34 am, edited 1 time in total.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

vsesh02
Posts: 23
Joined: Mon Oct 12, 2009 7:51 am

Postby vsesh02 » Tue Oct 20, 2009 4:27 am

Stream который отправляется во flash доступен только для чтения

Невозможно присвоить значение свойству или индексатору "System.IO.Stream.Length" -- доступ только для чтения.

а все разобрался Stream.SetLength()


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 16 guests

cron