actionscript-3

combinations with varying length and without repetition

吃可爱长大的小学妹 提交于 2020-01-01 19:46:12
问题 Can anyone suggest an easy way of getting all combinations without repeats, and with a varying length ? [0,1,2,3,4] (2's) : [0,1],[0,2],[0,3] ... [3,4] (3's) : [0,1,2],[0,1,3] ... [2,3,4] (4's) : [0,1,2,3],[0,1,2,4] ... [1,2,3,4] 回答1: took me a while but I think I've got it here... this has all the combinations without repeats var arr:Array = [0, 1, 2, 3, 4]; var $allcombos:Array = []; findCombos($allcombos,[],arr); function findCombos($root:Array, $base:Array, $rem:Array):void { for (var i

How does the preloader work in as3?

会有一股神秘感。 提交于 2020-01-01 19:41:48
问题 I've read multiple examples on this, but I just don't get how it works. How does the class know it's THE pre-loader? How does flash know to load one class but not another? How much can I do in a preloader? :-p I'm using FlashDevelop atm and it's generating the project for me - however, from all the examples I checked they didn't explain how it worked either. 回答1: Are you familiar with the Flash timeline? By default, your SWF would have one frame. This frame contains your Preloader.as class.

How does the preloader work in as3?

萝らか妹 提交于 2020-01-01 19:41:13
问题 I've read multiple examples on this, but I just don't get how it works. How does the class know it's THE pre-loader? How does flash know to load one class but not another? How much can I do in a preloader? :-p I'm using FlashDevelop atm and it's generating the project for me - however, from all the examples I checked they didn't explain how it worked either. 回答1: Are you familiar with the Flash timeline? By default, your SWF would have one frame. This frame contains your Preloader.as class.

as3 - render text straight to Sprite.graphics?

醉酒当歌 提交于 2020-01-01 18:19:16
问题 Because I'm a terrible, bad person who likes to do things differently for no reason, I'd love to be able to do something like mySprite.graphics.drawText(...). As I understand things, the only way to get text currently is to create a TextField and add it as a child of mySprite. In my particular situation I'd rather not do that. Any advice appreciated! ooo 回答1: If you wanted to wrap it up in a method of Sprite I would simply extend the Sprite class, add the function drawText to it. Within that

How open pdf in Air for Android/Black berry

无人久伴 提交于 2020-01-01 17:09:56
问题 I want to open pdf in Air for Android/Black berry. How i do that? I use AIR 2.6 and IDE is Flash Builder 4.5. 回答1: StageWebView. http://help.adobe.com/en_US/as3/dev/WS901d38e593cd1bac3ef1d28412ac57b094b-8000.html Example copied from the link above: package { import flash.display.MovieClip; import flash.media.StageWebView; import flash.geom.Rectangle; public class StageWebViewExample extends MovieClip{ var webView:StageWebView = new StageWebView(); public function StageWebViewExample() {

How open pdf in Air for Android/Black berry

╄→гoц情女王★ 提交于 2020-01-01 17:09:12
问题 I want to open pdf in Air for Android/Black berry. How i do that? I use AIR 2.6 and IDE is Flash Builder 4.5. 回答1: StageWebView. http://help.adobe.com/en_US/as3/dev/WS901d38e593cd1bac3ef1d28412ac57b094b-8000.html Example copied from the link above: package { import flash.display.MovieClip; import flash.media.StageWebView; import flash.geom.Rectangle; public class StageWebViewExample extends MovieClip{ var webView:StageWebView = new StageWebView(); public function StageWebViewExample() {

AS3 Using a Loader to load a file protected by htaccess

不问归期 提交于 2020-01-01 15:56:06
问题 I'm attempting to load an external SWF that's hosted on a site into a local SWF file. The external SWF is in a password-protected directory using htaccess. Here is the code I'm currently trying to use: var loaderUrlRequest:URLRequest = new URLRequest("http://www.my-website.com/externalFlashFile.swf"); loaderUrlRequest.requestHeaders.push(new URLRequestHeader("Authorization", "Basic " + $Base64.encode("username:password"))); loaderUrlRequest.method = URLRequestMethod.POST; loaderUrlRequest

How to make a scrollable UI In Touch Flash CS5 for Mobile Devices (Primarily iOS)

橙三吉。 提交于 2020-01-01 15:07:16
问题 I wanted to know how I would make a whole symbol (an image) scrollable? I have found out how to do the multi-touch pinch to zoom but I can't find any code samples that will let me make the image scroll vertically only with one finger. So all I want to do is make an image scroll up and down with a single finger input. Are there any simple methods or sample code anyone could give me? 回答1: There are two ways to make an image scrollable in an AS3 mobile project: using the Pan gesture (two fingers

How do I produce a screenshot of a flash swf on the server?

我们两清 提交于 2020-01-01 15:07:07
问题 I'm writing a flash app using the open source tools. I would like to load a data file in to the app and capture a screenshot of the stage on the server. The only part that seems mysterious is running the app on the server. In fact, I don't even care if it's the same app running on the server and in the browser--if I can use the flash stage and drawing routines to produce an image server-side, I'm happy. If I have to delve in to flex, fine. Right now I'm having problems finding any starting

How do I produce a screenshot of a flash swf on the server?

笑着哭i 提交于 2020-01-01 15:05:59
问题 I'm writing a flash app using the open source tools. I would like to load a data file in to the app and capture a screenshot of the stage on the server. The only part that seems mysterious is running the app on the server. In fact, I don't even care if it's the same app running on the server and in the browser--if I can use the flash stage and drawing routines to produce an image server-side, I'm happy. If I have to delve in to flex, fine. Right now I'm having problems finding any starting