actionscript

get string representation of a variable name in as3

人盡茶涼 提交于 2019-11-28 11:36:23
问题 any way of doing this is as3? for example, if I have a var dog:String , how can I get "dog" out of that variable? Looking into reflection to do this, but there's got to be an easier way -- A 回答1: Hope this helps. class A { var dog:String = "something"; var cat:String = "eatdog"; } function getVars(obj:*):void { for(var i:* in obj){ trace( i + " : " + obj[i]); // this will trace all properties of object. // dog : somthing // cat : eatdog } } 回答2: First of all if it's an instance of a custom

Using ExternalInterface in Flash

倖福魔咒の 提交于 2019-11-28 11:35:19
I'm trying to edit some flash to make an external javascript function call, but with no success. Here's my actionscript 2.0 code: //testing external .js calls import flash.external.ExternalInterface; //attempting to make external js call ExternalInterface.call("createPlaylist","It's my Life!"); and here's my javascript; function createPlaylist(mess){ alert("called createPlaylist: " + mess); } I've seen lots of examples and I'm mainly confused about the use of ExternalInterface.addCallback . I don't need the javascript to return anything to flash, so is this necessary? For whatever reason, I

What is a RELIABLE way to detect a client's browser and its version number?

戏子无情 提交于 2019-11-28 10:59:37
问题 What is a reliable way to detect someone's browser and its version number? From what I've seen, things like the navigator object in JavaScript simply do not work toward this end, and neither do a lot of these really hacked-together solutions I'm coming across. There are one or two currently functional JavaScript code snippets I've come across that'll tell me whether someone is using Firefox, Chrome, etc., but they don't describe the version number of each browser. How can this be found, and

Actionscript Error #2044: Unhandled SecurityErrorEvent:. text=Error #2047: Security sandbox violation: LocalConnection.send: 127.0.0.1 cannot access

点点圈 提交于 2019-11-28 09:48:08
问题 When running flash components that use localConnection within an HTML container, I get the following error in a popup box (flash player is the debug version): Error #2044: Unhandled SecurityErrorEvent:. text=Error #2047: Security sandbox violation: LocalConnection.send: 127.0.0.1 cannot access 回答1: Changing the page's URL from http://127.0.0.1/ to http://localhost/ solved the problem. 回答2: // add this line after the instanciation aof the receiver file receiveSwf_lc.allowDomain("localhost"); /

IntelliJ disable code analysis (light bulb)

巧了我就是萌 提交于 2019-11-28 07:53:24
问题 Is there a way to disable code analysis (the light bulb) in IntelliJ? I really don't care about code improvement suggestions as I'm viewing some third party code. I've already unchecked everything single feature in Project Settings -> Inspections. I'm using IntelliJ 10.5 to edit ActionScript code. 回答1: On the status bar, there is a little icon showing a man. If you click on it, you can change the inspection level: nothing, syntax, full analysis. 回答2: To disable inspections: Settings > Project

Finding Actionscript within an FLA file

好久不见. 提交于 2019-11-28 07:24:54
问题 I am dealing with a Flash file which has been created by a third party. It has a lot of folders and files in the library and I can't seem to find any ActionScript anywhere. Is there a simple way of finding the location of ActionScript when the author has been naughty and not labelled it or put it in a sensible place? 回答1: In addition to @grapefrukt's answer: Make sure you toggle the ShowActionscript button in the Movie Explorer. That would be the third icon, the one with the blue arrow. You

Vector.<> vs array

余生颓废 提交于 2019-11-28 07:02:29
问题 What are the pros and contras of using a Vector.<> instead of array ? 回答1: From the adobe documentation page: As a result of its restrictions, a Vector has two primary benefits over an Array instance whose elements are all instances of a single class: Performance: array element access and iteration are much faster when using a Vector instance than when using an Array. Type safety: in strict mode the compiler can identify data type errors such as assigning a value of the incorrect data type to

Suggestions for (semi) securing high-scores in Flash/PHP game

风流意气都作罢 提交于 2019-11-28 06:07:23
...I have read a few threads on here that have discussed various methods and was just looking for some feedback on a proposed solution we came up with. In one of the threads a comment was posted recommending a public/private key which sounded great, this is what we were thinking... Client Side - 1. Key is stored inside of Flash swf which is encrypted using 3rd party tool. 2. High score is hashed along with high-score value (EX: md5 ('ourSecretKey' + 200)) 3. This value is sent via AMF to a PHP script on the server, along with the high-score (200) Server Side - 1. Server receives data and

How to pass “Null” (a real surname!) to a SOAP web service in ActionScript 3?

此生再无相见时 提交于 2019-11-28 02:30:24
We have an employee whose surname is Null. Our employee lookup application is killed when that last name is used as the search term (which happens to be quite often now). The error received (thanks Fiddler!) is: <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.MissingArgumentException : The SEARCHSTRING parameter to the getFacultyNames function is required but was not passed in.]</faultstring> Cute, huh? The parameter type is string . I am using: WSDL (SOAP) Flex 3.5 ActionScript 3 ColdFusion 8 Note

I need to ping to an network with flash or actionscript

好久不见. 提交于 2019-11-28 01:46:44
问题 I have created a network trouble shooting tool in flash. The design will have all the componenets on the screen. I have to ping to every component once in minute. I have finished the design part. Please someone help me how do i ping a webaddress or IP in flash. I need a sample code.. Im using Flash CS3 回答1: What do you mean by you have all the components on the screen and you have to ping every component once in a minute? If by ping you mean an app, what checks the time-response of a url,