Warning, /frameworks/syntax-highlighting/autotests/folding/highlight.as.fold is written in an unsupported language. File is not indexed.
0001 createTextField("greet", 0, 0, 0, 100, 100);
0002 greet.text = "Hello, world";
0003
0004 class com.example.Greeter extends MovieClip
0005 <beginfold id='1'>{</beginfold id='1'>
0006 public function Greeter()
0007 <beginfold id='1'>{</beginfold id='1'>
0008 var txtHello:TextField = this.createTextField("txtHello", 0, 0, 0, 100, 100);
0009 txtHello.text = "Hello, world";
0010 <endfold id='1'>}</endfold id='1'>
0011 <endfold id='1'>}</endfold id='1'>
0012
0013 var txtHello:TextField = new TextField();
0014 txtHello.text = "Hello World";
0015 this.addChild(txtHello);
0016
0017 package com.example
0018 <beginfold id='1'>{</beginfold id='1'>
0019 import flash.text.TextField;
0020 import flash.display.Sprite;
0021
0022 public class Greeter extends Sprite
0023 <beginfold id='1'>{</beginfold id='1'>
0024 public function Greeter()
0025 <beginfold id='1'>{</beginfold id='1'>
0026 var txtHello:TextField = new TextField();
0027 txtHello.text = "Hello World";
0028 addChild(txtHello);
0029 <endfold id='1'>}</endfold id='1'>
0030 <endfold id='1'>}</endfold id='1'>
0031 <endfold id='1'>}</endfold id='1'>
0032
0033 var myObject:Object = new Object();
0034 var myObject = <beginfold id='1'>{</beginfold id='1'><endfold id='1'>}</endfold id='1'>;
0035 var myString:String = "Hello Wikipedia!"; // This would automatically set the variable as a string.
0036 var myNumber:Number = 5; // This would do the same for a number.
0037 var myObject:Object = <beginfold id='1'>{</beginfold id='1'>Param1:"Hi!", Param2:76<endfold id='1'>}</endfold id='1'>; //This creates an object with two variables.
0038 // Param1 is a string with the data of "Hi!",
0039 // and Param2 is a number with the data of 76.
0040 var myArray:Array = [5,"Hello!",<beginfold id='1'>{</beginfold id='1'>a:5, b:7<endfold id='1'>}</endfold id='1'>]; //This is the syntax for automatically creating an Array.
0041 //It creates an Array with 3 variables.
0042 //The first (0) is a number with the value of 5,
0043 //the second (1) is a string with the value of "Hello!",
0044 //and the third (2) is an object with {a:5, b:7}.
0045
0046 var item1:String="ABC";
0047 var item2:Boolean=true;
0048 var item3:Number=12;
0049 var item4:Array=["a","b","c"];
0050 var item5:Object=<beginfold id='1'>{</beginfold id='1'>name:"Actionscript",version:"3.0"<endfold id='1'>}</endfold id='1'>;
0051 var item6:XML = <node><child/></node>; //Note that the primitive XML is not quoted
0052
0053 var item1:XML=new XML("<node><child/></node>");
0054 var item2:XML=item1;
0055 item2.firstChild.attributes.value=13;
0056 //item1 now equals item2 since item2 simply points to what item1 points to.
0057 //Both are now:
0058 //<node><child value="13"/></node>
0059
0060 private function getNeighbours(_arg1:int, _arg2:int):Array<beginfold id='1'>{</beginfold id='1'>
0061 var _local3:Array = -(((null - !NULL!) % ~(undefined)));
0062 var _local4:*;
0063 var _local5:*;
0064 var _local6:*;
0065 _local3 = new Array();
0066 _local4 = 0;
0067 for (;//unresolved jump
0068 , _arg2 < 8;_local4++) <beginfold id='1'>{</beginfold id='1'>
0069 _local5 = (_arg1 + int(!NULL!));
0070 _local6 = (_arg2 + int(!NULL!));
0071 if (true)<beginfold id='1'>{</beginfold id='1'>
0072 _arg1 = (((//unresolved nextvalue or nextname << !NULL!) + !NULL!)
0073 << undefined);
0074 _arg1 = (!(!NULL!) ^ !NULL!);
0075 (!NULL! instanceof !NULL!);
0076 var _local1 = (((!NULL! as !NULL!) + !NULL!) == this);
0077 if (!(!NULL! == !NULL!))<beginfold id='1'>{</beginfold id='1'>
0078 -((true << !NULL!)).push(Cell(cells[_local5][_local6]));
0079 <endfold id='1'>}</endfold id='1'>
0080 <endfold id='1'>}</endfold id='1'>
0081 if (!true)<beginfold id='1'>{</beginfold id='1'>
0082 (_local6 < 0);
0083 (_local6 < 0);
0084 (_local5 < 0);
0085 <endfold id='1'>}</endfold id='1'>
0086 <endfold id='1'>}</endfold id='1'>
0087 return (_local3);
0088 <endfold id='1'>}</endfold id='1'>