actionscript-2

How can i on button press execute a command in the command prompt and get back the output in ActionScript?

天大地大妈咪最大 提交于 2019-12-02 02:13:42
问题 I have a GUI using Flex. I have a condition like i need to execute some command line arguments in the local machine and get the results back or output back to a textbox area. How can i do a button on submit, execute command in the local machine and return the output? Command to execute example: echo logfile.log | grep username Code: button1.onRelease = function () { // in this computer, it will now run a command, please wait. } My reference from the answer: https://gist.github.com/993905 回答1:

How to draw a triangle in a math graph?

不羁的心 提交于 2019-12-02 00:59:13
How to draw a triangle in a math graph which displays X and Y axis. Richard Inglis To draw shapes using ActionScript2, you can use the moveTo() and lineTo() methods of the MovieClip object. You can specify line colour and thickness with lineStyle() , or make a solid shape using beginFill() and endFill() . So to draw your graph and triangle you could do the following steps: Make a movieClip named "graph" Define how big your graph should be (using the flash.geom.Rectangle object) Draw a grey background using graph.beginFill(grey) and then moveTo() and lineTo() Draw some blue lines at regular

Actionscript 2 large tile-based maps creating lag

江枫思渺然 提交于 2019-12-01 23:44:54
I'm wondering what the best way to go about creating large, tile-based maps in flash with actionscript 2 would be. With my current code, any maps over 35x35 (1225 movieclips) start to lag. The maps are created from a simple multi-demensional array, eg. var map = [[95,23,25,23,16,25],[95,23,25,23,16,25],[95,23,25,23,16,25]]; The program simply creates a movieclip of a tile, goes to the appropriate frame and places the tile relative to the player's location. Each tile has one property, that is 'walkable' which is either true or false which determines if the player can walk on it or not. These

How to use HTML param in Actionscript 2

徘徊边缘 提交于 2019-12-01 12:49:40
The main thing in this i have written a code for swf and also the html and i need to pass the 2 parameters from html to swf i am passing clicktag param and other parameter. i know how to access the clicktag param in action script but i am getting confused to use the another parameter passed with that. i am accessing clicktag as _root.clickTAG so i can easily access it but when i wanted to use another param in the same way nothing is happening . can you anyone please help me regarding this. Thanks in Advance You need to pass in two variables using FlashVars . At it's simplest you can just use

how do i display the coordinates of a random triangle in a graph which ranges from +10 to -10 XY axis in actionscript 2.0?

狂风中的少年 提交于 2019-12-01 09:43:23
问题 how i display the coordinates of a random triangle in a graph which ranges from -10 to +10 in XY axis with the points like A(2,1) etc with arcs in each corner, in actionscript 2.0 回答1: OK, so far we've done triangles with arcs, triangles on a grid, and triangles with coordinates. Now it's time to combine all these into one piece of code. You've asked for a grid size of -10 to +10, but it's only a little bit more work to make it work for any size grid (well, within limits). We need to deal

How can i on button press execute a command in the command prompt and get back the output in ActionScript?

北城余情 提交于 2019-11-30 07:44:00
I have a GUI using Flex. I have a condition like i need to execute some command line arguments in the local machine and get the results back or output back to a textbox area. How can i do a button on submit, execute command in the local machine and return the output? Command to execute example: echo logfile.log | grep username Code: button1.onRelease = function () { // in this computer, it will now run a command, please wait. } My reference from the answer: https://gist.github.com/993905 You're not going to be able to do this using actionscript 2 and you're not going to be able to do this

can an actionscript function find out its own name?

梦想的初衷 提交于 2019-11-29 01:45:45
given the following function A(b:Function) { } If function A(), can we determine the name of the function being passed in as parameter 'b' ? Does the answer differ for AS2 and AS3 ? I use the following: private function getFunctionName(e:Error):String { var stackTrace:String = e.getStackTrace(); // entire stack trace var startIndex:int = stackTrace.indexOf("at ");// start of first line var endIndex:int = stackTrace.indexOf("()"); // end of function name return stackTrace.substring(startIndex + 3, endIndex); } Usage: private function on_applicationComplete(event:FlexEvent):void { trace

Load AS2 SWF Into AS3 SWF and pass vars in URL

孤者浪人 提交于 2019-11-28 01:34:33
I've got an AS3 SWF that I'm going to be loading other SWFs into. These child SWFs all take a single parameter on the URL. I can't seem to get it working when loading an AS2 child, and it needs to be able to handle both. so I have var request:URLRequest = new URLRequest(); var loader:URLLoader = new URLLoader(); request.url = "http://domain/as2.swf?param=foo"; loader.load(request); // etc on to the eventListeners, addChild, etc When the as2 SWF gets loaded, it can't see the parameter I've passed to it. It's looking for _root.param. Am I doing this wrong or am I attempting the impossible? EDIT:

Cross Domain ExternalInterface “Error calling method on NPObject”

点点圈 提交于 2019-11-27 01:20:35
问题 I am trying to enable communication between Javascript and Flash via ExternalInterface across domains. The Javascript works great when it is located on the same domain as the SWF. But in one case, the HTML resides on domain A, the javascript and the flash both reside on domain B. I have done all of the following: The embed tag has allowScriptAccess="always" (and the object has that as a param) My SWF file's actionscipt has Security.allowDomain("*") My SWF also calls Security

Load AS2 SWF Into AS3 SWF and pass vars in URL

夙愿已清 提交于 2019-11-26 23:31:29
问题 I've got an AS3 SWF that I'm going to be loading other SWFs into. These child SWFs all take a single parameter on the URL. I can't seem to get it working when loading an AS2 child, and it needs to be able to handle both. so I have var request:URLRequest = new URLRequest(); var loader:URLLoader = new URLLoader(); request.url = "http://domain/as2.swf?param=foo"; loader.load(request); // etc on to the eventListeners, addChild, etc When the as2 SWF gets loaded, it can't see the parameter I've