保存并加载数组的初始状态(int [,])(Save and load initial state of an array (int[,]))
我正在尝试保存数组的状态,以便稍后在其初始状态下加载它。 但我不知道如何使它们成为单独的实例,而不是相互引用。 以下是一些示例代码:
static void Main(string[] args) { int[,] first = new int[5, 5]; int[,] second = first; for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { first[i, j] = i * j; } } first[0, 0] = 10000; first = second; Console.WriteLine(first[0, 0]); //10000 }
I'm trying to save the state of an array so I can load it later in it's initial state. But I don't know how to make them separate instances, and not to reference each other. Here's some sample code:
static void Main(string[] args) { int[,] first = new int[5, 5]; int[,] second = first; for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { first[i, j] = i * j; } } first[0, 0] = 10000; first = second; Console.WriteLine(first[0, 0]); //10000 }
原文:https://stackoverflow.com/questions/24780126
最满意答案
您可以在Adobe网站上找到适用于MAC和PC的 flash 8的as2 Remoting组件。 它可能不安装在Flash CS3的正确文件夹中,但有mx.remoting类与您的其他as2 mx软件包位于相同的文件夹中,NetConnection调试器位于WindowSWF文件夹中,而swc本身位于Common Library 。
我现在在办公室而不是在家里上课,所以我不是100%准确的。
我记得在amfphp网站上有关于as2的一些方便的视频教程。
You can find the as2 Remoting Components for flash 8 for the MAC and PC on the Adobe website. It might not install in the right folder for Flash CS3, but there are the mx.remoting classes that go in the same folder with your other as2 mx packages the NetConnection Debugger that goes in the WindowSWF folder and the swc themselves that go in Common Libraries.
I have the classes at the office, not home, where I am now, so I'm not 100% accurate.
I remember there were some handy video tutorials on as2 on the amfphp website.
相关问答
更多-
flash CS3 视频教程下载[2022-07-04]
“硅谷动力”这个网站有,你在百度网页搜索引擎就能打开这个网页了,祝你好运!希望采纳! -
Flash CS3 ActionScript 3.0类编程入门到精通教程哪里有?[2022-03-28]
你也可以看看下面的教程 教程1:金鹰FLASH.CS3活学活用【压缩后532MB】 教程2:Flash CS3 ActionScript 3.0组件高级编程(压缩后 532MB) 教程3:Flash CS3 ActionScript 3.0类编程入门到精通(压缩后780MB) 教程4:Flash CS3 AS3声音视频高级编程(官方价:380元)【压缩后668MB】 教程5:Flash ActionScrip 3.0实用教程(官方价:280元)【压缩后380MB】 教程6:Flex3.0快速入门(官方价:1 ... -
是否有任何库将CS4 Actionscript引入Flash CS3?(Are there any libraries that bring CS4 Actionscript to Flash CS3?)[2022-11-27]
在代码方面,CS3和CS4之间没有区别。 您只需要在发布设置中定位当前的Flash Player 10平台。 它们都使用相同的Actionscript 3库。 您无法在CS3中加载CS4项目,但可以将项目保存为与闪存CS4内部的CS3兼容。 哦,我的坏。 CS3无法为Flash 10平台编译。 因此,没有。 没有库,因为所有更改都需要Flash Player 10的新优势。 但是,您可以使用flex来编译代码。 但是,这将要求您将代码转换为flex。 There is no difference betwe ... -
Flash CS3中的Fuzzy .png(Fuzzy .png in Flash CS3)[2022-03-14]
您是通过装载器将它们加载到SWF中的吗? 或者它们是作为位图符号导入到库中的? 如果它们在尝试调用Bitmap.smoothing = true; 或者如果它们位于库中,请转到位图的属性并单击允许平滑。 除此之外,我会检查以确保您没有超过1 alpha设置的某些疯狂,或者您在任何时候都不会在代码中搞乱它的规模。 这两个选项往往会混淆位图图像的模糊性。 如果一切都失败了,你可能会希望考虑将你的图像转换为基于矢量的图形,那么他们总是会看到你想要他们如何不管缩放比例。 Are you loading them i ... -
var foo:LoadVars = new LoadVars(); foo.onData = function(value:String) { if (value != undefined) { trace(value); } }; foo.name = "John"; foo.age = 19; foo.sendAndLoad("content.txt", foo, "GET"); var foo:LoadVars = new LoadVars(); foo.on ...
-
从amfphp发送到flash时,数据是如何编码的?(how is the data encoded when it is sent from amfphp to flash?)[2022-10-16]
在as3中,JSON用于编码/解码从php到flash的数据,反之亦然。 您将需要as3corelib才能使用此功能。 I was able to figure it out. It turns out AMF is a format - http://en.wikipedia.org/wiki/Action_Message_Format using these hex values Undefined - 0x00 Null - 0x01 Boolean False - 0x02 Boolean True ... -
您可以在Adobe网站上找到适用于MAC和PC的 flash 8的as2 Remoting组件。 它可能不安装在Flash CS3的正确文件夹中,但有mx.remoting类与您的其他as2 mx软件包位于相同的文件夹中,NetConnection调试器位于WindowSWF文件夹中,而swc本身位于Common Library 。 我现在在办公室而不是在家里上课,所以我不是100%准确的。 我记得在amfphp网站上有关于as2的一些方便的视频教程。 You can find the as2 Remoti ...
-
你必须把你的类放在如下目录中: /your root of source files/com/MyComponen/subcomponent1.as 和 /your root of source files/com/MyComponen/subcomponent2.as 进入你们这两个classes申报他们所属的package : 例如,针对子组件1 package com.MyComponen { public class subcomponent1 { //... } } 作为命名约定 : ...
-
Flash CS3和Flash CS5 Linkage选项的区别?(Difference in Flash CS3 AND Flash CS5 Linkage option?)[2024-02-05]
由于没有人知道这个谜,所以我们可以假设在Flash-CS5中,第1帧的导出是可选的,即使它未被选中,在文档类中创建时,在第1帧导出对象或影片剪辑。 请善意评论。 我使用SwiX工具检查过它。 即使它们未在第1帧导出,但使用new运算符在Document Class中创建,也会加载Movie-Clips。 As no-one knows about this mystery so we can assume that in Flash-CS5 export for frame 1 is optional me ... -
不幸的是,Adobe完全删除了Flash CC中的AS2支持。 它将使用AS2打开.fla但删除代码。 但是,您仍可以从Creative Cloud应用程序门户/站点下载Flash CS6作为旧版解决方法。 Unfortunately, Adobe totally removed AS2 support in Flash CC. It will open a .fla with AS2 but remove the code. You can, however, still download Flash C ...