actionscript-3

Debug JavaScript injection in ActionScript (Flash Builder)

心不动则不痛 提交于 2019-12-25 02:49:09
问题 I'm working on a InDesign CS6 Extension in Adobe Flash Builder 4.6. For some reason my code (which worked fine for a long time) now throws the error null is not an object . The error is located in a javascript injection (last line): public class Script { private static var _instance:Script; [ Embed (source="script.jsx", mimeType="application/octet-stream") ] private var ScriptClass:Class; private var jsxInterface:HostObject; public function Script() { if (Script._instance) { throw new Error(

Loading swf and using it through interface

*爱你&永不变心* 提交于 2019-12-25 02:48:22
问题 I've created simple swf with interface: public class Test extends MovieClip implements ITest { public function Test() { Security.allowDomain("*"); Security.allowInsecureDomain("*"); } public function speak(str):String { trace(str); return "yeah"; } } ITest: public interface ITest { // Interface methods: function speak(str):String } And then I'm trying to load it: public function SWFLoader() { var url='http://xxxxxxxx/test.swf'; var loadURL:URLRequest=new URLRequest(url); var loader:Loader =

ActionScript: code for finding mac address doesn't work

微笑、不失礼 提交于 2019-12-25 02:34:24
问题 I have the following code in Actions of a keyframe in Adobe Flash Professional CS6: var networkInterface : Object = NetworkInfo.networkInfo.findInterfaces(); var networkInfo : Object = networkInterface[0]; var physicalAddress : String = networkInfo.hardwareAddress.toString(); When I hit Ctrl+Enter to run the movie, I get the following compiler error: Scene 1, Layer 'Layer 1', Frame 2, Line 1 1120: Access of undefined property NetworkInfo. What do I do wrong? 回答1: you must add: import flash

Adobe Flex 4.6 WebService request timeout

徘徊边缘 提交于 2019-12-25 02:34:15
问题 The code to get connected to my WebService (Lotus Notes Database) is created by the Flash Builder over "Data/Connect with WebService...". All works fine, but I have a problem to increase the request timeout. The API says that you can set the request timeout like this: _serviceControl.requestTimeout = 300; On a iOS (iPad) it seems to be work all fine. But if I run my app on desktop or on an android smartphone this only works if I set up the request timeout lower than ~30 seconds. If I don't

swf not updating when file xml and swf not in the same domain

旧时模样 提交于 2019-12-25 02:26:39
问题 xml, and i want to get data from external file xml in remote server using AS3, My problem is data xml is showing in consol (trace (data)) but not showing in swf file. if the swf and xml are in the same domain there is no problem. my crossdomain <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="*" /> <site-control permitted-cross-domain-policies="by-content-type"

AS3: global var of type SimpleButton changes to DisplayObject for unknown reason, won't let me access .upState.textColor!

≯℡__Kan透↙ 提交于 2019-12-25 02:25:27
问题 This is a problem that's best explained in code. I don't see how active_button.upState , which I know is a TextField (see trace statements), mysteriously turns into a DisplayObject when I try to access the textColor property. I've included the error messages below for reference. Also, why is it that when I have an object that I know is a SimpleButton (again, see traces) I need to cast it to SimpleButton in order to store it in a var? That doesn't make any sense to me. All help is much

Downloading and saving files with AIR for iOs

独自空忆成欢 提交于 2019-12-25 02:25:14
问题 For a project we need to download and save pdf files on an IPAD device for offline use through an AIR for iOs application. After a lot of searching I haven't found much information on this subject. My question is, can it be done, and if so, can you provide us with some pointers to lead us in the right direction. Thanks for your time! 回答1: Sure, first you check if you can access the web - can use a class like air.net.URLMonitor , if you can you can set up a URLStream instance. You get data

AS3: Large text files with indexOf() on an array

[亡魂溺海] 提交于 2019-12-25 02:21:46
问题 I am embedding the sowpods dictionary into an array in AS3 then submit searches using indexOf() to verify existence of the word. When I load a smaller text file it seems to work but not the larger. Since the file is embedded during compile, there shouldn't be an event for loading to listen to right? Code: package { import flash.display.MovieClip; public class DictionaryCheck extends MovieClip { [Embed(source="test.txt",mimeType="application/octet-stream")] // Works fine 10 rows. //[Embed

AS3 - Returning a property of a class rather than the class itself

时光毁灭记忆、已成空白 提交于 2019-12-25 02:15:19
问题 In ActionScript 3, there are some classes that will represent a value rather than the class itself. It's hard to explain properly what I mean, so take this example: var str:String = "something"; var mc:MovieClip = new MovieClip(); trace(str); // something trace(mc); // [object MovieClip] You'll notice that the first trace outputs a value, rather than [object String] . Ontop of this, I can still make use of methods of String , like this: var ar:Array = str.split('s'); Even though in a way you

AS3: removing objects by array item reference

断了今生、忘了曾经 提交于 2019-12-25 02:11:33
问题 I am trying to add some Sprite objects as the contents of an array, and I would like to be able to "clear" them from the stage. I would assume that if there are loaders involved, I need to do _imgArray[i].close(); _imgArray[i].unload(); And if I am using a sprite, I can do: removeChild(_imgArray[i]); None of the above work. WHY??? For an example and/or description of how I am setting this up, see Joel's post here ...but note that he hasn't included a reference for deleting them from view.