actionscript-3

Creating multiple read-only properties dynamically in AS3

纵然是瞬间 提交于 2020-01-03 15:31:53
问题 I have a class which at the moment is quite messy/repetitive: public class AvFramework extends Object { // vars private var _handler:AvHandler; private var _keyboard:AvKeyboard; private var _manager:AvManager; /** * Constructor */ public function AvFramework() { _handler = new AvHandler(); _keyboard = new AvKeyboard(); _manager = new AvManager(); // attach _handler.framework = this; _keyboard.framework = this; _manager.framework = this; } /** * Getters */ public function get keyboard()

as3 AIR for android - Application-sandbox content ERROR

帅比萌擦擦* 提交于 2020-01-03 13:11:15
问题 THE GOAL: I am trying to allow externally loaded swf files communicate with each other that are locally loaded from the device. I need to be able to have access to vars and functions and objects. I have accheived this while loading swf content from the web here: as3 externally loaded swf from network to control externally loaded swf from network BUT WHEN I GIVE THE USER THE OPTION TO LOAD FROM DEVICE OR FROM ONLINE ... The device swf files can't communicate with each other. Specifically the

Variable declaration performance on loops in Actionscript 3

放肆的年华 提交于 2020-01-03 12:05:50
问题 Despite all known blogs about this issue i always doubt some results and my personal tests shows that the well-said standard isn't the best. Declaring variables inside the loop, to keep them close to its scope and make it faster to be reached by the method but allocating more memory or declaring outside the for scope to save memory allocation but increase processing to iterate in a distant instance. My results shows that method B is faster(sometimes), i want to know the background around this

multiple languages in the same project in Intellij idea

余生长醉 提交于 2020-01-03 10:57:49
问题 In intellij IDEA, I am working with Java & ActionScript in the same project. The Java SDK is the default of the project. When I want to program in ActionScript, several classes are not available (eg. String). The former point happens because the project is not using the ActionScript SDK, I guess. Then my question is: Is it to possible use multiple languages (two in this case) in the same IntelliJ IDEA project? If the answer is "Yes", then How can I do? Thanks in advance 回答1: If your

multiple languages in the same project in Intellij idea

◇◆丶佛笑我妖孽 提交于 2020-01-03 10:57:35
问题 In intellij IDEA, I am working with Java & ActionScript in the same project. The Java SDK is the default of the project. When I want to program in ActionScript, several classes are not available (eg. String). The former point happens because the project is not using the ActionScript SDK, I guess. Then my question is: Is it to possible use multiple languages (two in this case) in the same IntelliJ IDEA project? If the answer is "Yes", then How can I do? Thanks in advance 回答1: If your

as3 determine if camera access was denied

♀尐吖头ヾ 提交于 2020-01-03 08:27:06
问题 How can I determine if access to the camera and mic were denied in Flash? I can get the camera and mic, but I need to know if the user denied access. 回答1: Attach a status event listener and check if the camera is muted, see docs: Dispatched when a camera reports its status. Before accessing a camera, the runtime displays a Privacy dialog box to let users allow or deny access to their camera. If the value of the code property is "Camera.Muted", the user has refused to allow the SWF file access

How to determine if a string contains a specific substring

╄→гoц情女王★ 提交于 2020-01-03 07:21:08
问题 Given a string A , how can I determine if that string contains the substring "video/x-flv" ? 回答1: A.indexOf("video/x-flv") >= 0 回答2: This is a little old now, but try if(A.indexOf(video/x-flv) != -1){ //Found it } indexOf will return -1 if the substring doesn't appear in it. So if it's anything but -1 it means it does exist, Hope this helps although I'm probably a bit late! 回答3: http://www.gskinner.com/blog/archives/2007/04/free_extension.html gSkinner hasText() function EDIT: NO Sorry -

format of ByteArray returned from C is invalid

此生再无相见时 提交于 2020-01-03 06:36:14
问题 following is code snippet: AS side:(img is reference to an <Image> instance) bitmapData = Bitmap(img.content).bitmapData; var pixels:ByteArray = bitmapData.getPixels(bitmapData.rect); pixels.position = 0; var output:ByteArray = new ByteArray(); img_width = bitmapData.width; img_height = bitmapData.height; ////invoke C code by alchemy lomoEncoder.encode(pixels, output, img_width, img_height); var newImage:Image = new Image(); //can't show the image newImage.source = output; C code: AS3_Val

Targeting Flash Player 10.3 in Adobe Flash CS5

柔情痞子 提交于 2020-01-03 06:06:54
问题 Has anyone successfully tried using Microphone.getEnhancedMicrophone() method in Adobe Flash CS5? I tried all these steps; Step 1: Go to the locaiton C:\Program Files\Adobe\Adobe Flash CS5\Common\Configuration\ActionScript 3.0 Step 2: Create a new folder with the name "FP10.3" Step 3: Copy the file and paste it in the following location: C:\Program Files\Adobe\Adobe Flash CS5\Common\Configuration\ActionScript 3.0\FP10.3 Step4: Rename the swc name to "playerglobal.swc" Step 5: Goto the

Flash Play/Pause sound toggle button

筅森魡賤 提交于 2020-01-03 06:05:11
问题 I've googled and googled but got no where or outdated tutorials. Anyone know how to make it so I can toggle audio with buttons using ActionScript 3 on Flash? 回答1: To toggle play/pause you will need to record the position of where the user has paused the audio. To use a sound from the library like in your screenshot, you need to make that sound file available to your Actionscript. First, Right click the sound file in your Library and click on Properties... . Inside the Properties window, check