actionscript-2

How to draw a triangle in a math graph?

二次信任 提交于 2019-12-20 03:46:10
问题 How to draw a triangle in a math graph which displays X and Y axis. 回答1: 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

can an actionscript function find out its own name?

Deadly 提交于 2019-12-18 03:35:43
问题 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 ? 回答1: 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

can an actionscript function find out its own name?

冷暖自知 提交于 2019-12-18 03:34:04
问题 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 ? 回答1: 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

Flash AS3 Global Variables?

耗尽温柔 提交于 2019-12-17 14:54:05
问题 HI i have a main class //main.as package { public class main { public var testGlobal:string = "testValue"; } } //pop.as package { public class pop { function pop():void { trace("testGloabl from main.as" + testGlobal); } } } How can i get the testGlobal value on pop.as width out using a main class Object. Is there any method of Global variables?? How to use global variables in AS3 . 回答1: If you absolutely positively have to have a global variable in as3, you could always create a file in the

Flash SWF file cannot find XML data file when loaded into WebBrowser control (but works in IE9)

自闭症网瘾萝莉.ら 提交于 2019-12-13 22:09:51
问题 Bit of a long explanation below, with a hopefully accurate short question summary here: Can a .NET WebBrowser control (Win7 64-bit, IE9, current Flash 10.3.183.7) load a SWF file into an <object> tag, where the SWF file is in a separate folder that also contains an XML data file in such a way as to have the SWF file load and display the XML data? UPDATE : Added some more information below based on some further experimentation... Gory detail: This has plagued me for a couple of days. Consider

AS2 .swf loadmovie() and unloadmovie() fail when nested inside an AS3 .swf container

▼魔方 西西 提交于 2019-12-13 15:26:45
问题 I have an AS2 .swf being loaded as a child of a parent AS3 .swf. The AS2.swf calls loadmovie() and unloadmovie() to display 3 jpeg files. The images load the first time, but after that, a call to loadmovie() to replace the image, or a call to unloadmovie() fail. I found the following Adobe Bug report (https://bugs.adobe.com/jira/browse/ASC-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) that has said this has been resolved, and also said that child movieclips could be

communication between as2 and as3

孤人 提交于 2019-12-13 15:22:32
问题 I have this code under a button in 'as2.swf' on (release) { unloadMovie(this); } and this swf is being loaded into as3 container called 'main.swf', but when i press it nothing happens and the file does not unload itself. any one can enlighten me on that? 回答1: ActionScript 3 uses the AVM2 virtual machine while ActionScript 2 uses the older AVM. This means that they are not in the same sandbox. Thus communication between the two is difficult at best. AVM2(as3) can load and work with AVM1(as2)

Actionscript 2.0 to 3.0, please give a hand, am I converting wrong?

天涯浪子 提交于 2019-12-13 09:33:05
问题 I'm doing the Actionscript 2.0 to 3.0 work but I have very few idea on 3.0, Can somebody good guys help to make a translate please! I have try to finish a version but my work just cannot being "drag n drop" after changing the codes. stop(); var randomPositionFrame = int(Math.random()*9)+1; content_mc.gotoAndStop(randomPositionFrame); for(var i=1; i<=5; i++){ eval("content_mc.matching_term_"+i)._alpha = 0; eval("content_mc.matching_term_"+i).onPress = function(){ if(this._currentframe == 1){

Migrating from AS2 to AS3

北慕城南 提交于 2019-12-13 08:34:44
问题 I would like to know from someone who have already done that, any recommendations and things I have to take a special look, I have seen some articles related to the topic, googled it, etc... but I would like the advice from stackoverflower x) I already know object oriented programming in c++, using classes and etc, but I can't quite understand AS3 packages and stuff, but i'm very familiarized with AS2. Thanks 回答1: Drop everything you know, start fresh. AS2 is different than AS3. Don't try to

how to use droptarget in AS3?

筅森魡賤 提交于 2019-12-13 08:26:06
问题 I need to convert this AS2 code to AS3. on (release) { stopDrag(); this.MOR1.zzz.gotoAndStop(1); if (this._droptarget == "/lcd5") { this.MOR1.zzz.shekl.gotoAndStop(1); _root.nor.gotoAndStop(3); } else { this.MOR1.zzz.shekl.gotoAndStop(4); _root.nor.gotoAndStop(2); } if (this._droptarget == "/lcd1") { setProperty(this, _x, -731.7); setProperty(this, _y, 626.4); } } Please help me. Thank you... 回答1: First off, you're going to need to start using event listeners. Now to the main issue.