actionscript-3

as3 - How to stop video and detach NetStream

与世无争的帅哥 提交于 2019-12-21 20:43:39
问题 I have video streaming from the server, and later on I want to add another one just side by side. thats all good, I done that. Now my problem comes when i want to remove video. I manage to remove it from display, but I can hear that video is still playing in the background. So how do I can stop streaming that video? Here is my code for setting up the video: ns = new NetStream(connection); ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); ns.play(item[1].toString() + ".flv")

Flex/Actionscript White to Transparent

狂风中的少年 提交于 2019-12-21 20:35:08
问题 I am trying to write something in my Flex 3 application with actionscript that will take an image and when a user clicks a button, it will strip out all the white(ish) pixels and convert them to transparent, I say white(ish) because I have tried exactly white, but I get a lot of artifacts around the edges. I have gotten somewhat close using the following code: targetBitmapData.threshold(sourceBitmapData, sourceBitmapData.rect, new Point(0,0), ">=", 0xFFf7f0f2, 0x00FFFFFF, 0xFFFFFFFF, true);

How do I modify this easing function to bounce less?

会有一股神秘感。 提交于 2019-12-21 20:20:06
问题 I'm trying to modify Flash CS3's supplied fl.motion.easing.bounce function to make the resulting animation bounce less. I appreciate that 'bounce less' is a bit vague, but I'd appreciate any help in understanding the function. Thanks. /** * @param t Specifies the current time, between 0 and duration inclusive. * * @param b Specifies the initial value of the animation property. * * @param c Specifies the total change in the animation property. * * @param d Specifies the duration of the motion.

Is it a bad idea to implement a timer loop in Flex?

≡放荡痞女 提交于 2019-12-21 20:14:56
问题 In our game project we did have a timer loop set to fire about 20 times a second (the same as the application framerate). We use this to move some sprites around. I'm wondering if this could cause problems and we should instead do our updates using an EnterFrame event handler? I get the impression that having a timer loop run faster than the application framerate is likely to cause problems... is this the case? As an update, trying to do it on EnterFrame caused very weird problems. Instead of

Convert powerpoint to flash

血红的双手。 提交于 2019-12-21 20:03:39
问题 How hard is it to import a powerpoint presentation into flash. It would be perfect for me if the output would look like this: every powerpoint slide becomes a movieclip or a .swf file. I don't have any animations and sounds, its just text and images. I know i could save the slides to png but its very bad idea using bitmaps for text in flash. I also cant use programs like slideshare, because they add their own navigation bars and i cant use them offline. 回答1: OpenOffice's Impress has a

Dynamic stageWidth and Height in Flash AS3

≯℡__Kan透↙ 提交于 2019-12-21 19:59:53
问题 This seems like it would be a really easy thing to do, but its been giving me all kinds of headaches. I have a movieclip that is a gallery, It's linked to be called from AS when a button is clicked. When an image in the gallery is clicked, It fades in using the Tween class and is supposed to be centered in the main stage, but its centering to the movieClip instead. Here is the code: //Centers and places image right ondo the display board function fullLoaded(e:Event):void { var myFull:Loader =

Drawing a hex grid in Flash?

瘦欲@ 提交于 2019-12-21 17:27:49
问题 What's the easiest way to draw a hex grid algorithmically? How should I present them in data? For example, in a square grid, I could just save x-y coordinates.. 回答1: So hexagon is a neat library for AS3 games, it has some hexagon classes that might be handy in your research. This article has some very nice details about hexagon tiles in Flash. 回答2: There are several ways to manage hex map coordinates and most of them unintuitively insist on mapping them to x-y coordinates which is only

Mixin or Trait implementation in AS3?

天涯浪子 提交于 2019-12-21 17:19:45
问题 I'm looking for ideas on how to implement a Mixin/Trait style system in AS3. I want to be able to compose a number of classes together into a single object. Of course this is not a language level feature of AS3, but I'm hoping that there is maybe some way to do this using prototype based techniques or maybe some bytecode hacking that I believe AsMock uses to implement it's functionality. An existing Java example is Qi4J where the user define interfaces that the Qi4j framework implements based

Embedding Fonts in AS3 - Dynamic Text Field disappears

拟墨画扇 提交于 2019-12-21 17:06:38
问题 This is hopefully a new problem or just me missing something obvious. Please help! I'm embedding a font into my AS3 application. I'm doing everything by-the-book and it half-works. In my main class, [Embed(source="Art/moolbor.ttf", fontFamily="MoolEmbed", mimeType="application/x-font")] var MoolEmbed:Class; Then later on in my code: var newFormat:TextFormat = new TextFormat(); newFormat.font = "MoolEmbed"; newFormat.size = 20; newFormat.color = 0xFCF374; year.autoSize = TextFieldAutoSize.LEFT

Listen for incoming connections in AS3 (AIR) Client whithout using Server Socket

左心房为你撑大大i 提交于 2019-12-21 16:57:49
问题 I managed to create a C# Server that sends files to AS3(AIR) Clients using sockets . On the AS3 side I'm using the flash.net.Socket library to receive the data through TCP . This is how it works: -> I turn on my server, and it listens for clients (plus I can create a list of connected devices); -> I turn on my client and it automatically receives the data; The trigger event to receive the data is made on the client, i.e., I simply turn the server ON and when the client turns ON, it gets the