actionscript

Checkstyle for ActionScript (Flex)

痴心易碎 提交于 2019-12-07 02:07:21
问题 HI, I'm currently working on a project that uses Flex and Java. In Java we easily enforced a coding standard with Checkstyle, and we want to do this for Flex. Does anybody know of a tool similar to Checkstyle that would allow coding standard checks? (I've googled for this but found only one project written in python and it seams abandoned) Thanks 回答1: The long and the short is that there is... kind of, but only for Actionscript, and you have to test it yourself... There is a prototype of an

Difference between Array and ArrayCollection(Flex)

此生再无相见时 提交于 2019-12-07 00:02:35
问题 What's the difference between array and arraycollection? 回答1: First, the ArrayCollection is designed for the Flex framework. It acts like a Proxy for a given Array instance. This means it can listen for modifications made to the source Array and update it self when this happens. It also contains a subset of additional methods required specifically by the framework (have a look at the IList implementation for instance). 回答2: One important difference is that ArrayCollection raises events

Actionscript Date Comparison

泄露秘密 提交于 2019-12-06 23:07:06
问题 In my Actionscript code I have two dates: var date1:Date = new Date(2011,1,1); var date2:Date = new Date(2011,1,1); This doesn't work: var equal:Boolean = date1 == date2; From reading I've found that this is a working alternative since it just gets the number of milliseconds from a standard point in time. var equal:Boolean = date1.getTime() == date2.getTime(); So my questions are: Why doesn't the normal equality operator work on Dates in actionscript? ">" as well as "<" operators seem to work

How can you overload a function in ActionScript?

眉间皱痕 提交于 2019-12-06 19:33:18
问题 I want a function to be able to take in various types. AS3 doesn't support overloading directly... so I can't do the following: //THIS ISN'T SUPPORTED BY AS3 function someFunction(xx:int, yy:int, someBoolean:Boolean = true){ //blah blah blah } function someFunction(arr:Array, someBoolean:Boolean = true){ someFunction(arr[0], arr[1], someBoolean); } How can I work around it and still have a function that is able to take arguments of various types? 回答1: If you just want to be able to accept any

Libraries for text animation in Flex / Actionscript? [closed]

我怕爱的太早我们不能终老 提交于 2019-12-06 15:53:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Are there any good libraries for cool text animation effects for use in Actionscript (for use in an intro screen or banner). I've given up tryin to use Flash itself because that takes forever, and I dont know which of the many flash text animation tools to choose from. I'd like to be able to dynamically product

flex preloader not working with # in the url (deep linking)

元气小坏坏 提交于 2019-12-06 15:08:17
I can't get flash preloaders to work when there is a a # in the url of my page (even without any deep linking libraries or logic). I am using flex 3.3. Flash plugins 9 and 10, all browsers. There is this bug regarding # in the url preventing preloaders from working: http://bugs.adobe.com/jira/browse/SDK-14162 However, somehow, someone, somewhere has ways around this. Here are somewhat working examples (remember to clear your cache to ensure you see the preloader awesomeness) : http://www.adobecards.com/index.html#wtf http://www.escriba.es/base_en.html#wtf http://www.sonypictures.com/movies

How does one declare a global variable in actionscript

北战南征 提交于 2019-12-06 15:06:21
问题 i expect some sarcasm but what the heck. i have searched the actionscript reference page and can't seem to find how to declare simple global variable. 回答1: There are a couple of good answers already. I just want to point out that YOU CAN create global variables in AS3. Just create a file, for example, MyGlobal.as in root of your classes folder: package { public var MyGlobal:String = "bla"; } And you can access it as MyGlobal because it is in the top most package. This technique can be used in

Actionscript embed an array

扶醉桌前 提交于 2019-12-06 15:05:24
I want to embed some images at compilation time so I end up with just a single swf. They need to be inside of an array as I need to modify them programatically and they can be 100s of images. Cant use flex as I want to keep the whole function in actionscript (aka make files smaller) I found how to do it in flex: ... <mx:Array id="test"> <mx:Image id="image0" source="@Embed(source='../../../lib/Images033,jpg')" /> <mx:Image id="image1" source="@Embed(source='../../../lib/Images034,jpg')" /> <mx:Image id="image2" source="@Embed(source='../../../lib/Images035,jpg')" /> <mx:Image id="image3"

How to change the coordinate origin in Flash's stage with Actionscript?

假如想象 提交于 2019-12-06 14:51:40
问题 I think I did this before but can't find the code. Flash as many other graphical frameworks use the top-left corner as the coordinate origin (0,0) because it's how the underlying memory model is by convention. But it would be really simpler for my calculations if the origin was in the center of the stage, because all the game revolves around the center and uses a lot of trigonometry, angles, etc. Is there some built-in method like Stage::setOrigin( uint, uint ); or something like that? 回答1:

Return focus to Editor after clicking a button in floating window of MAC

偶尔善良 提交于 2019-12-06 13:55:35
问题 I have created a virtual keyboard library in adobe flex. I have already created an ANE for Windows to set the keyboad always on top and non focusable. Using: int exstyle = GetWindowLong(hwnd3, GWL_EXSTYLE); exstyle |= WS_EX_NOACTIVATE; But now I have to create an ANE for the mac (OS 10.7) I have to access the keyboard (keywindow) from the running flex application Set it always on top and non focusable(even if I click on the keys or select keyboard language from combobox of the keyboard it