actionscript-3

How to avoid reusing identical implementation code with an interface?

流过昼夜 提交于 2019-12-19 03:39:13
问题 First of all, I apologize for "yet another interface question". I thought that this one might be worth asking, though, as it's kind of a strange issue. The project I'm using uses Actionscript 3, but this is more of a general OOP question. Here's the situation: I have a class that already inherits from a base class; it's an object in a videogame. (Let's say it's a spaceship.) In my game, I'd like to have many many many spaceships onscreen, at one time, so I've decided to create an object pool

What is the best Actionscript3 3D Engine?

一世执手 提交于 2019-12-19 03:13:32
问题 I am looking for a somewhat detailed explanation of which 3D Engine for Actionscript3 is the most efficient, practical, scalable, documented, community supported, etc. When I first got interested in the 3D world for flash and actionscript3, all I knew of was papervision3D. In my curious way I went to read up on papervision3D and was shocked at the lack of tutorials. Later I started to research Away3D and have found that their site is easy to traverse and there are many tutorials and easy to

C# Replace with Callback Function like in AS3

倾然丶 夕夏残阳落幕 提交于 2019-12-19 03:09:12
问题 In AS3 you have a function on a string with this signature: function replace(pattern:*, repl:Object):String The repl:Object can also specify a function. If you specify a function, the string returned by the function is inserted in place of the matching content. Also, is it possible to get the the original string in which I want to replace things? (In AS3 you can get the original string by var input:String = arguments[2]; //in the callback function ) I don't see a property in the Match class

Detect AIR versus Flash Player from an actionscript library

独自空忆成欢 提交于 2019-12-19 02:38:14
问题 I have an swc which needs to operate slightly differently depending on whether it is being hosted by AIR or not. I've seen two suggestions on the internet: Test Application.application for WindowedApplication. Test Security.sandboxType for Security.APPLICATION. However, these don't seem to work in my .swc as the compiler can't find WindowedApplication or Security.APPLICATION. My library doesn't need any other AIR features so I assume it's not being linked to the AIR libraries, and I assume

Switch statements and ranges of numbers

不想你离开。 提交于 2019-12-19 00:16:19
问题 How do you craft a switch statement in as3 to make the case apply to an entire range of numbers? if (mcPaddle.visible == true) { switch (score) { case 10://10 to 100 myColor.color = 0x111111; break; case 110://110 to 1000 //etc etc break; } } I've tried multiple ways to make the case apply for all numbers between 10-100, and 110-1000, but can't seem to find a way to do it, and I can't find the proper syntax for such a thing in as3. 回答1: You can use a switch block : var score:Number = 123;

JavaScript's version of ActionScript's Event.ENTER_FRAME event?

老子叫甜甜 提交于 2019-12-18 17:24:14
问题 I am trying to learn JavaScript and I am wondering whether JavaScript has a event listener just like ActionScript's ENTER_FRAME. Basically, I want this event listener to listen "all the time" not just wait for any particular instance (mouse click, keyboard event) of event. 回答1: You're looking for setInterval(func, time) . In the case of making it work like ENTER_FRAME, then you would make time very small. So, if you wanted to imitate a frame rate of say, 30 times a second: // you will need to

Finding (loaded) image size in AS3 (Action Script 3.0)

独自空忆成欢 提交于 2019-12-18 17:01:57
问题 Im currently using the following function to load an image, however i could not figure out a way to find the width of the loaded image, which i intend to use before placing the next image using the same function. Note that q is a a variable (a number) which is used to load differant images. =X i need help obtainning the loaded image width... function LoadImage(q) { var imageLoader:Loader = new Loader(); var image:URLRequest = new URLRequest("GalleryImages/Album1/"+q+".jpg"); imageLoader.load

as3 mouseEnabled still a problem for me

蹲街弑〆低调 提交于 2019-12-18 15:26:10
问题 A couple years in now, there's still something about mouseEnabled I'm not getting. I have a Sprite (for example here "Sky", that contains many objects, one of them is a Cloud, which I do not want to receive Mouse Events. I overlay this Sky on some other display objects. I want the cloud to be visible, but not to block mouse events. If you see a tree through the clouds you should be able to click on the tree. In the Sky class: mouseEnabled = false; cloud.mouseEnabled = false; cloud

Adobe Air ios packager

筅森魡賤 提交于 2019-12-18 13:38:21
问题 There seems to be a lot of confusion regarding deploying Adobe Air apps to ios after the restrictions were lifted. Before apple lifted the restrictions you had to go through the process documented here: http://blogs.adobe.com/cantrell/archives/2010/09/packager-for-iphone-refresher.html using the Packager for iPhone. But now that the restrictions have been lifted and the Air 2.7 update we can use the same ADT tool in the flex SDK that we use with all air applications. My understanding is that

Custom headers possible with URLRequest/URLStream using method GET?

时光毁灭记忆、已成空白 提交于 2019-12-18 13:36:44
问题 Quite simple really: var req:URLRequest=new URLRequest(); req.url="http://somesite.com"; var header:URLRequestHeader=new URLRequestHeader("my-bespoke-header","1"); req.requestHeaders.push(header); req.method=URLRequestMethod.GET; stream.load(req); Yet, if I inspect the traffic with WireShark, the my-bespoke-header is not being sent. If I change to URLRequestMethod.POST and append some data to req.data , then the header is sent, but the receiving application requires a GET not a POST. The