actionscript

How can I use ArrayCollection like feature in ActionScript 3.0 Flash IDE?

旧城冷巷雨未停 提交于 2019-11-30 20:13:39
问题 I heard that ArrayCollection on Flex, so how can I use ArrayCollection like feature in ActionScript 3.0 and Flash IDE. 回答1: The equivalent Flash IDE class is fl.data.DataProvider . http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/data/DataProvider.html The DataProvider class provides methods and properties that allow you to query and modify the data in any list-based component--for example, in a List, DataGrid, TileList, or ComboBox component. A data provider is a linear

Pick random Element of an Array Actionscript 3

狂风中的少年 提交于 2019-11-30 20:04:33
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 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]; } If you have an Array already, you should be able to define a random sort, then you can add them to the stage as needed. //get your array as needed... var myArray:Array =

How to make an AS3 Flash video player?

坚强是说给别人听的谎言 提交于 2019-11-30 19:14:43
问题 I would like to make a Flash video player that takes a URL as an attribute when you embed it and loads the video based upon that attribute. All I need for the moment is a play/pause button. How can I do this is AS3? It needs to be able to play F4V files. If it's simple to make other features, like full screen, showing how much of the video has been loaded on the timeline, or being able to click at any point in the timeline yo jump to that point in the video, please tell how! Thank you so much

Realtime update and Push Data in AS3

末鹿安然 提交于 2019-11-30 18:17:19
问题 i want to make a real-time update for my flash application. Instead on making it refresh each 30secs, i would prefer the push technology. What is the best way to push data in Actionscript 3 ? 回答1: There are two popular options for implementing real-time updates: sockets and RTMP. There are advantages and disadvantages to each, but the primary deciding factor is usually your server infrastructure. Sockets Sockets provide the lowest-level functionality. This means you will need to implement a

How can I remove youtube logo from the youtube player for use in other application?

橙三吉。 提交于 2019-11-30 18:05:54
问题 I want to use the Charmless youtube player in my application and I want to remove youtube logo from the Player. How can i achieve this thing? My application is developed using AS3. 回答1: Simply add ?modestbranding=1 to the end of your URL. See more here. modestbranding (supported players: AS3, HTML5) This parameter lets you use a YouTube player that does not show a YouTube logo. Set the parameter value to 1 to prevent the YouTube logo from displaying in the control bar. Note that a small

FULL_SCREEN_INTERACTIVE mode: the “Allow” button click is passed to the application

六月ゝ 毕业季﹏ 提交于 2019-11-30 17:51:55
问题 In an AS3 game (using Flex 4.10.0) I would like to allow players to chat, even when they are in fullscreen mode. So I am using the following ActionScript code (the _fullBox checkbox triggers fullscreen mode in my web application): public function init():void { if (stage.allowsFullScreenInteractive) stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreen, false, 0, true); } private function toggleFullScreen(event:MouseEvent):void { stage.displayState = stage.displayState ==

StringBuilder in Flex

☆樱花仙子☆ 提交于 2019-11-30 16:48:19
问题 I'm looking for fast string concatenation class or so in Flex. Like StringBuilder in Java. Thanks 回答1: var str1:String = "Vinoth"; var str2:String = "Babu"; var str3:String = "Chennai"; var str4:String = concat(str1, " ", str2, " ", str3) trace(str4) would result you str4 == "Vinoth babu Chennai" String Concat Class public class StringBuffer { public var buffer:Array = new Array(); public function add(str:String):void { for (var i:Number = 0; i < str.length; i++) { buffer.push(str.charCodeAt

Play video files online sequentially without delay/buffering between videos

喜你入骨 提交于 2019-11-30 16:20:17
Is it possible to play video online that's made of two or more video files? Since my original post wasn't clear enough, here's expanded explanation and question. My site is hosted on Linux/Apache/PHP server. I have video files in FLV/F4V format. I can also convert them to other available formats if necessary. All videos have same aspect ratio and other parameters. What I want is to build (or use if exist) online video player that plays video composed of multiple video files concatenated together in real-time, i.e. when user clicks to see a video. For example, visitor comes to my site and sees

Play video files online sequentially without delay/buffering between videos

怎甘沉沦 提交于 2019-11-30 16:12:39
问题 Is it possible to play video online that's made of two or more video files? Since my original post wasn't clear enough, here's expanded explanation and question. My site is hosted on Linux/Apache/PHP server. I have video files in FLV/F4V format. I can also convert them to other available formats if necessary. All videos have same aspect ratio and other parameters. What I want is to build (or use if exist) online video player that plays video composed of multiple video files concatenated

How can I calculate shades of a given hex color in actionscript 3?

二次信任 提交于 2019-11-30 14:11:08
问题 I need a way to calculate lighter hex color(s) based on a provided one. I realize I could use a color transform, but I need the actual value in order to generate a gradient. 回答1: Here's some stuff pulled out of my Color utils. Sounds like makeGradient might be useful to you. /** * Return a gradient given a color. * * @param color Base color of the gradient. * @param intensity Amount to shift secondary color. * @return An array with a length of two colors. */ public static function