actionscript

Destroy Flash Objects Completely

喜欢而已 提交于 2019-12-12 04:54:34
问题 When I destroy my objects that are on the stage. I usually just removeChild(this) and I remove event listeners of the object. is this all I need to do to completely remove the object ?? 回答1: Yes... sort of. In AS3 you can not destroy objects. All you can do is remove all references to them, which makes them available for garbage collection. The next time the GC is ran, it will destroy them if they are available. It's a pretty big subject, but basically, always remember to remove all

Flash Actionscript

老子叫甜甜 提交于 2019-12-12 04:49:59
问题 It is my first time to code an actionscript for flash. I want to write a flash clip which works as a parent of another flash clip. I want to write a function in the parent flash, and call that function in the child flash clip. For example I wanna create an actionscript which sends game score to "submitscore.php". The parent is just a controller and the child is my game. I want to send game score to the controller, then send it to my php file. Do you have any sample code or something to do

calculate minutes left between hours actionscript 3

旧城冷巷雨未停 提交于 2019-12-12 04:49:24
问题 I'm using AS3 to pull XML data, one field is a time field in the XML and displays an hour. I'm getting the date and then the AS3 loads the proper node based on teh time set in the XML. This is all working perfect - I have two times as variables, one is the system time (which is set in UTC time) the other is one hour ahead. The two variables are currentHour and newHour - it's doing everything I want however I'd like to now create a countdown between these two hours and display time remaining

Flex Air - HTTPService TimeOut every time

别来无恙 提交于 2019-12-12 04:34:02
问题 On my AIR app, i use HTTPservice with PHP. PHP side : set_time_limit(0) Air side : httpService.requestTimeout = 0 it doesn't work, with httpService.requestTimeout = 0, there is a time out after 30s. The FaultEvent is dispatched, while php is still running. The PHP script goes to the end without problems. So i changed to httpService.requestTimeout = 99999 . There is no longer time out after 30s but after 120s. And it's not the FaultEvent that is dispatched but the ResultEvent. And PHP is still

How to convert string and/or array fields to act like a movie clip AS3

家住魔仙堡 提交于 2019-12-12 04:29:46
问题 My question is that how we can convert a string to to act like a movie clip OR How to convert each field of an array to to act like a movie clip. For example: var days:Array = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); and I want "Sun" to become a movie clip Or var str:String; for (var i=0; i<days.length; i++) { str = days[i]; //and then I need to convert str to to act like a movie clip each time } Thanks for your help in advance. 回答1: The easiest way to do this is as Follows:

Is Flash/Actionscript any safer than Javascript for persistent online game?

本秂侑毒 提交于 2019-12-12 04:28:34
问题 I'm finding lately how unsecure Javascript is when programming a game (I'm trying to do a turn based RPG and currently the battle calculations are done through Javascript which any player can cheat with of course giving themselves as much XP as they want), so I'm wondering if I were to move my battle screen to flash if this would be any more secure, or is there just as easy of a way to cheat this? 回答1: Come on. It's the same question really. Answer remains the same too: No matter what the

Flash Socket Policy - Policy is served, but client aborts connection to socket

时间秒杀一切 提交于 2019-12-12 04:09:40
问题 I have a service set up on port 2400. When I run the Flash client from Flash itself, it runs fine because it bypasses security policy. When I try to connect by running the SWF on my desktop, or from the browser, I see this exchange: 00000000 3c 70 6f 6c 69 63 79 2d 66 69 6c 65 2d 72 65 71 <policy- file-req 00000010 75 65 73 74 2f 3e 00 uest/>. 00000000 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 <?xml ve rsion="1 00000010 2e 30 22 3f 3e 3c 21 44 4f 43 54 59 50 45 20 63 .0"?><!D OCTYPE c

disable GC in AS3

ε祈祈猫儿з 提交于 2019-12-12 04:07:47
问题 I met a strange problem in AS3 and thought the problem may be caused by the GC, can I disable GC explicitly in AS3? Thanks. Bin 回答1: i dont think that there is a reference to garbage collection in the program, however you can use the "bugs" in the system to prevent things being cleaned up. if you make a variable that references the object you want to keep safe for example. why do you think that GC is your problem? it should only take effect when all alues are null, nothing references the

How do I access the root element of an MXML document if I can't set an id?

夙愿已清 提交于 2019-12-12 04:04:45
问题 If I wanted to do something like this: <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" horizontalScrollPolicy="off" verticalScrollPolicy="off" xmlns:view="com.foo.bar.view.*" > <mx:Script> <![CDATA[ myWidth = 100; myHeight = 200; myCanvas.width = myWidth; myCanvas.height = myHeight; ]]> </mx:Script> </mx:Canvas> How would I get a handle on myCanvas (where I'd want myCanvas to be the root )? 回答1: To access the component specified by the root node from within an mxml file, you can use this

AS3 - How to Cycle States of Character Animations (moving & stopped)

余生颓废 提交于 2019-12-12 03:57:57
问题 I have a D-Pad for my mobile game, when it's pressed the character should move, the animation should swap from State-1 to State-2 , and keeps repeating. I do not know how to have the stationary animation switch to movement, then after a delay so the user can see it, it switches to stationary, back to movement. This process should keep happening until the user lets go of the UP D-Pad or hits the stage collision barriers I have set up. // NOTE: 1 means standing still, 2 means moving in that