actionscript-3

Actionscript 3 Get clipboard data (fp 11)

﹥>﹥吖頭↗ 提交于 2019-12-25 01:15:37
问题 I would like to get clipboard text in AS3 (flex, flashdevelop). I know I can't just monitor clipboard, because while most other environments can, flash application are evil and can guess when they see a password and to what account it actually belongs. That's why I listen to an MouseEvent.CLICK event, but looks like it changed recently and Flash still says "no, no!". That's why I addEventListener ( Event.Paste ) to a TextField, but looks like the TextField doesn't dispatch such an Event. I

How to fill a rectangle with any color in AS3?

守給你的承諾、 提交于 2019-12-25 00:53:22
问题 Am drawing a rectangle to move my scrubBar in a progressbar, it's working fine, now i need to fill the rectangle with some colors ? private function startScrubbingOUT(_arg1:MouseEvent){ this.cueCard.stage.addEventListener(MouseEvent.MOUSE_UP, this.stopScrubbingOUT); this.cueCard.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.scrubBarIsMovingOUT); this.scrubbing = true; var _local2:Rectangle = new Rectangle(this.controls_mc.progressBar_mc.x, this.controls_mc.scrub_outpoint_mc.y, this

Adding an image on the right side of the title bar of a panel in Flex 4

社会主义新天地 提交于 2019-12-25 00:49:14
问题 I'm trying to create a MXML component based on the spark Panel and I would like to add an image on the right end of the title bar, so that the panel will have a text on the title bar and a small image at the right end. I'm using a skin to define the colors, background fill etc. But how do I add this image at the right end of the title bar? I would like to make that image cutomizable so that when the component is inserted, either the default image is used or a new image can be provided. Please

fixed row width in DataGrid quirk

戏子无情 提交于 2019-12-25 00:29:42
问题 I've got this issue: I've got a dataGrid where whenever I set the column to not be resizable, the width gets messed up; works: var myCol:DataGridColumn = new DataGridColumn("Title"); myCol.width = 180; doesn't work (width is about 40pixels): var myCol:DataGridColumn = new DataGridColumn("Title"); myCol.width = 180; myCol.resizable = false; has anyone come across this or know why this is happening? I'm ready to just create my own dataGrid class now... 回答1: One thing that has helped us in the

Flex: Looking for design pattern to display busy cursor while my app is “busy”

筅森魡賤 提交于 2019-12-25 00:25:08
问题 I have a Flex 4 app that now and then needs to do a lot of processing, which causes a user to wait a few seconds for it to complete. I know Flex allows one to set and remove busy cursors via the cursor manager. I'm using it as follows: CursorManager.setBusyCursor(); // add busy cursor // execute lengthy processing here; e.g. switch to a new screen with a lot of layout CursorManager.removeBusyCursor(); // remove busy cursor However, in practice, for certain situations, the busy cursor doesn't

How do you make Flash not render an object on the Stage?

橙三吉。 提交于 2019-12-25 00:14:45
问题 This discussion started over here but I thought it would be nice to have a definitive answer... So let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't see the object but also so that the AVM2 doesn't even factor it in when rendering the stage for the user? I always thought the answer was to set visible = false but there is an argument out there that the object has to placed outside the boundaries of

Flash AS3 Attach SWC Symbol Based on XML Element

╄→гoц情女王★ 提交于 2019-12-24 23:37:34
问题 I have a SWC which contains 8 sprites, each of which has a linkage identifier with the pattern Icon01, Icon02, etc. I can create an instance of one of these sprites by doing something of the form var i:Icon01 = new Icon01(); this.addChild(i); However, I have an XML file which contains different messages, and each message contains an image element that is labeled in the same fashion ... <message> <image>Icon01</image> </message> ... I would like to be able to parse the XML and have the

How do I call a RemoteObject method from ActionScript?

回眸只為那壹抹淺笑 提交于 2019-12-24 23:19:38
问题 What's the ActionScript equivalent of this MXML? <mx:RemoteObject id="Server" destination="Server" source="gb.informaticasystems.Server" fault="handler_backendCommunicationFails(event)" > <mx:method name="executeQuery" result="handler_fetchDataRequestSuccess(event)"/> </mx:RemoteObject> TIA! 回答1: You just need to call: Server.executeQuery(...); After it executes, you handle the result in your handler, which you specified as: private function handler_fetchDataRequestSuccess(event:ResultEvent);

AS3 override addChild(), test for type

不打扰是莪最后的温柔 提交于 2019-12-24 23:15:41
问题 this works for me, but does it look correct in terms of as3 best practices. is it correct to return null if it fails? override public function addChild(child:DisplayObject):DisplayObject { if(child is Screen) { super.addChild(child); return child; } return null; } 回答1: I see a couple of options and none feels completely "right". The best solution, as I see it, is not possible in Actionscript (I think this is allowed in other languages). That is, declare that you will accept only instances of

AS3 photoshop brushes

。_饼干妹妹 提交于 2019-12-24 22:57:38
问题 I'm searching for a way to build a photoshop like drawing tool in ActionScript 3. Especially I want to build something like the brushes in photoshop. So that you can use different PNG's as a brush. I tried it with saving a brush in photoshop as a transparent png, import it into my AS3 project and with a mouse move event, draw the png everytime you move the mouse into a bitmapdata object. But that doesn't look like photoshop. Here's a example, first the photoshop drawing, then the as3 drawing: