flex4.5

Dispatching custom event from a custom component

会有一股神秘感。 提交于 2019-12-11 07:11:44
问题 I have a custom Flex 4.5 component (to be used in a List) - Game.mxml (represents a clickable playing table in a card game): <?xml version="1.0" encoding="utf-8"?> <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:comps="*" width="160" height="160" autoDrawBackground="false" creationComplete="init(event)"> <fx:Metadata> [Event(name="pref_event", type="PrefEvent")] </fx:Metadata> <fx:Script> <!

Restrict input to a specified language

不羁岁月 提交于 2019-12-11 07:10:32
问题 I use a TextInput component of Flex 4.5 to enter some text in English. I use the restrict attribute to ... restrict the keyboard input to characters a-zA-Z only. The problem is that if i copy/paste a word in another language, i can then paste it into the TextInput component. Is there a way to avoid that? If no, how can i validate the input against a specified language? I found out that the unicode set of Chinese+ language symbols is \u4E00 to \u9FFF. So i write the following: var chRE:RegExp

Google Maps JS API v3 will not load inside Flex Mobile StageWebView

主宰稳场 提交于 2019-12-11 06:54:30
问题 I am trying to load a StageWebView with the Google Maps Javascript API inside a Flex Mobile application as a workaround for the Google Maps API for Flash not working on iOS. I am using the stageWebView.loadString() method. Below is the relevent portion of HTML.Javascript being loaded. My issue is that everything works perfectly when I view this in a browser (IE, Chrome and Safari) and in the Flash Builder iPhone/iPad simulators. On the actual device the map never loads, and through some try.

Left alignment for last line of textlayoutformat

。_饼干妹妹 提交于 2019-12-11 05:07:16
问题 I set textLayoutFormat.textAlign = TextAlign.JUSTIFY; for following tlf sample text sample text sample text sample text sample text sample text sample text but it look like this sample text sample text sample text sample text sample text sample text sample text I want to set left align for last line. 回答1: use textAlignLast property. Example: <s:TextArea textAlign="justify" textAlignLast="right" text="sample text sample text sample text sample text sample text sample text sample text "/>

how to upload multiple images in to a server?

孤街醉人 提交于 2019-12-11 04:51:39
问题 I tried to upload the image in to the server using Flex.The coding is compiled and run sucessfully but the images are upload at a time. i want to upload images seperately and also put progres bar to upload each image uploaded. can any one help me? 回答1: You can achive this with the FileReferenceList, you can find all the info and example code here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReferenceList.html 来源: https://stackoverflow.com/questions

Looping over elements inside an element in Flex

浪子不回头ぞ 提交于 2019-12-11 03:42:02
问题 I have the following function in Flex 4: protected function initEventHandlers():void { imageContainer.addEventListener(DragEvent.DRAG_ENTER, acceptDrag); imageContainer.addEventListener(DragEvent.DRAG_DROP, handleDrop); img_1.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); img_2.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); img_3.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); img_4.addEventListener(MouseEvent.MOUSE_DOWN, handleDrag); } I didn't like the look of this code

Get SIM Number programmatically in flex

情到浓时终转凉″ 提交于 2019-12-11 03:37:09
问题 i want to get the SIM number programmatically.Is it possible in flex?In android developer guide i saw telephony manager class,likewise do we have anything in flex?? Thanks in advance.. 回答1: Check this out... a hack for sure, but a way for you to call into the Java APIs (Android) from Flex Mobile: http://www.jamesward.com/2011/05/11/extending-air-for-android/ 来源: https://stackoverflow.com/questions/5858151/get-sim-number-programmatically-in-flex

Create combobox with non selectable separator

大憨熊 提交于 2019-12-11 03:15:25
问题 I'd like to custom combobox. Indeed, I like to create a combox with two array separate by a line like that. The line between All and above 40 must no selectable. Do you know how to do that? Thanks for helping 回答1: Let's say we have a ComboBox with a model like this: <s:ComboBox> <s:ArrayList> <fx:String>A</fx:String> <fx:Object /> <fx:String>B</fx:String> </s:ArrayList> </s:ComboBox> The Strings are our regular elements and the Object represents the separator. I'm simplifying things here, but

Flex MX:HTML handling errors and loading problems

試著忘記壹切 提交于 2019-12-11 03:08:55
问题 I have a simple mx:html that load a page.. I'd like to show a popup when there is a problem loading the page... How can I handle this event? I have not find anything useful on the web :( 回答1: mx:html is based on htmlloader, and unfortunately you cannot read HTTP headers using this object, so you cannot read the HTTP status. Several workarounds are: a)use an urloader before the htmlloader and check the HTTP status b)you can read the html page content with yourhtmlcontrol.htmlloader.window

JPEGEncoderOptions is undefined

ぐ巨炮叔叔 提交于 2019-12-11 03:04:05
问题 I get a runtime error that JPEGEncoderOptions is an undefined variable when running the below code in AIR 3.5: rawBitmapData.encode(rawBitmapData.rect, new JPEGEncoderOptions(), rawByteArray); 回答1: Make sure the following files in your sdk are up-to-date in the folder \yoursdk\frameworks\ air-config.xml flex-config.xml airmobile-config.xml Update this: <target-player>11.5</target-player> <swf-version>18</swf-version> This ensures your runtime is up-to-date See : Use Adobe Air 3.3 SDK with