urlloader

How to access AS3 URLLoader return data on IOErrorEvent

我的未来我决定 提交于 2019-12-22 09:30:07
问题 I'm writing an actionscript library for an api. I use a URLLoader object to load data from the api. The problem I'm having is that whenever the api returns an http status in the 400s, actionscript treats this as an io error. This is all find and good, however, it seems like there is no way to access any data that was returned if this is the case. Consequently, any helpful xml about the cause of the error that gets returned is lost. Is there any way around this? It makes the library kind of a

Image Upload progress using URLLoader AS3

荒凉一梦 提交于 2019-12-21 09:33:55
问题 I am developing image uploader in Flash. I use FileReference.browse to browse image then resize this image to 1000 x 1000 px, if the image is very big and then upload to server. I want to show progressbar for the image upload progress. I am usinng URLLoader to send binary data of the resized images, but ProgressEvent on URLLoader doesn't work the way it is supposed to work. It is fired only after the image is completed uploaded instead of showing intermediate progress. ProgressEvent on

webpack not able to import images( using express and angular2 in typescript)

你离开我真会死。 提交于 2019-12-17 23:27:58
问题 I am not able to import images in my headercomponent.ts. I suspect it is because of something i am doing wrong while compiling ts(using webpack ts loader) because same thing works with react( where the components are written in es6) The error location is //headercomponent.ts import {Component, View} from "angular2/core"; import {ROUTER_DIRECTIVES, Router} from "angular2/router"; import {AuthService} from "../../services/auth/auth.service"; import logoSource from "../../images/logo.png"; //*

Webpack inline font with url-loader

孤街醉人 提交于 2019-12-12 10:49:27
问题 I’m trying to inline some fonts as base64-encoded Data URI’s but am having no luck with Webpack’s url-loader. Which is weird because the url-loader seems to be doing just that for my image and svg files. My setup is below: directory structure root/ |-src/ |--assets/ | |----fonts/ | icon-fonts/ | fontawesome.woff2 | |----styles/ | fonts.css | |--components/ | main.component.js |... webpack.config.js module: { loaders: [ { test: /\.(jpg|png|svg|woff2)$/, exclude: /node_modules/, loader: 'url

Why don't IOErrorEvents contain the URL when running standalone?

旧巷老猫 提交于 2019-12-12 06:46:29
问题 Here is a simple example of an URLLoader. var loader:URLLoader = new URLLoader(); var request:URLRequest = new URLRequest("http://example.com/doesntexist.txt"); loader.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent){ textbox.text = e.toString(); // Text box on stage }); loader.load(request); This behaves weirdly. When running from Flash or debugging from Flash, the error looks like this. [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error

Uploading data with Flex and getting the bytes sent

*爱你&永不变心* 提交于 2019-12-11 06:05:26
问题 I want to upload data (not a local file) with Flex (4.1), and show what the progress is of the bytes sent. Now I use a URLLoader, but I know that URLLoader was designed to download data, I can connect a listener to ProgressEvent.PROGRESS but that has no effect. I also know there is a FileReference object which supports uploading. The problem here is, I do not want to browse for a file and upload it. I have a byte array which I want to send to the server, but the data property of FileReference

AS3 Resetting UrlLoader Cache

我与影子孤独终老i 提交于 2019-12-11 03:42:36
问题 Good Day, I’ve encountered problems with the cache of the UrlLoader in Actionscript 3. I make a UrlRequest to a php site to get a timestamp. When I call initiate the class (which contains the function) a second time, the result is the same. I have to close the application and restart it to get a new request. I have tried "loader = new loader." and also using headers. The option of creating a unique URL for every request like here , does not work for me since it would sabotage my php action..

Why does module parse failed: /xxx/MyFont.ttf Unexpected character ''

北城以北 提交于 2019-12-11 02:27:38
问题 I encountered this error ERROR in ./src/style/MyFont.ttf Module parse failed: /xxx/MyFont.ttf Unexpected character '' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file)` when I import my custom font in my less file like this: @font-face { font-family: "MyFont"; src: url("./MyFont.ttf") format("truetype"); } my webpack config is as follow: rules: [ { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader', query: babelQuery },

Combining URLRequest, URLLoader and Complete Event Listener In Actionscript 3.0?

老子叫甜甜 提交于 2019-12-11 00:45:39
问题 when handling data, i always have to write the following: var dataSourceRequest:URLRequest = new URLRequest("/path/file.xml"); var dataSourceLoader:URLLoader = new URLLoader(dataSourceRequest); dataSourceLoader.addEventListener(Event.COMPLETE, handleDataSource); while i can understand the usefulness of these 2 objects and event listener being separate, since they often work with each other i'd like to know if there is a method that will combine them all? the closest i can get is this, but it

System.setClipboard() inside event handler

丶灬走出姿态 提交于 2019-12-08 11:28:34
问题 Any thoughts on a good way to accomplish something along the lines of var request:URLRequest = new URLRequest("http://myurl.com"); var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, function(event:Event):void { System.setClipboard(loader.data); }); in actionscript 3? It seems as if System.setClipboard() isn't available inside an event handler (which makes at least some sense given what I know about Flash security). Is there any way to: get it to work? or block on