actionscript

KEY_UP event of ctrl key blocks KEY_UP event of 'c' key

十年热恋 提交于 2020-01-13 05:59:47
问题 I am trying to capture Ctrl + C . I have noticed that many times, there is no KEY_UP event for C key. I believe it happens in cases KEY_UP event for C key should be thrown just before or after KEY_UP event for Ctrl key. Why does this happen? How can I catch the KEY_UP for C key? 回答1: Everything works fine: <?xml version="1.0" encoding="utf-8"?> < s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx

Asynchronous function call in Flex

萝らか妹 提交于 2020-01-12 01:37:59
问题 Is it possible to call a function asynchronously in Flex? I want to parse a file at regular intervals without blocking the rest of the application, what is the recommended approach for this? 回答1: Actionscript doesn't support multithreading, which I think is what you are really asking about here. While the functionality isn't inherent in actionscript (or Flex) you could set up a mock system using events and timers. I'm a little unclear on your exact question, so I'll give two answers: 1) You

Adobe Socket Policy File Server Problems

我的梦境 提交于 2020-01-11 04:06:41
问题 Has anyone been able to successfully implement a service to serve the required socket policy file to FlashPlayer? I am running the Python implementation of the service provided by Adobe at http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html and using the following policy file: <?xml version="1.0" encoding="UTF-8"?> <cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="*" to-ports="*" secure="false"/> </cross-domain

How do I access cookies within Flash?

雨燕双飞 提交于 2020-01-09 13:59:12
问题 I'm looking to grab cookie values for the same domain within a Flash movie. Is this possible? Let's see I let a user set a variable foo and I store it using any web programming language. I can access it easily via that language, but I would like to access it via the Flash movie without passing it in via printing it within the HTML page. 回答1: If you just want to store and retrieve data, you probably want to use the SharedObject class. See Adobe's SharedObject reference for more details of that

How do I make a video full screen using actionscript in flex desktop application

你。 提交于 2020-01-07 07:47:21
问题 I am playing a flv video using the videoplayer class of flex. (all the properties of it are being set at runtime) I want to make the video fullscreen without clicking on the fullscreen button i.e. through programming. Is it possible. If yes then how can I do this.? 回答1: Dispatch click event from the fullScreenButton of VideoPlayer. yourplayer.fullScreenButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); 回答2: Use the displayState property of the stage. You can access the stage as a

Save data into external files in AS3, with out server?

﹥>﹥吖頭↗ 提交于 2020-01-07 07:27:06
问题 HI How can I save some text information in local hard-disk with out the server support. I know shared object, but i dont use this. I need to save all these function in anther external file as text. Is there any way to do that in AS3.0 . I don't prefer Flex, am working in Action Script 3.0 & Flash IDE EDIT: My swf is saved in a local machine. So no server interaction or browser interaction. the swf is running a local folder and read txt files from local folder, and save once press the save

Class property looses scope AND can't be set after setTimeout

爷,独闯天下 提交于 2020-01-07 06:57:13
问题 Here's a very simplified version of my project. I have a class file: class MyClass{ public var myNumberStoredInClass:Number; // constructor function MyClass(myNumber:Number){ this.myNumberStoredInClass = myNumber; }; // some method function DoStuffMethod(){ trace(this.myNumberStoredInClass); }; }; // end class I have a normal .as file from which I can access this.myNumberStoredInClass with no problems with MyClass.myNumberStoredInClass until I call setTimeout for a method in the class:

Get dominant or average color in getPixels ByteArray

久未见 提交于 2020-01-07 06:43:51
问题 So, I've got this code: import flash.display.BitmapData; import flash.display.Bitmap; import flash.geom.Rectangle; import flash.utils.ByteArray; var bmd:BitmapData = new BitmapData(10, 10, true); var seed:int = int(Math.random() * int.MAX_VALUE); bmd.noise(seed); var bounds:Rectangle = new Rectangle(0, 0, bmd.width, bmd.height); var pixels:ByteArray = bmd.getPixels(bounds); Is there a way to get, efficiently and quickly, the dominant color and/or the average color in pixels ByteArray. noise

Rotating the nearest rectangles

≯℡__Kan透↙ 提交于 2020-01-07 05:58:08
问题 The main code(init): package { import flash.display.Sprite; import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; import flash.events.Event; import flash.utils.Timer; import flash.events.TimerEvent; public class Init extends Sprite { var parts:Array, images:Array, w:Number = 20, h:Number = 80, numParts:int = stage.stageWidth / w, i:int, imgCount:int = 0, timer:Timer, rc:Number = 0, vr:Number = 10; public function Init() { init(); }

ExternalInterface.call using actionscript “eval” only works in firefox not chrome

删除回忆录丶 提交于 2020-01-07 05:42:09
问题 Chrome doesn't want to let me access javascript from swf file directly in the URL bar (I know that isn't best practice, but that's what I am trying to accomplish): Given: /file.swf?cmd=alert(); With the following code (snippet): flash.external.ExternalInterface.call("eval", cmd); This only works in Firefox and not in Chrome. I am taking this approach because in chrome the actionscript 2 way to run JS was to use getURL("Javascript:...., however this doesn't work in Chrome either anymore. Is