actionscript

Flex 3 - how to support HTTP Authentication URLRequest?

自古美人都是妖i 提交于 2019-11-26 09:29:16
问题 I have a Flex file upload script that uses URLRequest to upload files to a server. I want to add support for http authentication (password protected directories on the server), but I don\'t know how to implement this - I assume I need to extend the class somehow, but on how to I\'m a little lost. I tried to modify the following (replacing HTTPService with URLRequest), but that didn\'t work. private function authAndSend(service:HTTPService):void{ var encoder:Base64Encoder = new Base64Encoder()

What is the best way to get the minimum or maximum value from an Array of numbers?

回眸只為那壹抹淺笑 提交于 2019-11-26 06:32:09
问题 Let\'s say I have an Array of numbers: [2,3,3,4,2,2,5,6,7,2] What is the best way to find the minimum or maximum value in that Array? Right now, to get the maximum, I am looping through the Array, and resetting a variable to the value if it is greater than the existing value: var myArray:Array /* of Number */ = [2,3,3,4,2,2,5,6,7,2]; var maxValue:Number = 0; for each (var num:Number in myArray) { if (num > maxValue) maxValue = num; } This just doesn\'t seem like the best performing way to do

How to detect when a youtube video finishes playing?

橙三吉。 提交于 2019-11-26 02:16:59
问题 I am working on a site that has a ton of embedded youtube videos, the client wants to show a popup whenever a video stops splaying. I looked at the youtube api and there seems to be a way to detect when a video ends: http://code.google.com/apis/youtube/js_api_reference.html but I can\'t embed the videos like they mentioned on that page since the videos are all already on the site (thousands that have been added manually by pasting embed code). Is there a way to detect the ending of these

What is the best way to stop people hacking the PHP-based highscore table of a Flash game

此生再无相见时 提交于 2019-11-26 00:29:33
问题 I\'m talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc. What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple methods in the past of making multiple calls for a single score and completing a checksum / fibonacci sequence etc, and also obfuscating the SWF with Amayeta SWF Encrypt, but they were all