flex4

Use JQuery or onbeforeunload for IE and FF

混江龙づ霸主 提交于 2019-12-01 03:14:10
I'm working in a Flex4 application, using javascript, in the "index.template.html" document. I'm having an issue being able to use onbeforeunload with Firefox. The application works perfectly in IE, but the exact same one doesn't sit well with FF. (See below) <script type="text/javascript"> window.onbeforeunload=before; window.onunload=after; function before(evt) { var flex=document.$(application)||window.$(application); flex.unloadMethod(); //custom method to log out the user } function after(evt) { } </script> From what I've found, FF doesn't seem to register onbeforeunload events, so I

Extending MXML custom components via MXML

眉间皱痕 提交于 2019-11-30 23:11:46
问题 What I'd like to do: create an MXML component with some children, then extend it via MXML to create a new component with more children, without losing the original set. In other words create a component bc.mxml <?xml version="1.0" encoding="utf-8"?> <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"> <s:Button id="b1" label="button1"/> </s:BorderContainer> and then extend it

Whats the itemChangeEffect equivalent in Spark List?

安稳与你 提交于 2019-11-30 21:04:11
In flex 3, with List component, you could add an effect to the itemChangeEffect property, allowing you to animate the addition/removal of the items in the list control. The equiv in the spark list appears to be the rendererAdd and Removed events, but this doesn't allow complete control over the effect, since removal is done as soon as the event has been dispatched, allowing no time for the effect. Does anyone know how to accomplish the same on a spark list? Lance Pollard Check out this answer on Stack Overflow: Animating Child Elements in Flex 4 . Flex 3 Lists had the itemChangeEffect

Whats the itemChangeEffect equivalent in Spark List?

扶醉桌前 提交于 2019-11-30 17:11:13
问题 In flex 3, with List component, you could add an effect to the itemChangeEffect property, allowing you to animate the addition/removal of the items in the list control. The equiv in the spark list appears to be the rendererAdd and Removed events, but this doesn't allow complete control over the effect, since removal is done as soon as the event has been dispatched, allowing no time for the effect. Does anyone know how to accomplish the same on a spark list? 回答1: Check out this answer on Stack

Communication between c++ and actionscript 3

喜欢而已 提交于 2019-11-30 13:59:51
Is it possible to use any IPC mechanism for calling a c++ api from Adobe Flash actionscript? Are there any good examples? Update: I primarily want it for desktop apps now i.e Adobe's/or anyuone else's desktop runtimes It is not possible from the browser-player. From an AIR application, you can use Socket API to do IPC. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html?allClasses=1 If you target the Adobe AIR runtime, you can leverage the NativeProcess API that was introduced in AIR 2.0. This API allows you to spawn external processes and communicate with

Adobe Flash Builder (flex4): addChild() is not available in this class.

懵懂的女人 提交于 2019-11-30 07:27:19
I want to load an swf into a flex 4 application in order to use its classes. var ldr:Loader=new Loader(); ldr.load(new URLRequest("file://path/to/fileswf")); ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded); function loaded(evt:Event):void { addChild(ldr); } I receive the error: Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one. at spark.components.supportClasses::SkinnableComponent/addChild()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:966] at main/private:init

Preventing the bounding box of transparent Bitmap Sprite from triggering mouse events

蓝咒 提交于 2019-11-29 18:17:56
I thought I had solved my mouseEvent problem for Sprites containing a Bitmap with an alpha channel but I've encountered a new issue shown in the image below: the bounding box of the "Eurasia" map Sprite is triggering a `MouseEvent.Roll_Out" for the "Africa" Sprite. My setup: Each map piece is a Sprite with a child Bitmap (PNG with alpha) and a "hitArea" Sprite derived from the Bitmap. The relevant code is below. This works great – except in the case where there are bounding box overlaps. The eventListeners I attach to each Sprite use MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT but I have also

How to pass image from a flex application to a asp net c# web service?

白昼怎懂夜的黑 提交于 2019-11-29 17:43:35
I want to store images from the flex application to a asp net web service and at a later point will be sending these images back to flex application . Can you please give a example web method in c# or suggest a website to read about how to do this. I tried goggling but couldn't find anything very useful mizi_sk There are two ways I can think of: use AMF and send ByteArray to C# (flex to c#) use URLRequest and it's data property to send ByteArray encoded in Base64 via HTTP POST 来源: https://stackoverflow.com/questions/5702239/how-to-pass-image-from-a-flex-application-to-a-asp-net-c-sharp-web

Spark effects: why is procedural code preferred over triggers?

旧街凉风 提交于 2019-11-29 16:19:55
In Flex 3, MX effects could be triggered like this: <mx:Resize id="myEffect" /> <mx:Button mouseDownEffect="{myEffect}" /> In Flex 4, Spark effects are triggered like this: protected function onClick(event:MouseEvent):void { resizeEffect.end(); resizeEffect.play(); } ... <s:Resize id="resize" /> ... <s:Button click="onClick(event)" /> What was the reason to use this less declarative and longer approach? I couldn't find the answer anywhere in the docs. (Two things to note: There might be small differences between mouseDown trigger and the click event, please ignore that, it's just an example. I

FXG Editor for Flex

て烟熏妆下的殇ゞ 提交于 2019-11-29 14:10:19
问题 The only FXG editor I've seen for Flex is by 7jigen, works online or as a Flex app. Does anyone know of a different one? It can be done in Illustrator I think, but that doesn't really offer a simple export to Flex type option, just gives coordinates. 回答1: As far as I know your best bet (if you don't want to use Illustrator) is to grab Inkscape and install the "save as FXG" plug-in. Hats off to JazzyNico for writing what is basically a monster SVG to FXG "XSL Transform" (i.e. XSLT). How to