![]() |
|
||||||||||
|
|||||
|
Вот есть такой код:
public function GalleryItem(url:String,w,h=null) { var loader=new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoaded) var req=new URLRequest(url); try { loader.load(req); } catch(err:IOError) { trace(1); } } А получается вот этот: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. |
|
|||||
|
strange mood
|
__________________
тонкий тролль, осеянный благодатью |
|
|||||
|
strange mood
|
An object dispatches a SecurityErrorEvent object to report the occurrence of a security error. Security errors reported through this class are generally from asynchronous operations, such as loading data, in which security violations may not manifest immediately. Your event listener can access the object's text property to determine what operation was attempted and any URLs that were involved. If there are no event listeners, the debugger version of Flash Player or the AIR Debug Launcher (ADL) application automatically displays an error message that contains the contents of the text property. There is one type of security error event: SecurityErrorEvent.SECURITY_ERROR. Возникает, например, когда мы пытаемся стучаться в инет из файла, открытого локально и опубликованного с дефолтной установкой Access local files only
__________________
тонкий тролль, осеянный благодатью |
|
|||||
|
Регистрация: Mar 2008
Адрес: Ростов-на-Дону
Сообщений: 354
|
Это – пример асинхронной ошибки. Такие ошибки отлавливаются не блоком try...catch, а соответствующими обработчиками событий. IOErrorEvent – ошибка ввода-вывода (например, файл не найден).
|
|
|||||
|
Цитата:
|
|
|||||
|
Регистрация: Mar 2008
Адрес: Ростов-на-Дону
Сообщений: 354
|
Да, насчёт SecurityError Вы правы. Да и по логике, плеер в момент запроса на загрузку уже знает, можно это делать, или нет. Поэтому это – не асинхронная ошибка.
А насчёт IOErrorEvent – всё в силе, только через события. |
![]() |
![]() |
Часовой пояс GMT +4, время: 20:01. |
|
|
« Предыдущая тема | Следующая тема » |
|
|