flash

as3 determine if camera access was denied

♀尐吖头ヾ 提交于 2020-01-03 08:27:06
问题 How can I determine if access to the camera and mic were denied in Flash? I can get the camera and mic, but I need to know if the user denied access. 回答1: Attach a status event listener and check if the camera is muted, see docs: Dispatched when a camera reports its status. Before accessing a camera, the runtime displays a Privacy dialog box to let users allow or deny access to their camera. If the value of the code property is "Camera.Muted", the user has refused to allow the SWF file access

How to determine if a string contains a specific substring

╄→гoц情女王★ 提交于 2020-01-03 07:21:08
问题 Given a string A , how can I determine if that string contains the substring "video/x-flv" ? 回答1: A.indexOf("video/x-flv") >= 0 回答2: This is a little old now, but try if(A.indexOf(video/x-flv) != -1){ //Found it } indexOf will return -1 if the substring doesn't appear in it. So if it's anything but -1 it means it does exist, Hope this helps although I'm probably a bit late! 回答3: http://www.gskinner.com/blog/archives/2007/04/free_extension.html gSkinner hasText() function EDIT: NO Sorry -

Targeting Flash Player 10.3 in Adobe Flash CS5

柔情痞子 提交于 2020-01-03 06:06:54
问题 Has anyone successfully tried using Microphone.getEnhancedMicrophone() method in Adobe Flash CS5? I tried all these steps; Step 1: Go to the locaiton C:\Program Files\Adobe\Adobe Flash CS5\Common\Configuration\ActionScript 3.0 Step 2: Create a new folder with the name "FP10.3" Step 3: Copy the file and paste it in the following location: C:\Program Files\Adobe\Adobe Flash CS5\Common\Configuration\ActionScript 3.0\FP10.3 Step4: Rename the swc name to "playerglobal.swc" Step 5: Goto the

Flash Play/Pause sound toggle button

筅森魡賤 提交于 2020-01-03 06:05:11
问题 I've googled and googled but got no where or outdated tutorials. Anyone know how to make it so I can toggle audio with buttons using ActionScript 3 on Flash? 回答1: To toggle play/pause you will need to record the position of where the user has paused the audio. To use a sound from the library like in your screenshot, you need to make that sound file available to your Actionscript. First, Right click the sound file in your Library and click on Properties... . Inside the Properties window, check

FileReference.save() duplicates ByteArray

依然范特西╮ 提交于 2020-01-03 05:51:24
问题 I've encountered a memory problem using FileReference.save(). My Flash application generates of a lot of data in real-time and needs to save this data to a local file. As I understand, Flash 10 (as opposed to AIR) does not support streaming to a file. But, what's even worse is that FileReference.save() duplicates all the data before saving it. I was looking for a workaround to this doubled memory usage and thought about the following approach: What if I pass a custom subclass of ByteArray as

Actionscript Tweening with Motion Blur

青春壹個敷衍的年華 提交于 2020-01-03 05:41:07
问题 So i have several items on a page, each of which tweens out or in depending on a mouse event. So far i can do Easing on them when they are going out/in but how do i also set up a tween so that it blurs as the come in and out (motion blur) like the ones in the motion presets. I want to accomplish the same motion preset settings but with Actionscript. Any help is appreciated, thank you. 回答1: You can check out the following article, I wrote in my blog few years ago: Adding Directional Motion

Actionscript 3.0 - tracing the path of a moving body ;

回眸只為那壹抹淺笑 提交于 2020-01-03 05:33:19
问题 I'm learning AS3.0 currently. I am trying to design a simple two body planet simulation. I need to show the paths of the planets on the screen. So my question is, once I have the updated x and y coordinates for the planets at each Timer interval, how do I change the color of the pixel (x,y) of the stage so that it shows the path of the planets? Is there some command of the form stage.x = color? Thanks! 回答1: I recommend using BitmapData's draw() method to render your planets as pixels each

How do I set the state of a SimpleButton with Actionscript 3

别来无恙 提交于 2020-01-03 05:33:11
问题 I have a .fla file created by our designer and he has created a set of SimpleButtons that I have wired to a video player. Now I need to set the status of a button to "over" if the video that it is associated with is playing. The button is somewhat sophisticated graphically so its not something that I want to recreate with AS. Is there some way to just set the myButton.upstate = myButton.overstate while the video is playing? I saw the question here which seems to lead me to believe that

AIR: securityError on OSX (but not on Windows) with URLStream()

社会主义新天地 提交于 2020-01-03 05:22:09
问题 I'm using URLStream to load a file from the harddisk (and I'd like to continue to use URLStream to do so). The file is located in "app-storage:/myfolder/myFile.zip" so I use var f:File = new File("app-storage:/myfolder/myFile.zip"); myStream.load(new URLRequest(f.nativePath)); on Windows this seems to work without problems - but on OS X the URLStream dispatches a SecurityErrorEvent.SECURITY_ERROR with the message: Error #2032: Stream Error. URL: app:/Users/myUserName/Library/Preferences

C# WebBrowser send Mouse Click Event to Flash Object

我怕爱的太早我们不能终老 提交于 2020-01-03 05:16:12
问题 I've been reading around but didn't seem to find an answer to this question. The objective is: I have a WebBrowser in a Windows Forms Project. There is a HTML page loaded, and in that HTML page there is a Flash Object. My goal is to send a Mouse Click to (x, y) positions of that Flash Object. The (desired) Requisites The window with the Windows Forms executable doesn't need to be active in order for this to work The mouse must not be captured Send a mouse click based on coordinates (x, y),