actionscript-3

As3: Draw overlapping rectangles to a sprite and apply alpha

五迷三道 提交于 2019-12-20 04:18:26
问题 I need to draw independet rectangles to a sprite. But the overlapping areas will get visible if I apply alpha to my sprite (the sprite will be fade in and out): var spBox:Sprite = new Sprite(); this.addChild(spBox); spBox.graphics.beginFill(0x123456) spBox.graphics.drawRect(100, 100, 50, 50); spBox.graphics.endFill(); spBox.graphics.beginFill(0x123456) spBox.graphics.drawRect(125, 125, 50, 50); spBox.graphics.endFill(); Is there a way to compine/flatten/merge the rectangles of my sprite? I

Hovering off DPAD sometimes makes character move infinitely in one direction

别等时光非礼了梦想. 提交于 2019-12-20 04:09:55
问题 I have a DPAD in my game when the player holds down let's say the Left DPAD, if he moves his touch to the Up DPAD and let's go, the player continues going in the left direction. It also works if you hold the a direction, lets say Up continue holding but move off the Up DPAD, sometimes you may continue going in that direction. What I've tried to prevent this: On direction clicks, trigger checks on whether your in motion, or already going a different direction Setting collisions to force these

Flash AS3 - How to set high quality audio recording

﹥>﹥吖頭↗ 提交于 2019-12-20 03:54:08
问题 Currently, I'm using mic.rate = 100; This only gives 63kbps. Is it possible for Flash AS3 to set bitrate higher than 63kbps? 回答1: From the docs Acceptable values are 5, 8, 11, 22, and 44 So enter one of those. And it's measured in kHz, not kbps, also according to the docs 回答2: It's flash. Great quality also depends on users' hardware. You didn't post full settings for your microphone. Also value that you are using isn't valid. Here a small snippet, for mic settings, that will give you good

Error #2031: Socket Error. URL: 127.0.0.1

不想你离开。 提交于 2019-12-20 03:52:13
问题 So i am playing around with some exmaples that come with the tuio as3 library and i am getting an error on launch that i have never encountered before and don't know how to fix. it compiles with no errors however on launch i get this output: ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1"] does anyone know how to fix this? 回答1: An IOErrorEvent object is dispatched when an error causes input or output

AS3.0 Replay the whole movie (*SWF file)

依然范特西╮ 提交于 2019-12-20 03:50:05
问题 I made a small game in Actionscript 3.0 and flash. When the player wins the game or is 'game over' the player should have a option to replay the game. So my question is: Is there a way to replay the whole movie with Actionscript? I know, i could reset the timeline back to 0, and re-instantiate all the classes, movieclips, var's ect... but i was wondering if anyone knows a easier solution. 回答1: You can remove the swfObject and add it again. Look here. This is the swfObject reference. 回答2:

Security Sandbox Violation with Youtube API

◇◆丶佛笑我妖孽 提交于 2019-12-20 03:43:21
问题 I'm getting a very annoying run time error message, which crashes my flash application when it runs in the browser. The error pertains to a 'Security Sandbox Violation' when I attempt to access Youtube's Gdata api. The exact error message reads: Error: Request for resource at https://gdata.youtube.com/feeds/api/videos? key=As##2PVR2#lPj#0bVaw_Tvjx1MI6qeAI1gORxErVYDzu2zZy4D18bf8T6pHxsPgIOhs3_44Te YTVlYLx49goUPbv00udousA&q=The-Muppets-official-trailer&alt=json&max-results=1 by requestor from

AIR Loading server hosted swf into same sandbox

Deadly 提交于 2019-12-20 03:39:05
问题 I have an AIR App I'm working on and need to load a swf(always from localhost) which will access some methods in it's parent and vice versa. I'm not concerned with opening gaping security holes in a desktop app though. I've been searching all over but keep hitting walls with each implementation out there. My current setup loads in the swf and it plays but I get a small error from the sandbox since I'm not in the same one as the app. Does anyone know how to get past this error so there is

Why do we not have splice in array collection?

淺唱寂寞╮ 提交于 2019-12-20 03:37:09
问题 From what I know the whole idea behind having collection classes is introduce extra wrapper methods which will be handy for developers. Then why does ArrayCollection in Flex not seem to have some methods that array has. ArrayCollection does not have a copy, concat, join or splice methods which return a new array so we need to do the copy manually? Or I am missing something in here? Thanks. 回答1: You're right, the methods are not there. There is no published reason for the decision, that I can

save image in a directory in applicationStorageDirectory

為{幸葍}努か 提交于 2019-12-20 03:34:09
问题 I was trying to save an imagefile to a directory in applicationStorageDirectory of my air project. Created the directory first var imageDirectory:File = File.applicationStorageDirectory.resolvePath("vispics"); if (imageDirectory.exists) { Alert.show("Directory Already Exists"); } else { imageDirectory.createDirectory(); Alert.show(imageDirectory.nativePath); } The next part is saving image from my cam right now it saves to the applicationStorageDirectory. Here is how i do it var randInt:int =

SWF doesn't start in Chrome (Pepper Flash)

非 Y 不嫁゛ 提交于 2019-12-20 03:05:29
问题 Update: I've narrowed it down to Chrome's Pepper Flash. Disabling it (which forces Chrome to use the installed version of Flash that everything else uses), fixes it. But most Chrome users won't have it disabled, so I'm still looking for a solution. I have a simple game that works fine in Firefox and when debugging in FlashDevelop, but in Chrome, fails to start. It seems to be embedded properly; the white rectangle appears, and gives the Flash options if you right click it. But it doesn't