actionscript

Javascript to flash communication

我怕爱的太早我们不能终老 提交于 2019-12-31 22:28:11
问题 I am trying to call a Actionscript function from javascript but I am having problems in Internet Explorer. I am using Swiff.remote in mootools 1.2.1 to call the actionscript function ie: Swiff.remote(playSwf.toElement(), 'sendResult', result, plays, name); This all works fine in FireFox, Safari and Opera but I'm getting an "unspecified" error in Internet Explorer 6 and 7. I have tried using the bog standard: window['flash'].sendResult(result, plays, name); To no avail. Thanks for any help.

Beginner Actionscript reference

会有一股神秘感。 提交于 2019-12-31 06:26:50
问题 My eight years old son asks to "teach him programming in Flash". Can somebody refer on good Actionscript learning resource online? The Flash version we have is "Flash MX". Thank you in advance. 回答1: see if this fits your bill: http://www.scribd.com/doc/9409007/ADOBE-FLASH-ACTIONSCRIPT-BOOK 回答2: www.flashkit.com www.karupa.com 回答3: You should also check out some stuff from top AS developers (Brimelow, Skinner, Moock), although, nowadays much of the material will be focused on AS3 (Flash 9/10).

Adobe Air - get device name (such as EVO, DROID X..)

本秂侑毒 提交于 2019-12-31 01:48:37
问题 I'm working in Actionscript in Adobe Air, and I want to get a device's model name, such as 'EVO' or 'DROID X'. Has anyone been able to do this? Thanks. 回答1: Capabilities.os and Capabilities.manufacturer are probably sufficient for identifying an iOS device (iPhone, iPod, iPad, as well as their generation). On Android, the platform you specified, these properties are too general. In my testing, manufacturer is "Android Linux" and os is "Linux" plus numbers indicating the exact Linux version.

Dynamic Object Initiation As3

人盡茶涼 提交于 2019-12-30 15:02:01
问题 I notice in older version of flash you can create an instance of a dynamic class. I am creating a game that will have many different classes that can be displayed on the stage but can very from time to time. How would I go about calling them dynamically. for example var newObject = new ["DynamicObject"](); ?? Is this possible in As3 ?? 回答1: I think there are 2 ways you can do that: 1.Using ApplicationDomain.getDefinition('DynamicTemplate') something like: var DynamicClass:Class = this

Actionscript memory management, garbage collection

我与影子孤独终老i 提交于 2019-12-30 11:18:10
问题 This blog (and others) state that you should set object references to null inside your dispose() methods when cleaning up objects. However, Actionscript 3 (with Flash Player 9) uses mark and sweep to clear out circular references for you. So I am wondering: is there really any reason to null out your object references? 回答1: I never do - as long as you do the obvious: Break all reference to the object (remove from arrays, set variables storing the object to null, remove from display list)

Using logical bitshift for RGB values

两盒软妹~` 提交于 2019-12-30 06:54:22
问题 I'm a bit naive when it comes to bitwise logic and I have what is probably a simple question... basically if I have this (is ActionScript but can apply in many languages): var color:uint = myObject.color; var red:uint = color >>> 16; var green:uint = color >>> 8 & 0xFF; var blue:uint = color & 0xFF; I was wondering what exactly the `& 0xFF' is doing to green and blue. I understand what an AND operation does, but why is it needed (or a good idea) here? The source for this code was here: http:/

Pick random Element of an Array Actionscript 3

坚强是说给别人听的谎言 提交于 2019-12-30 06:29:53
问题 I have an array of movieclips and i want to put them on stage. so they have to be unique and randomly chosen. how can I do that? thank you for your time 回答1: You can get a random number using Math.random() This will return a number between 0 and 1. So, for getting a random element of the array, use this: function getRandomElementOf(array:Array):Object { var idx:int=Math.floor(Math.random() * array.length); return array[idx]; } 回答2: If you have an Array already, you should be able to define a

Is it possible to embed or load SWFs when making iphone apps (Is it allowed by Apple)

荒凉一梦 提交于 2019-12-30 03:33:05
问题 I am a little confused on whether to embed swfs or load them when making apps for the iphone. Does anyone know what are the advantages of each (which is preferable to use)? I know that embedding swfs should be a little faster than loading them but is that all? Also and this is kind of important, I read that Apple will reject any app with external swfs?? Is that indeed correct? If so, will embedding or loading said swfs solve this problem? Thanks in advance EDIT: after some searching around,

AS3 - hitTestObject Collision Not Registering Correctly

北战南征 提交于 2019-12-29 09:22:24
问题 I had a problem with my hitTestObject collision detection a couple of days ago which has since been fixed (How can I solve my hitTestObject Collision Null Object Ref Error) with the help of you folks (thanks). My problem now is as such: When my "enemy.hit" comes into contact with "player.hit" it registers as a hit - this is good. When my "building.collide" comes into contact with "player.hit" it registers as a hit - this is good. However, when my "building.collide" comes into contact with my

AS3: How accurate are the getTimer() method and the Timer class?

风格不统一 提交于 2019-12-29 08:58:44
问题 I'm in the process of making a game (a shmup) and I've started to question the accuracy of the timers in ActionScript. Sure, they're accurate enough when you want to time things on the order of a few seconds or deciseconds, but it seems to perform pretty poorly when you get to finer ranges. This makes it pretty tough to do things like have a spaceship firing a hundred lasers per second. In the following sample, I tested how long (on average) the intervals were between 1000 timer ticks