|
|
|||||
Регистрация: Aug 2010
Адрес: Саратов
Сообщений: 185
|
stageWebView local file не работает
Добрый день! Есть задача с помощью stageWebView воспроизвести локальный html файл.. Полазил по форумам и нашел вроде как решение. Итак, я создал в папке scr папку html и скопировал туда файл example.html
Далее пример: <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title="Заказ" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:media="es.xperiments.media.*"> <fx:Script> <![CDATA[ import flash.filesystem.File; private var webView:StageWebView; private function ini():void{ webView = new StageWebView(); webView.stage = this.stage; webView.viewPort = new Rectangle(0, 0, 150, 150); var file:File = File.applicationDirectory.resolvePath('html/example.html'); var local:File = File.createTempFile(); file.copyTo(local, true); webView.loadURL(local.url); } ]]> </fx:Script> <fx:Declarations> </fx:Declarations> <s:Button x="231" y="311" label="Кнопка" click="ini()"/> </s:View> |
|
|||||
Регистрация: Aug 2010
Адрес: Саратов
Сообщений: 185
|
Я воспользовался stagewebviewbridge, без костылей не обошлось, но все же попроще...
|
Часовой пояс GMT +4, время: 21:28. |
|
« Предыдущая тема | Следующая тема » |
|
|