actionscript

odd math in actionscript 3? [duplicate]

对着背影说爱祢 提交于 2020-01-17 16:37:33
问题 This question already has answers here : Closed 10 years ago . Duplicate: Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273? Is JavaScript’s math broken? many, many other questions, for every language and platform, all with the same answer. trace( ">> " + (399.6-(Math.floor(399.6))) ); prints out >> 0.6000000000000227 why? 回答1: Floating Point rounding errors. Floating point numbers can't represent some values exactly, so what you are seeing is the

Textured text in Actionscript

梦想与她 提交于 2020-01-17 14:03:33
问题 There is any way to make a text "textured" - with a result similar to this: http://www.entheosweb.com/fireworks/patterned_text.asp In Flex (so using AS3)? I though it was a simple issue, but I'm stuck: i'm googling it from days and was not able to find aa way or workaround to do it... 回答1: The rough idea is this: Create a TextField with whatever font you need, and write whatever text you want in there. Create a new BitmapData object and draw() the TextField so that you get a bitmap

How to make an object network serialize to a file, not a SharedObject?

若如初见. 提交于 2020-01-17 08:34:31
问题 Currently, I do serialize my model object to the SharedObject instance : try { var mySo:SharedObject = SharedObject.getLocal("sig"); mySo.clear(); mySo.data.model = _model; mySo.flush(); } catch ( e:Error ) { Alert.show( 'Leider konnte kein Modell geladen werden.' ); } Likewise, I load the saved model using the SharedObject instance. Works great. Ultimately, I'd like to serialize it to a file - which fails. Here is how: var fp: File = File.applicationStorageDirectory; fp = fp.resolvePath(

IntelliJ disable warnings

十年热恋 提交于 2020-01-17 05:04:26
问题 IntelliJ displays yellow markers in the scrollbar on the right for warnings. Is there a way to disable warnings or just the yellow markers in the scrollbar? Follow-up : The file in question is from Adobe Flex SDK 4.1 frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as . I have all inspections disabled. I've also disabled the JavaScript Intention Power Pack plugin. I have Highlighting Level set to None. With all this I still see warnings. 回答1: I wouldn't disable all warnings

Adding a object randomly on the screen in as3

最后都变了- 提交于 2020-01-17 04:42:26
问题 OK, so i am having trouble with adding a box randomly on the screen. I have done this before and it seems like it should have a relatively easy solution. But alas, i have not been able to figure this out. This is the info: I have a box mc with exporting as Box. I have a Box Actionscript file with this code in it: package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; public class Box extends MovieClip { public function Box() { createBox(); }

Workers in Apache Flex 4.7

寵の児 提交于 2020-01-16 19:34:48
问题 has anyone been able to use Workers in AIR Application built with Flex 4.9.1 and AIR 3.7? I wanted to give it a try for a project, but as soon as I include/setup the worker like in the tutorial made by Lee Brimelow, my Application "freezes". Which means: It does not start. The compiler compiles, I get the info-text in the console, but neither my window opens nor my does any of my events get fired. Ideas anyone :) ? 回答1: Quite simple solution. Simply add -swf-version=XX //XX must be >=17 as a

Workers in Apache Flex 4.7

一世执手 提交于 2020-01-16 19:33:08
问题 has anyone been able to use Workers in AIR Application built with Flex 4.9.1 and AIR 3.7? I wanted to give it a try for a project, but as soon as I include/setup the worker like in the tutorial made by Lee Brimelow, my Application "freezes". Which means: It does not start. The compiler compiles, I get the info-text in the console, but neither my window opens nor my does any of my events get fired. Ideas anyone :) ? 回答1: Quite simple solution. Simply add -swf-version=XX //XX must be >=17 as a

Workers in Apache Flex 4.7

﹥>﹥吖頭↗ 提交于 2020-01-16 19:33:07
问题 has anyone been able to use Workers in AIR Application built with Flex 4.9.1 and AIR 3.7? I wanted to give it a try for a project, but as soon as I include/setup the worker like in the tutorial made by Lee Brimelow, my Application "freezes". Which means: It does not start. The compiler compiles, I get the info-text in the console, but neither my window opens nor my does any of my events get fired. Ideas anyone :) ? 回答1: Quite simple solution. Simply add -swf-version=XX //XX must be >=17 as a

Flex element includein

三世轮回 提交于 2020-01-16 19:31:49
问题 In Flex, we can assign state to an element via this: <s:Button id="mybtn" includeIn="mystate" label="button label"/> How can we do the includeIn with ActionScript? Thank you. 回答1: States are an MXML concept, not an AS concept. In AS you have to write your own logic in the override function set currentState. override public function set currentState(value:String):void { super.currentState = value; //write your logic for states } 回答2: The includeIn pseudo-attribute only exists in the MXML

ActionScript 3.0 URLRequest with Relative Link

六眼飞鱼酱① 提交于 2020-01-16 18:56:29
问题 I am trying to pass some data between PHP and Flash. In Flash I have managed to get the code below working. The problem is I want to use a relative link such as "data/config.php" however this gives me the following error: Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. I tried looking up the error but it seems to have many possible causes and I can't figure out a way around it in my case. Here is the code (this works when the url is absolute): submit_btn.addEventListener