actionscript-3

Spinning Wheel in flash AS3

雨燕双飞 提交于 2019-12-23 02:43:13
问题 I want to create (roulette) spinning wheel simulation in FLASH. I want to get a number, where that (roulette) spinning wheel will stop in front of an indicator. Here is link which demonstrate what I want actually. http://zytwebdev.zoomyourtraffic.in/amol_zytwebdev/roullete/R1_wheel2.swf section = new Array(); section[0] = "1"; section[1] = "2"; section[2] = "3"; section[3] = "4"; section[4] = "5"; section[5] = "6"; section[6] = "7"; section[7] = "8"; section[8] = "9"; section[9] = "10";

Adding the replaceAll method to the ActionScript String class

北城余情 提交于 2019-12-23 01:53:02
问题 I need some help in adding the replace all functionality into my Flex project. I would prefer doing this in a way that is as natural as possible. What I want to achieve is to be able to run this code (with the Flex compiler) "aabbaaba".replaceAll("b","c") and get "aaccaaca" . Also I want to chain replaceAll calls. Note: I won't be actually replacing b s with c s, but various string that will not be known at coding time! What I don't want: 1. Use regular expressions with the global flag. The

How to record a time-limited video with Adobe AIR for iOS

雨燕双飞 提交于 2019-12-23 01:50:41
问题 I am trying to record a time-limited video with Adobe AIR for iOS. For example, I want to implement the following function. Start a one-minute timer before launching CameraUI to record video. When the timeout event happens after one minute, stop recording video, close the CameraUI view and obtain the video data so far. I have several questions related to that. How to stop recording video from outside the CameraUI view(in this case, from the timeout event handler) and then close the CemeraUI

Find all points along a path AS3

流过昼夜 提交于 2019-12-23 01:43:15
问题 Basically, I want to randomly add a movie clip to any point along a bezier curve. Is there a way to find all points along a path? Or maybe there's a way to find the equation (it's a quadratic curve)? If all else fails, is there a way to find the points along a straight line (that isn't perfectly horizontal or vertical)? 回答1: If you are using the pen tool, this is creating a Shape . You can access the path of this shape by reading the result from Shape.graphics.readGraphicsData() See the

Find all points along a path AS3

Deadly 提交于 2019-12-23 01:43:11
问题 Basically, I want to randomly add a movie clip to any point along a bezier curve. Is there a way to find all points along a path? Or maybe there's a way to find the equation (it's a quadratic curve)? If all else fails, is there a way to find the points along a straight line (that isn't perfectly horizontal or vertical)? 回答1: If you are using the pen tool, this is creating a Shape . You can access the path of this shape by reading the result from Shape.graphics.readGraphicsData() See the

Regexp to get domain from URL

雨燕双飞 提交于 2019-12-23 01:12:19
问题 Anyone knows the Regexp for AS3 to get the domain name from URL? E.g: "http://www.google.com/translate" will get "http://www.google.com" 回答1: There's is a very complete utility class for dealing with URIs in as3corelib. Perhaps you might want to use this instead of rolling your own. import com.adobe.net.URI; var uri:URI = new URI("http://www.google.com/translate"); trace(uri.authority); // traces www.google.com 回答2: This should do the work: http(s?)://([\w]+\.){1}([\w]+\.?)+ You can try this

Save encoded .mp3 to applicationStorageDirectory Adobe Air iOS

本小妞迷上赌 提交于 2019-12-22 21:43:14
问题 I'm developing an iOS iPad app w/ Flash CS5.5 AIR v.3.1 I'm using ShineMp3Encoder to encode a Wav to a Mp3 from: https://github.com/kikko/Shine-MP3-Encoder-on-AS3-Alchemy Basically it converts a byteArray (wav) to a byteArray (mp3) or "mp3encoder.mp3Data" in the code. I have no trouble saving this using a (new FileReference()).save(mp3Data, filename); but because this is being used in a iOS AIR app I wanted to switch to using the File.applicationStorageDirectory so that I could put the saved

Difference between calling stage.width and stage.stageWidth?

核能气质少年 提交于 2019-12-22 21:11:26
问题 In as3 What is the difference between calling stage.width and stage.stageWidth I read somewhere that if we have nothing on stage then the value of stage.width is 0 , but what happen when I have nothing on stage but loading contents dynamically on stage? I have tried this and when i have loaded content dynamically on stage then i have got stage.width=value; // where value is dynamic number Can anyone explain this?? thanks. 回答1: According to the Adobe Reference for the Stage Class: stage.width

Embedding fonts for AS3. How?

爱⌒轻易说出口 提交于 2019-12-22 20:59:17
问题 I embedded font using Flash Professional CS5, but I still can't use it in my AS code. How should I embed the font to be able to use it in AS3 as well in Flash Professional CS5? 回答1: Embed the font inside your fonts.fla file. http://www.adobe.com/devnet/flash/quickstart/embedding_fonts.html Export fonts.fla to the SWC library. ( under export settings check the SWC box in Flash CS5 ) Use the swc with the code! Then you should be able to see it: 回答2: I do something slightly more different. :D

Trying to use BindingUtils in Flash AS3.0

穿精又带淫゛_ 提交于 2019-12-22 19:43:25
问题 I am not able to make this code work in AS3.0 ( Flash ) with Flex SDK 4.0 included. import mx.binding.utils.*; [Bindable] var myValue:int = 0; var cw:ChangeWatcher = BindingUtils.bindSetter(myValueChanged, this, "myValue"); addEventListener( Event.ENTER_FRAME , ef); function ef(e:Event):void { trace("hello",getTimer()); myValue = getTimer(); } function myValueChanged(o:Object):void { trace("myValue: " + myValue.toString()); } The output i get is : myValue: 0 hello 157 hello 168 hello 171