flex3

How to pass parameter to Custom Component written in ActionScript

大憨熊 提交于 2019-12-10 16:34:57
问题 I have a custom component written in ActionScript. It has constructor which is expecting some arguments. I want to include that custom component in mxml like this, Main.mxml ... <custom:CustomActionScriptComponent/> // Error line .. .. But, it shows me an error saying Error 1136: Incorrect number of arguments. Expected 1. How to pass parameter in MXML file, to that custom ActionScript component? 回答1: As tags, MXML does not support class constructors. Per your ActionScript class, you could

Audio recorded file corrupted issue in Actionscript

谁都会走 提交于 2019-12-10 14:25:48
问题 I recorded voice samples from my microphone using Adobe Flash Builder 4.6 / AIR, voice recorded successfully. I first converted voice data(byte array) to base64 format in actionscript then I converted that base64 data to WAV file using my PHP code. but that WAV file throw file corrupted issue in RiffPad. RIFFPad is a viewer for RIFF formatted files like WAV, AVI. expected wav file specification: sampling Rate : 22KHZ // -- saves the current audio data as a .wav file protected function

reading simple INI file with AS3

孤人 提交于 2019-12-10 13:41:41
问题 What AS3 class should I use to read a simple property/ini file into memory to configure some settings such as colors easily for the project. format could be key=value <newline> I like to access it with this kind of API: trace ( Settings.get("key") ) 回答1: There is no built-in way to do this in AS3, but we have support for loading and parsing properties files in Spring ActionScript. Here are the direct links to the sources: Properties PropertiesParser (used internally in Properties) 回答2: I you

Compare Flex 3 and 4 [closed]

这一生的挚爱 提交于 2019-12-10 12:26:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Where can I find a chart or some article to compare Flex 3 and new 4. 回答1: The official Adobe Flex 4 Open Source site is currently the best place to find information about this upcoming version of the framework. It's worth noting, however, that Flex 4 is still in development, and they don't even consider it beta

HTTPService/ResultEvent with Flex 3.2 versus Flex >= 3.5

自古美人都是妖i 提交于 2019-12-10 10:28:53
问题 through a design decission or what-so-ever Adobe changed the content of the ResultEvent fired by a HTTPService Object. Take a look at following example: var httpService:HTTPService = myHTTPServices.getResults(); httpService.addEventListener(ResultEvent.RESULT,resultHandler); httpService.send(); /** * Handels the login process */ function resultHandler(event:ResultEvent):void { // get http service var httpService = (event.target as HTTPService); // do something } It works like a charm with

ActionScript: Package-level introspection? Or some other pluggable loading scheme?

人走茶凉 提交于 2019-12-10 09:46:37
问题 I'm coding up some delicious business logic and I've come to a situation like this: There are a bunch of rules ( ruleA , ruleB , etc...) which all follow a standard pattern. I've created a Rule interface, and implemented it in RuleA , RuleB , and so on. So now I just need a way to load them. Right now I'm using a map: var rules:Object = { ruleA: new RuleA(), ruleB: new RuleB(), ... }; Then calling it like this: function doStuff(whichRule:String, someData:Object):* { return rules[whichRule]

Trace on Chrome/Browser console

安稳与你 提交于 2019-12-10 01:50:04
问题 Does anybody know how to trace messages in the google chrome console using Flex3. In the logs section for example. 回答1: import flash.external.ExternalInterface; ExternalInterface.call("console.log", "YourString"); See here for more information. 来源: https://stackoverflow.com/questions/13493790/trace-on-chrome-browser-console

ActionScript code to convert bytes to kb, mb, gb etc

…衆ロ難τιáo~ 提交于 2019-12-09 00:40:58
问题 I have a utility function that will display a filesize in an appropriate form like Windows Explorer does, i.e; convert it to nearest KB, MB, GB etc. I wanted to know if the code that i wrote is correct, and if it can be made simpler. The function that i wrote is as follows : public static function formatFileSize(bytes:int):String { if(bytes < 1024) return bytes + " bytes"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Kb"; else { bytes /= 1024; if(bytes < 1024) return bytes + " Mb";

Canvas total width (visible width + hidden scrollable part)

落爺英雄遲暮 提交于 2019-12-08 18:59:27
It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial. I have a Canvas control with a fixed width and a horizontal scrollbar. I'm trying to find the actual width of the control. The .width (fixed width) + the part being revealed by the scrollbar. I tried explicitWidth, width + maxHorizontalScrollPosition, and some other combos but non of them hit the spot. Well as it seem width + maxHorizontalScrollPosition is indeed enough. The problem was with the order of events in my application (the scrollbar didn't have enough time to update it's display). I

Skin Flex 4 combobox to look like Flex 3 combobox

心已入冬 提交于 2019-12-08 14:09:25
As I have migrated my application to Flex 4 recently, I want to utilize the <s:Combobox> component in my application rather than <mx:Combobox> . The problem is that the look and feel of both are different. How can I make the <s:Combobox /> component look (all skinning e.g. hover over, click, outline) exactly the same as <mx:Combobox /> ? More specifically, I want to apply the Halo theme to a DropdownList component. Is that possible? You could just set the default skin for your application to Hero instead of Spark. Assuming you're using Flash Builder: Click on Project -> Properties . Click Flex