flash

When POSTing a form with URLRequest, how to include cookies from browser session?

半世苍凉 提交于 2019-12-21 17:47:57
问题 (With reference to this answer:) When I POST with a URLRequest, does it automatically include cookies from the browser session in which Flash is hosted? If not, how can I make it include them, or if necessary retrieve them and include them myself? 回答1: Provided the cookie domains (of the page hosting the Flash control and the URL to which you're posting) match, then yes, the browser cookies get sent with the request by default. As a quick example (working version here), I've thrown together a

Speex or nellymoser

北战南征 提交于 2019-12-21 17:44:33
问题 I am developing a voice application, I have 2 options speex and nellymoser .Why should I use speex instead of nellymoser in flex application. 回答1: this should make it clear , Comparison of both codecs for flex: http://askmeflash.com/article/2/speex-vs-nellymoser 回答2: Speex is open source, optimized for speech and seems to have lower bandwidth requirements. However, in Flash/AIR, Speex is always 16 kHz, which is not quite the Skype-like crispness of the sound. Because of that, we're currently

video.js - controls not displaying in IE8

孤人 提交于 2019-12-21 17:29:33
问题 I'm implementing videojs and have it working in all browsers however the controls are not visible and the play button is broken in IE8 with Flash fallback. Following some digging, I've ensured that I'm using the latest versions of js and css by linking to the cdn. Saw a reference to "boxWidth = box.offsetWidth" but I believe this was corrected since v3.2. The code is as follows and served up via an iframe in colorbox.js <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

Drawing a hex grid in Flash?

瘦欲@ 提交于 2019-12-21 17:27:49
问题 What's the easiest way to draw a hex grid algorithmically? How should I present them in data? For example, in a square grid, I could just save x-y coordinates.. 回答1: So hexagon is a neat library for AS3 games, it has some hexagon classes that might be handy in your research. This article has some very nice details about hexagon tiles in Flash. 回答2: There are several ways to manage hex map coordinates and most of them unintuitively insist on mapping them to x-y coordinates which is only

compare two images and check equality

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 16:03:31
问题 do you know any source or info about comparing images within as3/flash? I want to compare two images and check if the images are the same or not. Check this example: http://imageshack.us/photo/my-images/825/imagecompare.jpg/ Any clues? Thank you in advance! 回答1: In addition to the duplicate answers, I believe you can also use BitmapData.compare() An example taken from the link, consider the following two BitmapData objects: var bmd1:BitmapData = new BitmapData(50, 50, true, 0xFFFF8800); var

Animate object by sound amplitude?

本小妞迷上赌 提交于 2019-12-21 15:46:09
问题 I know it's possible to animate an object with sound via Actionscript. I am really hoping it is also possible to animate an object with JavaScript since they are very similar. Maybe it could be done with jQuery or HTML5. I am just hoping to find a way to do it outside of flash. Does anyone know if this is possible in any of these formats? I have done lots of research and can't seem to find any forms or tutorials that say it is possible or not. BASICALLY, I am trying to achieve this same

Set Dynamic Variable name In ActionScript 3.0

我只是一个虾纸丫 提交于 2019-12-21 13:42:15
问题 I need to set custom variable name for every iteration. Why this isn't possible? for (var i:uint = 0; i < 50; i++) { var ['name' +i] = new Sprite(); } *//1840: Syntax error: expecting identifier before left bracket* 回答1: You want to use a hash map to do this. var map:Object = {}; for (var i:uint = 0; i < 50; i++) { map['name' +i] = new Sprite(); } Otherwise you're confusing the compiler. Dynamic names for local variables aren't allowed. 回答2: There is sort of a way around this, depending on

Set Dynamic Variable name In ActionScript 3.0

Deadly 提交于 2019-12-21 13:41:12
问题 I need to set custom variable name for every iteration. Why this isn't possible? for (var i:uint = 0; i < 50; i++) { var ['name' +i] = new Sprite(); } *//1840: Syntax error: expecting identifier before left bracket* 回答1: You want to use a hash map to do this. var map:Object = {}; for (var i:uint = 0; i < 50; i++) { map['name' +i] = new Sprite(); } Otherwise you're confusing the compiler. Dynamic names for local variables aren't allowed. 回答2: There is sort of a way around this, depending on

alpha + RGB -> ARGB?

爷,独闯天下 提交于 2019-12-21 13:41:10
问题 In as3, is there a utility or function to convert an RGB color (e.g. 0xFF0000) and an alpha value (e.g. .5) into a A 32-bit ARGB value? And from ARGB to RGB + alpha? Some explanation: a bitmapdata can take an ARGB value in its constructor, but filling shapes in sprites usually takes RGB values. I would like the aforementioned utilities to ensure colors match up. 回答1: var argb : int = (alpha<<24)|rgb; var rgb : int = 0xFFFFFF & argb; var alpha : int = (argb>>24)&0xFF; 回答2: A,R,G,B is a common

How to dynamically load a progressive jpeg/jpg in ActionScript 3 using Flash and know it's width/height before it is fully loaded

陌路散爱 提交于 2019-12-21 12:48:08
问题 I am trying to dynamically load a progressive jpeg using ActionScript 3. To do so, I have created a class called Progressiveloader that creates a URLStream and uses it to streamload the progressive jpeg bytes into a byteArray. Every time the byteArray grows, I use a Loader to loadBytes the byteArray. This works, to some extent, because if I addChild the Loader, I am able to see the jpeg as it is streamed, but I am unable to access the Loader's content and most importantly, I can not change