actionscript

Referencing own constructor in inner function

大兔子大兔子 提交于 2019-12-13 00:46:32
问题 Here's a toy example distilled from a complex class: public class MyClass { public function MyClass() { trace('Created'); } public static function makeObjectAsync(callback:Function):void { inner(); function inner():void { var object:MyClass = new MyClass(); // line 10 callback(object); } } } After calling the static function: MyClass.makeObjectAsync(function(object:Myclass):void { ... }) the following run-time exception occurs at line 10: TypeError: Error #1007: Instantiation attempted on a

Flex RemoteObject timeouts?

牧云@^-^@ 提交于 2019-12-13 00:41:11
问题 I've been tinkering around with Flex RemoteObjects, and I've found that they aren't very well behaved with respect to timing out. First, I can't figure out how to set a timeout on "connect". I know I can set requstTimeout , which will correctly timeout after an initial handshake… But if the server doesn't handshake, the connection doesn't time out (eg, the server accepts the connection, then does nothing with it, the client will just be left hanging). Second, when a requestTimeout fires

Codesigning SWF?

若如初见. 提交于 2019-12-12 23:23:02
问题 AIR allows to inject code using Loader.LoadBytes() this allows to download remote plugins as swf files which will have full access to everything that the AIR application has access to. This imposes a security risk, so it would be desirable to digitally sign the swf's. What's the best way to do this and to verify the code signature? I know the as3corelib has some encryption functionality and also for X.509 certificate - but I didn't find a ressource explaining how to use it. Also, maybe there

Converting Date with Time in PST into UTC format

北慕城南 提交于 2019-12-12 20:40:14
问题 i am having a variable str(string type)having "28-Nov-2013 09:15 AM" as its value.How to convert it into UTC format(the above mentioned time in str variable is in PST, hence UTC should be 8 hours more than that).I am using flex 2.Find below is following code which is not working:- txtDate.text= formatDateUTC(txtDate.text); //here txtDate.text=28-Nov-2013 09:15 AM private function formatDateUTC(originalDate:String):String { Alert.show('original '+originalDate); var dtValue:Date = new Date(Date

How to resize an external SWF to fit into a container?

主宰稳场 提交于 2019-12-12 19:58:21
问题 What I want to accomplish is to resize an external SWF so that it fits into the display object that is presented as a container on the stage. For now it show up outside of the container. Important: I do not want an external SWF to occupy the whole stage; I have a special place (that container) for it on the stage. 回答1: public function loaderComplete(event:Event):void { var content:MovieClip = MovieClip(event.currentTarget.content ); //the dimensions of the external SWF var _width:int =

How do I change the colours of a textarea in actionscript?

丶灬走出姿态 提交于 2019-12-12 19:33:16
问题 I create a TextArea in actionscript: var textArea:TextArea = new TextArea(); I want it to have a black background. I've tried textArea.setStyle("backgroundColor", 0x000000); and I've tried textArea.opaqueBackground = 0x000000; but the TextArea stays white. What should I do? 回答1: TextArea is a UI component built from TextField and other Flash built-in classes and UIComponents. As with most of the Adobe UI components, nothing is as it seems when setting properties. To set the color of the area

How do I add the SWC file for Cairngorm to my app without FlexBuilder?

瘦欲@ 提交于 2019-12-12 19:30:47
问题 I am not using FlexBuilder, I'm using the free Flex SDK with TextMate. I'm having some trouble figuring out what this FlexBuilder process actually does behind all the nice dialogs and things, so that I can do the same thing by tweaking whatever the relevant file is, but Googling just points me at similar instructions telling me to use FlexBuilder. Anyone able to point me in the right direction? 回答1: mxmlc considers a swc a library (it's actually a zip file that you can examine) so you'll want

How to expose the JavaScript interface for an embedded Flash object?

纵饮孤独 提交于 2019-12-12 18:13:46
问题 JavaScript and the Flash Player can exchange data via Flash's ExternalInterface mechanism: you register ActionScript functions that you would like to be able to be called from JavaScript. My question: How can I figure out what ActionScript functions of a Flash object are available for me to call from JavaScript (assuming they are not documented)? Is there a programatic way to do this in JavaScript? Thanks! 回答1: you can't enumerate them directly (they won't be listed in a for..in loop), but

How to change screen background color in ActionScript 3.0?

China☆狼群 提交于 2019-12-12 18:10:52
问题 How to change screen background color in ActionScript 3.0 ? and how to navigate one screen to another screen in ActionScript3.0; i have used a button in my project, when i click the button the present screen should be invisible and another screen should come in the onclick method i called like this : presentscree.visible = false; nextscreen:NextScreen = new NextScree(); nextscreen.visible = true; But no result; can any one help me on this ? 回答1: You need to add the screen to the DisplayList

Netstream and step() or seek()?

此生再无相见时 提交于 2019-12-12 16:17:06
问题 I'm on an AS3 project, playing a video (H264). I want, for some special reasons, to go to a certain position. a) I try it with NetStream.seek(). There it only goes to keyframes. In my current setting, this means, i can find a position every 1 second. (for a better resolution, i'd have to encode the movie with as many keyframes as possible, aka every frame a keyframe) this is definetly not my favourite way, because I don't want to reencode all the vids. b) I try it with NetStream.step(). This