actionscript

Action Script 3. Timer starts count when I'm in menu, but game not started

对着背影说爱祢 提交于 2019-12-25 01:53:35
问题 I'm creating flash game and I get strange problem. Timer starts count when I'm in menu, but game not started. In menu I have button "Play", after It is clicked It add timer, but It shows how long program is running (start count from current time). This is main function which starts public function MemoryGame() { startMemoryGame.addEventListener(MouseEvent.CLICK, startPlay); } This is button to start game: function startPlay(e:MouseEvent):void { startMemoryGame(); } And here Is my function

Get Full Exception Error with Flex

一世执手 提交于 2019-12-25 01:49:50
问题 I can't use trace because I'm not using an Adobe IDE and when I try to view my exception errors, I can't seem to get the full error message, I only seem to get the "errorID". For example, if I had a 1069 error, I should see something like: Error #1069: Property data not found on X and there is no default value. But instead I see this... ReferenceError: Error #1069 This is my code... try { //error gets thrown here } catch(e:Error) { extTrace('Error: '+e.toString());//I also tried e.message, e

AS3: How to Deep Copy an Object

爷,独闯天下 提交于 2019-12-25 01:45:48
问题 i have an object that i need to copy to my SharedObject data. The problem is that the data property of shared object is read-only, so i can't clone my 'source' object and assign it to the shared object data, i have to make a copy of them in this way: var so: SharedObject = SharedObject.getLocal("appData"); copyObject(sourceObj, so.data); so.flush(); and the copy method: public static function copyObject(sourceObject:Object, destinationObject:Object):void{ // this would be the code that i need

Get sound's total time and current time?

谁都会走 提交于 2019-12-25 01:44:16
问题 I have a player in flash ActionScript 3. I need to take a the total time of the sound file and current time of the sound file. My code: function onPlayProgress(evt:Event):void { var sndLength:int = Math.ceil(snd.length /(snd.bytesLoaded / snd.bytesTotal)); var seekbar = 100 * (channel.position / sndLength); playBar.seekbar.x = seekbar*5.8; var _totalTime:Number = (((snd.length /(snd.bytesLoaded / snd.bytesTotal))*0.001/60)); What is current time? 回答1: I'm not entirely clear on what the code

Is it possible to remove actionScript from inside of SWF file using PHP?

半腔热情 提交于 2019-12-25 01:37:41
问题 The result should be clean SWF file. 回答1: Of course its possible, but you would have to read the file data and understand the structure of the file to know where the actionscript's are stored. you can use PHP native functions such as fopen fseak fread flcose Along with other binary tools such as bin dec pack <<, |, >>, & and other binary manipulation tools To manipulate binary data, I suggest you start with the link below to understand the complexity of this: http://wwwimages.adobe.com/www

Should DispatchEvent be the last statement of a function?

微笑、不失礼 提交于 2019-12-24 19:16:00
问题 Should dispatchEvent must be the last statement of any function ? 回答1: When you call dispatchEvent, all handlers for that event are immediately called before the rest of the function body where dispatchEvent was called runs. Does that mean that you need to call dispatchEvent as the last thing in a function body? Only if the code that is after the dispatchEvent call somehow depends on something that will be adversely changed when the handlers run. 回答2: Absolutely not, dispatchEvent() can be

Read request URL in Flash

巧了我就是萌 提交于 2019-12-24 19:02:08
问题 I am not a flash developer, but I am stuck with a flash developer, stuck with a third party program in ActionScript1. I asked him to get the request URL of the page which embeds the flash object (like reading the address bar in the browser). and then get Query string variables and send it back to an application. How to read those variables? Remember it is action script1. Thanks 回答1: Do you have control over how the movie is embedded? If so just add that information to the flash vars that you

How to access children of children recursively?

帅比萌擦擦* 提交于 2019-12-24 18:35:14
问题 I have a Canvas which has many components inside it and those again, have many components inside them. getChildren() returns only the top level children. What is the best way to retrieve all the children (children of children of children and so on). Well, I sorta know how to do this by iterating through the children, but the code is really messy. I'd prefer to use a nice recursive function. Has anyone written this before? Or is there a Util class to do this? 回答1: private function recuse

How do you stop Copy/Paste in a flash form

六眼飞鱼酱① 提交于 2019-12-24 18:33:46
问题 I work for a medical transcription company and our medical transcription test we administer to our applicants is an older flash forms app that stops copy and paste by emptying the clipboard when you enter the form. This worked great in IE 7, but recently it has come to my attention that it does not work so well in Firefox. Or perhaps it is the version of flash, since flash should be browser independent. I'm not by any means a flash developer, in fact I'm quite terrible at it. So what I need

Center movieclip on point

孤街浪徒 提交于 2019-12-24 17:25:03
问题 I'm dynamically loading movie clips (SWFS) into attached clips (from the library). The loaded movies don't all have center points, meaning that their registration point isn't directly in its center. This poses a problem when I load them into the attached clips, because they don't center on the attached clips, which is what I want them to do. Is there a way to center a movieclip based on width and height instead of registration point? Thanks in advance! 回答1: Use getBounds. var bounds:Rectangle