actionscript

Lint tool for actionscript?

你说的曾经没有我的故事 提交于 2019-12-09 02:19:49
问题 Are there any lint tools available for actionscript? One source would be ideal, but anything is welcome. My team is starting to adopt more a more rigorous style guide (where "more rigorous" means "existant"), and I think a linter would help us all adhere more easily to the style rules we've agreed on. I'm not above writing my own, but I'd like to see what else is out there first. A quick search on Google reveals nothing (at least so far). 回答1: If you're dealing with Flex, take a look at

ActionScript code to convert bytes to kb, mb, gb etc

…衆ロ難τιáo~ 提交于 2019-12-09 00:40:58
问题 I have a utility function that will display a filesize in an appropriate form like Windows Explorer does, i.e; convert it to nearest KB, MB, GB etc. I wanted to know if the code that i wrote is correct, and if it can be made simpler. The function that i wrote is as follows : public static function formatFileSize(bytes:int):String { if(bytes < 1024) return bytes + " bytes"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Kb"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Mb";

Actionscript 3D engine

帅比萌擦擦* 提交于 2019-12-08 21:01:37
I'm new to 3D, so asking for help. I need to make walking simulator on AS3: first-person view, moving through rooms and corridors. I don't need any physics, only moving and looking. Could someone tell me, what's the best actionscript-3 3d framework to implement needed functionality? Explanation is welcome :) Thanks! Away3D. Best open source (and probably best of all) 3D engine on flash. You can either do this using the old away3D version for flash player 10 and under, or using away3D for the new Molehill 3D api's. Links: Away3D 4.0 (Molehill APIS) http://away3d.com/ Away3D 3.5 For Flash 10 and

In Actionscript 3, what is the difference between the “in” operator and the “hasOwnProperty” method?

拟墨画扇 提交于 2019-12-08 14:47:05
问题 The "in" operator and "hasOwnProperty" methods appear to be interchangeable, but I'm wondering if one is checking for inherited properties or something and the other isn't or something like that. I'm especially interested in the case of using it with a Dictionary, but I doubt that is different from other uses. "hasOwnProperty" is described in the official docs here and "in" is described here, but if there is a difference, I didn't find it very clear. 回答1: Trusting the preciously accepted

How to detec face, eyes, lips in flash as3

痞子三分冷 提交于 2019-12-08 14:20:25
问题 Pls help me, I want demo detec face, eyes, lips on image but i research not found. Thank all!!!! 回答1: You could try a library like the Oddcast Face Detection API, which tracks points like the eyes, the nose and the chin. http://www.oddcast.com/dev/facedetectionAPI/ You need to buy a license for this API. There are a couple of other libraries for face detection with Flash, but this is the only one so far that tracks different features, like the eyes. 来源: https://stackoverflow.com/questions

stage.addEventListener inside a package?

瘦欲@ 提交于 2019-12-08 13:33:12
问题 I am trying to do something like this: package com.clicker{ import flash.display.*; import flash.events.MouseEvent; public class Stager extends MovieClip { public function clicker():void { stage.addEventListener(MouseEvent.CLICK, do_stage); } function do_stage(e:MouseEvent):void { trace("stage clicked"); } } } But, I get the 1009 error. When I do this: import com.clicker.*; var test:Stager = new Stager(); test.clicker(); addChild(test); Please help me. Thank you very much in advance, and

How to read excel(2007+ xlsx) sheet using actionscript(AIR)?

可紊 提交于 2019-12-08 13:20:35
问题 How to read excel(2007+ xlsx) sheet using actionscript(AIR)? 回答1: as3xls An Actionscript 3 library for reading and writing Excel files. Currently reading numbers, text, and formulas from Excel version 2.0-2003 and writing numbers, text, and dates to Excel 2.0 is supported. No server-side help is needed. SUPPORT INFORMATION Documentation and samples are at http://code.google.com/p/as3xls/ 回答2: I wrote this: https://github.com/childoftv/as3-xlsx-reader I'd love to know if it helps 回答3: Do you

Export SWC from Flash and Access Child from Flex

流过昼夜 提交于 2019-12-08 12:59:55
问题 I'm creating an actionscript project in Flex Builder. I succeed to export from Flash a SWC file, and to use it succesfully in Flex. I have a good programming background and Flex looks very simple for me, but I have difficult times in flash. I'm trying to achieve something that might be very simple(not for me of course): I create a simple shape in Flash, convert it to symbol. Then I create a TextField. The I select both the elements and convert them to another symbol, and Export it as a

AS3 TextField AntiAliasType breaks WordWrap

妖精的绣舞 提交于 2019-12-08 11:08:42
问题 I am dynamically creating and populating a TextField in AS3. I have embedded some fonts into my library (using Flash) and am setting the font of the text field using TextFormat. Because of the limited width of the TextField I have textfield.multiline = true; and textfield.wordWrap = true; , however I have noticed that the fonts look a little pixelated. To fix this I am using textfield.antiAliasType = AntiAliasType.ADVANCED; which makes the text look nice, but stops the word-wrap from working.

netstream play in the middle of a video

一世执手 提交于 2019-12-08 11:01:35
问题 I'm using the netstream and video object to play a video in flash. Specifically a mp4 video. What I'm trying to do is start playing the file from a specific position (Ex. 20seconds). However with netstreamObject.seek(20) doesn't work unless the stream has been loaded past 20seconds. Is there a way to specify starting to load at 20s? Or any other way of accomplishing this? 回答1: You can use some sort of CDN cache server (so the actual file will be served via this cache server) which support