actionscript-3

FileReference vs File?

爷,独闯天下 提交于 2019-12-14 02:16:29
问题 I want to make a Flash app in which the user can load and save files from and to their local hard drive. While I've often done this in AIR apps using the File and FileStream classes, I haven't done so before in an SWF. From what I know the FileReference class is used for this, although it seems to have some restrictions due to security risks. I'd like to know what the main differences are between using the FileReference class and using the File and FileStream classes to load and save files.

Why does AS3 not use weak references by default? (in event listeners)

半城伤御伤魂 提交于 2019-12-14 02:13:41
问题 The default value for weakReference in the call to addEventListener() is false. Many memory issues can be resolved by using weakReferences; in fact, some industry experts "strongly recommend always using weak references with listeners". If this is the case, can someone provide me with a good reason why weakReference defaults to true? (Note that I'm not asking why someone would ever want a listener that is not a weakReference, but rather why weakReference=false is the default) Thanks! :) 回答1:

AS3 Stop character from moving through walls

此生再无相见时 提交于 2019-12-14 02:10:53
问题 I want to stop the movieclips movement when it hits a wall (another movieclip). The example below works, but after the collision the movieclip 'blocks' all movement to the left... My question to you is, is this a good way and why isn't it working well? There will be something wrong in this code, but i'm learning. For now the example with the leftArrow key; variables to check the key, if it's hitting the walls and if it's moving or not: var leftArrow:Boolean; var speed:int = 10; var hitting

ExternalInterface gives me an option of stopping the script when using multiple parameters. Why?

自闭症网瘾萝莉.ら 提交于 2019-12-14 01:47:05
问题 First version: ExternalInterface.call("$(document).trigger", "opened_file_chooser"); Second version: ExternalInterface.call("$(document).trigger('opened_file_chooser')"); If I use the first version, it's much, much slower than the second. Also, the browser blocks, and after a few seconds Firefox shows me the dialog with "A script is not responding ... " and it offers me the possibility of stopping it. If I use the 2nd version, the call to Javascript is instantaneous. Is there a way I could

Drawing an honeycomb with as3

此生再无相见时 提交于 2019-12-14 01:46:45
问题 I'm trying to create an honeycomb with as3 but I have some problem on cells positioning. I've already created the cells (not with code) and for cycled them to a funcion and send to it the parameters which what I thought was need (the honeycomb cell is allready on a sprite container in the center of the stage). to see the structure of the cycle and which parameters passes, please see the example below, the only thing i calculate in placeCell is the angle which I should obtain directly inside

iPad Pro icon and launch image

和自甴很熟 提交于 2019-12-14 01:21:37
问题 I'm developing an adobe air based app for iOS and I need to know the names for the recently added assets for iPad Pro - launch image(2048 x 2732) and icon (167x167). Unfortunately it's hard to guess their names based on previous ones. 回答1: I found that Default-Landscape-1366h@2x.png Default-Landscape-1366h.png works for iPad Pro as launch images. They both should be 2732x2048. Don't know if it suits portrait orientation. Also looking for correct icon names. 来源: https://stackoverflow.com

Problem with instance names inside Button

穿精又带淫゛_ 提交于 2019-12-14 00:58:45
问题 I've created a button in Flash, and inside that I have a TextField and a MovieClip, both with instance names set. They cover all 4 frames of the button, with no keyframes. I found I couldn't access the objects using the instance names I'd set, so I used this piece of code to see what's going on: var obj:DisplayObject = this.m_graphics.btnChange.upState; for ( var i:int = 0; i < obj.numChildren; i++ ) { trace( "We have an object at " + i + " - " + obj.getChildAt( i ) + ": " + obj.getChildAt( i

flex tree gets chopped even after using scroll bar

最后都变了- 提交于 2019-12-14 00:40:27
问题 when i use the following tree renderer class the the informtions in the tree gets chopped. Is there any solution to fix this bug. please help me. The PLTree class is as follows: import flash.events.Event; import mx.events.ScrollEvent; import mx.controls.Tree; import mx.core.ScrollPolicy; import mx.core.mx_internal; import mx.events.TreeEvent; public class PLTree extends Tree { private var _lastWidth:Number = 0; private var _lastHeight:Number = 0; public function PLTree() { super();

Why does URLStream complete event get dispatched when the file is not finished loading?

巧了我就是萌 提交于 2019-12-14 00:34:36
问题 I'm writing an AIR kiosk app that every night connects to a WordPress server, gets a JSON file with paths to all the content, and then downloads that content and saves it to the kiosk hard drive. There's several hundred files (jpg, png, f4v, xml) and most of them download/save with no problems. However, there are two f4v files that never get downloaded completely. The complete event does get dispatched, but if I compare the bytesTotal (from the progress event) vs bytesAvailable (from the

Getting Bitmap from Video decoded with Nestream AppendBytes (AS3)?

守給你的承諾、 提交于 2019-12-13 23:01:21
问题 I am wondering if someone who has handled NetStream.appendBytes in Flash knows how to get the bitmapData from a decoded video frame? I have already looked at this question but that is from 3 years ago and the more recent comment/answer seems to be gone. In 2014 has anyone managed to turn those bytes into a bitmap? I am working with Flash Player 11.8 and this is not a desktop/AIR app. In the image below I can do steps 1) and 2) but there's a brick wall at step 3) The problem is that simply