flash-cs4

How to change the pixels in an image

China☆狼群 提交于 2019-12-24 01:07:25
问题 i actually try to do the following: I have loaded an external image in a bitmapdata object and create a bitmap from it which i attach it to a sprite/MovieClip in order to have mouse events on it. Now under the previous logic i loaded two images (let's say circles) of the same size one that has a particular color and is covered by its black foreground circle. When i press left mouse button and hold it down i want while the mouse is moved to erase the foreground circle's pixels and so the

How to detect if the delete key was pressed in Actionscript 3?

强颜欢笑 提交于 2019-12-23 19:20:21
问题 How do I determine if the delete key was pressed using actionscript? addEventListener(KeyboardEvent.KEY_UP, onKeyUp); ... function onKeyUp(event:KeyboardEvent):void { trace(event.keyCode); } The above code yields no value when delete, backspace, enter, and other command keys are pressed. However, arrow keys do yield values. 回答1: this.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed); .... function onKeyPressed(event:KeyboardEvent):void { if (event.keyCode==Keyboard.DELETE) { .....

Scaling onstage MovieClip w/ “scaleX” breaks timeline animation …really?

丶灬走出姿态 提交于 2019-12-23 04:45:16
问题 I'm scaling onstage MovieClips via AS properties "scaleX" or "scaleY", which kills any kind of animation the clips have within their container MovieClip, be it Classic or Motion Tweens. When I don't scale the MovieClips, they animate fine. I'm able to tell the clips to "gotoAndStop" on their own internal frames, and that doesn't affect their animation within their container clip. I'm referencing the clips via AS w/ their instance names defined in the IDE. I've also tried different clips and

Is there an unofficial Flash .FLA spec?

独自空忆成欢 提交于 2019-12-21 02:36:11
问题 Is there an unofficial spec anywhere that explains how to reverse engineer a Flash .FLA file? I'm specifically interested in creating an application that can "auto-scene plan" a Flash document programmatically, pulling in content from other files, arranging that content into layers, without needing the Flash IDE open. Animators would then be able to take these pre-assembled FLA's and begin animating them. I've already built a JSFL script that does this, but it runs very slowly, is difficult

How do I get the user's screen resolution in ActionScript 3?

空扰寡人 提交于 2019-12-20 23:25:11
问题 Is there a way ActionScript 3 can detect the user's screen resolution? 回答1: have a look at stage.fullScreenHeight and stage.fullScreenWidth 回答2: These will return the numbers to your output window: trace(Capabilities.screenResolutionX); trace(Capabilities.screenResolutionY); 回答3: If you are on AIR, you could use the flash.display.Screen class, which contains this info, plus a lot more, such as color-depth, and multi-screen support. 回答4: flash.system.Capabilities.screenResolutionY and flash

Movement of Objects in a simulation

血红的双手。 提交于 2019-12-20 07:28:43
问题 i am currently making a flash "pond" with fishes in it, and i have the ability to add food pellets onto the pond, how should i make the movement of my fishes to the food x,y location ? so it will be smooth , rather than setting the x,y location of my fishes to the x,y location of the food pellets. Also is there a good place to learn how to make my fishes move by its own? similar to http://abowman.com/google-modules/fish/ Fish class package { import flash.display.MovieClip; import flash

Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?

家住魔仙堡 提交于 2019-12-13 17:07:21
问题 I've got a rather simple question about loading in an xml file at runtime in a SWF. I've found a couple different methods to load in the xml. myXml.load("file.xml"); HTTPService object URLStream object What is better way to load an xml file that always has the same name and is located in the same folder as the SWF on the web server? 回答1: I would use URLLoader - I think that's the most lightweight one. The complexity of URLStream is unnecessary as far as a configuration file is concerned.

add Loader to stage from class

喜夏-厌秋 提交于 2019-12-13 03:08:37
问题 Stage seems to be unaccessible from my class.. almost like it doesn't want to be reached. I do not know what keeps going wrong. This is the class as I have it right now: package { import flash.events.*; import flash.display.*; import flash.net.*; public class gallery extends Sprite{ private var imgPath:String = 'images/'; private var imgCurrent:int = 0; private var images:Array = new Array(); private var iLoader:Loader; function gallery() { this.addEventListener(Event.ADDED_TO_STAGE,

How to round number in actionscript

半世苍凉 提交于 2019-12-13 02:33:51
问题 how can I round number to up down or to the 0.5 using action script 3.0 for example 4.9 will be rounded to 5 4.7 will be rounded to 4.5 2.4 will be rounded to 2.5 2.3 will be rounded to 2 thank you. 回答1: How about Math.round(2 * number_here) / 2 回答2: z = Math.floor(n); p = n-z; if(p<0.25) ans=z; else if(p>0.75) ans=z+1; else ans=z+0.5; 来源: https://stackoverflow.com/questions/6889312/how-to-round-number-in-actionscript

Flash CS4, Inactive buttons

ぃ、小莉子 提交于 2019-12-13 02:24:45
问题 I have no syntax errors when I run this code. I checked the variables and the functions in the action panel and it works fine. But, when I remove the codes from the action panel, and try to run the .as file nothing happens when I click the button. Here's my code: package { import flash.display.*; import flash.events.MouseEvent; import flash.text.*; import flash.display.MovieClip; public class U1A4_Sommeil extends MovieClip { private var monMessage:TextField = new TextField; private var