actionscript-3

How can I bend a a display object?

故事扮演 提交于 2019-12-20 05:59:25
问题 I want to make collage, Example : http://www.as3.ro/p1_anim4.swf (1.4 mb); I want to bend images using as3. 回答1: There is no easy way to do this. Any solution to this problem will involve a lot of experimenation, and cleverness. For the 3D aspect of the transformation, investigate Papervision. For the 'bend' aspect of the transformation, investigate DisplacementMapFilters. Good luck! 回答2: I would use Papervision; with as3mod. "AS3Dmod is a library of modifiers for 3d objects." - with a bend

what is the point of void in AS3

折月煮酒 提交于 2019-12-20 05:57:09
问题 Simple question here, when void follows a function in AS3 what is it doing? public function sayGoodbye():void { trace("Goodbye from MySubClass");} 回答1: void type indicates to the compiler that the function you have written will not return any value, in the other side if you indicate other type T than void the compiler expect that you return T. Ex: function foo(a:int):int { // here the compiler expect that somewhere // in your function you return an int return a; } 回答2: void means that it has

Javascript call AS3 function

三世轮回 提交于 2019-12-20 05:56:01
问题 I know that there are lots of articles and forum post about this question and lots of them are not working and remained unanswered. Some tutorials claimed that their code works, but some of them does not have download page and some of them with download page, the link does not work. Also, perhaps there's a new way of doing this and the code that I found is no longer supported. Here is my code:HTML and Javascript <html> <head><title>Javascript to SWF</title> <script language="JavaScript">

Convert Little-endian ByteArray to Big-endian in AS3

余生颓废 提交于 2019-12-20 05:50:36
问题 How to convert Little-endian ByteArray to Big-endian in AS3? I convert bitmapData to Big-endian ByteArray and then push it into memory with Adobe Alchemy. And then when i read it from memory i get Little-endian ByteArray. How to get Big-endian. I use this example code http://blog.debit.nl/2009/03/using-bytearrays-in-actionscript-and-alchemy/ (Memory allocation in C with direct access in Actionscript (FAST!!)) Code: var ba:ByteArray = currentBitmapData.getPixels( currentBitmapData.rect ); ba

Can Flash SWF communicate with Java applet, and vice versa, in any way?

放肆的年华 提交于 2019-12-20 05:26:10
问题 I know Flash can use ExternalInterface to call Javascript functions but I don't know if it can call applet also like that. Maybe it can be done by SWF -> JS -> Applet, and back, I don't know. Since I have no idea how to do applets, I would also appreciate at least some pseudo code. Thanks. 回答1: Applets can communicate with JS, and JS can control applets. See these examples of Java/JavaScript interaction. 回答2: Yes. Sockets. Your Java applet can open a server socket, probably a HTTP socket, and

as3 URLRequest and file stream saving xml data - Error #3013: File or directory is in use

回眸只為那壹抹淺笑 提交于 2019-12-20 05:13:24
问题 My end goal is to open an xml file, change data and save it. I am opening it with a URLRequest. I am able to change the xml, however, MY ISSUE IS: When I try to open it with a stream to save the file then it says: Error: Error #3013: File or directory is in use. I suppose I could open it with the same stream but then I don't know how to get the xml vars like I do in my script when I am using the URLRequest. So I either need to a) close the xml file so I can open it with a stream or b) open

Loading and unloading content from library in AS3

霸气de小男生 提交于 2019-12-20 05:12:30
问题 I'm doing a flash project but I'm new to actionscript. I have a menu in the main page and I want to make other pages appear when I click on menu items. I know how to load movieclips from library but I don't know how to specify their position on the screen and how to make them appear in a specific layer. Is it necessary to unload previous content when I click on another item of menu? will they stack on each other and make the program heavy if I don't unload them?! I've added a layer for each

Determining linkage dependencies in Flex applications

不羁的心 提交于 2019-12-20 04:55:25
问题 I have a large Flex project with two Applications in it. A lot of code is shared between these Applications. However, the smaller of the Applications does not require much of the code that the larger one does. I'm trying to ensure that code that isn't required by the smaller application isn't getting compiled into it. Is there an easy way for me to determine which files within my project are being compiled into a particular Application? 回答1: Ah, I managed to discover the solution to this

pass var values from one swf to another swf who is loaded inside the firts one in AS3

五迷三道 提交于 2019-12-20 04:38:29
问题 im using this method to load an SWF inside another SWF: (this code is inside main.swf) function loadImage(url:String):void { imageLoader = new Loader(); imageLoader.load(new URLRequest(url)); imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading); imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); } loadImage("test1.swf"); function imageLoaded(e:Event):void { MyMovieClip.addChild(imageLoader); } The think is the test1.swf needs a value

How to check if mouse is over a MovieClip?

只愿长相守 提交于 2019-12-20 04:19:48
问题 No listeners involved. The thing is, I can use MOUSE_OVER and MOUSE_OUT listeners, but if you drag a mouse over a MovieClip quickly enough, one of these listeners may not be activated. I've tried it several times. 回答1: If the mouse passed by "quickly enough" then maybe the OS didn't send any mouse events to Flash for that portion of the screen, in the first place. Moving the mouse a lot faster than its resolution can fire (or the OS can handle) will have the effect you are witnessing (and the