actionscript-3

Binary math on Number objects limited to 32 bits?

与世无争的帅哥 提交于 2019-12-24 12:27:35
问题 Consider the following code: var combined:Number = Number(4294967296) | Number(2403025069); var testLimit:Number = 6697992365; trace("Combined is:", combined, "should be", testLimit); Output is: Combined is: -1891942227 should be 6697992365 Why?! I thought Number datatypes can hold 64 bit integers (okay- really 52-bit, but the numbers above are nowhere near that limit) 回答1: From the documentation: | bitwise OR Operator Converts expression1 and expression2 to 32-bit unsigned integers , and

AS3 XML delete node

痴心易碎 提交于 2019-12-24 12:16:59
问题 I have this XML structure: <dbase> <employee> <Name>NAME</Name> <Surname>SURNAME</Surname> <Company>COMPANY</Company> <Date>DATE</Date> <Compare>1377390433625</Compare> </employee> </dbase> I'd like to know how to search for the Compare value an delete the employee if there is a match. I'll appreciate any feedback. 回答1: Maybe the following code will be useful. Assuming that the xml structure will be like this: <dbase> <employee> <Name>NAME</Name> <Surname>SURNAME</Surname> <Company>COMPANY<

AS3 Modify stage Objects from a class

拟墨画扇 提交于 2019-12-24 12:14:14
问题 In an external class i'm trying to modify a property of a stage object, Apple. I want to set it visible so i put in my code: Apple.visible =true; but it says that Apple is not defined, probably because it doesn't refeers to the stage one... how can I "import" it in my class? 回答1: Try something like: DisplayObjectContainer(stage.getChildAt(0)).getChildByName("Apple").visible = true; where stage.getChildAt(0) is "Main Timeline" movie, that contains all inner objects. 来源: https://stackoverflow

AS3 Event listeners when data is changed?

99封情书 提交于 2019-12-24 12:06:34
问题 Hopefully you will excuse me if this is a simple/silly question. I started learning action script about 6 days ago and already working on a small project :D Anyways, there is a property that changes occasionally to reflect the name of a level in a game (object._I._M.text). It could take a minute to change, or a max of two minutes, depending on how fast all players are able to finish the level. I want to be able to listen for the change in this property to fire off another function. I have

Flex full screen mode

戏子无情 提交于 2019-12-24 12:03:49
问题 I'm new in flex. I faced problem to make full screen in flex 3.My layout container type like below. <mx:Application > <mx:Panel> <mx:ViewStack> <mx:VBox > <mx:VBox > <mx:Canvas > <mx:HBox width="300" height="300"> </mx:HBox> </mx:Canvas> </mx:VBox> </mx:VBox> </mx:ViewStack> </mx:Panel> </mx:Application> the container width and height will be fixed like above.Then when i click a button full screen it will be full screen mode. Please help me with example and tutorial. best regard. Mahedi 回答1:

Flash AS3 - Display an error if the XML if incorrect

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 11:44:06
问题 I'm creating a flash application which loads in some XML which is generated dynamically from the CMS. I want to display an error in case the XML file isn't formatted correctly. When I test this with incorrectly formatted XML, it will just get to the line myXML = XML(myLoader.data); and then just bomb out. How can I catch the error, display a message to the user, but the flash program to continue as normal. var myXMLURL:URLRequest = new URLRequest(XMLfile); var myLoader:URLLoader = new

Flash AS3, save and load data for iOs and android games

ε祈祈猫儿з 提交于 2019-12-24 11:36:16
问题 I'm trying to make games for iOS and Android. How do I save data to the gadget, and also how do I load it? The data that I want to save to the user device is basically just a bunch of strings. Kindly help please. And by the way, I'm using Flash CS6 for the game. 回答1: The SharedObject class should do fine for you. The attributes you write/read can be of any type (String, Array, Number, Boolean, XML, ...). Basic example: var scores : Array = new Array(10, 20, 30); var my_so : SharedObject =

singleton class in Flex

孤街醉人 提交于 2019-12-24 11:22:07
问题 I know singleton class is not supporting in Flex.Because it does not access private constructor. But i want to make a class is singleton class. Please anyone can explain with example. Thanks, Ravi 回答1: A singleton is a class of which only one instance will be created. This instance will be shared by all other code in the program. A singleton in the strictest sense is not supported in ActionScript because a constructor cannot be marked private . Consequently, additional instances of the class

how to keep a nativewindow on top

懵懂的女人 提交于 2019-12-24 10:49:03
问题 I need to keep a NativeWindow I am creating on top of the main window of the application. Currently I am using alwaysInFront = true, which is not limited to the windows in the application. I can successfully synchronize the minimize/restore/move/resize actions, so the top window behaves appropriately in those cases. Even though using this option has the drawback that if I alt-tab to other application the window goes on top of the other application. Because of the above I am trying to get it

How to restrict a Flex application to only run from my website?

人盡茶涼 提交于 2019-12-24 10:47:56
问题 is it possible to make a Flex-application to only run from my domain? So a user can't copy the .swf and start it locally. 回答1: In a lot of cases this won't work because of the security model associated with the crossdomain.xml. http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html Say for example, I have a flex app that has a service call and login to my backend database (perhaps PHP and mysql). Unless I explicitly enable it in crossdomain.xml policy file the app will not be