urlloader

URLLoader data to BitmapData

谁都会走 提交于 2019-12-07 05:47:55
问题 I'm trying to load an image file that's right next to the .SWF file. Something like this: var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.BINARY; loader.addEventListener(Event.COMPLETE, function(e:Event):void { trace(typeof(loader.data)); graphic = spritemap = new Spritemap(loader.data, 32, 32); ... } But this is the output I get: object [Fault] exception, information=Error: Invalid source image. The thing is loader.data has the image's bytes but is not a

How to url-loader multiple images in webpack?

☆樱花仙子☆ 提交于 2019-12-06 14:23:28
问题 My webpack config: { test: /\.(png|jpg)$/, loader: 'url?limit=8192' } In my project, I must loader images like this: import homeBg1 from './image/homeBg1.jpg'; import homeBg2 from './image/homeBg2.jpg'; import homeBg3 from './image/homeBg3.jpg'; The operating cumbersome, who can give me some advice?Thx! 回答1: This code will import all *.jpg files from image folder: var requireContext = require.context("./image", true, /^\.\/.*\.jpg$/); requireContext.keys().map(requireContext); More about

How to upload BitmapData to a server (ActionScript 3)?

天涯浪子 提交于 2019-12-06 13:18:15
问题 I have bitmapData. I want to upload it to a server using URLLoader. I tried many ways, but with no result. This is my current code in ActionScript 3: import flash.net.URLLoader; import flash.net.URLRequest; import mx.graphics.codec.JPEGEncoder; ... var jpg:JPEGEncoder = new JPEGEncoder(); var myBytes:ByteArray = jpg.encode(bitmapData); var uploader:URLLoader = new URLLoader(); var request:URLRequest = new URLRequest("uploadFile.php"); request.contentType = "application/octet-stream"; request

How to url-loader multiple images in webpack?

半腔热情 提交于 2019-12-04 20:14:02
My webpack config: { test: /\.(png|jpg)$/, loader: 'url?limit=8192' } In my project, I must loader images like this: import homeBg1 from './image/homeBg1.jpg'; import homeBg2 from './image/homeBg2.jpg'; import homeBg3 from './image/homeBg3.jpg'; The operating cumbersome, who can give me some advice?Thx! This code will import all *.jpg files from image folder: var requireContext = require.context("./image", true, /^\.\/.*\.jpg$/); requireContext.keys().map(requireContext); More about require.context : https://webpack.github.io/docs/context.html#require-context 来源: https://stackoverflow.com

How to upload BitmapData to a server (ActionScript 3)?

怎甘沉沦 提交于 2019-12-04 19:24:07
I have bitmapData. I want to upload it to a server using URLLoader. I tried many ways, but with no result. This is my current code in ActionScript 3: import flash.net.URLLoader; import flash.net.URLRequest; import mx.graphics.codec.JPEGEncoder; ... var jpg:JPEGEncoder = new JPEGEncoder(); var myBytes:ByteArray = jpg.encode(bitmapData); var uploader:URLLoader = new URLLoader(); var request:URLRequest = new URLRequest("uploadFile.php"); request.contentType = "application/octet-stream"; request.data = myBytes; uploader.load(request); I take an object bitmapData and encode it to jpg. After that I

Unable to resolve absolute url() paths for background images in CSS with Webpack

大兔子大兔子 提交于 2019-12-04 11:44:06
问题 I have the following Webpack config (roughly, it has been simplified for this post): const rootPublic = path.resolve('./public'); const LOCAL_IDENT_NAME = 'localIdentName=[name]_[local]_[hash:base64:5]'; const CSS_LOADER = `css?sourceMap&${LOCAL_IDENT_NAME}&root=${rootPublic}`; const SASS_LOADER = 'sass?sourceMap&includePaths[]=' + path.resolve(__dirname, './src/styles'); // ... loaders: loaders: [ { test: /\.(jpe?g|png|gif|svg)$/, loader: 'url-loader?limit=10000&name=[path][name].[ext]' }, {

Flash/AS3 - is there a limit to the number of simultaneous URLLoader.load() requests?

大兔子大兔子 提交于 2019-12-04 04:44:08
问题 All, I'm working on an Flash/AS3 project that makes numerous URLLoader.load() requests. Should I queue them so that there's only a single open request at any time? Or, is it a good practice to allow multiple open requests? Is there a limit to the number of open requests? (I'm assuming I can manage the implications in the UI). I've run tests locally with up to 5 simultaneous requests, and it works just fine. But I need to make sure the application will work in the field, for users with older

Webpack [url/file-loader] is not resolving the Relative Path of URL

天涯浪子 提交于 2019-12-03 07:04:11
I am facing a problem in Webpack regarding Relative Path. Let me try to explain the scenario : I have 2 separate project in Workspace directory : Project-A [Bundling using Gulp] : Stable & Working Project-B [Bundling using Webpack] : New project As both the projects are using same Styling, so I wanted to reuse the SCSS files [consisting of standard variables, predefined layouts, modals, classes etc] of Project A into Project B . Now, if I am trying to import Project-A index.scss in Project-B index.scss as another partial [ Commenting out the Background Image URL Depency ], webpack is able to

Flash/AS3 - is there a limit to the number of simultaneous URLLoader.load() requests?

拈花ヽ惹草 提交于 2019-12-01 21:10:00
All, I'm working on an Flash/AS3 project that makes numerous URLLoader.load() requests. Should I queue them so that there's only a single open request at any time? Or, is it a good practice to allow multiple open requests? Is there a limit to the number of open requests? (I'm assuming I can manage the implications in the UI). I've run tests locally with up to 5 simultaneous requests, and it works just fine. But I need to make sure the application will work in the field, for users with older PCs, older browsers, browsers with multiple open tabs, etc. Many thanks in advance for any advice and

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

怎甘沉沦 提交于 2019-11-30 04:45:48
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"; //**THIS CAUSES ERROR** Cannot find module '../../images/logo.png' @Component({ selector: 'my-header', /