I am introducing LINQ for ActionScript – you can now start writing your flash applications in c# using linq and convert it to actionscript via jsc compiler.
How does the generated code compare to the original
In c# the code looks like this:
foreach (var v in from i in __users
where i.Trim().ToLower().Contains(user_filter)
select i.Trim())
{
result.text += “result: “ + v + “\n”;
}
The generated ActionScript looks like this:
enumerator_15 = __Enumerable.Select_100663437(__Enumerable.Where_100663439(SZArrayEnumerator_1.op_Implicit_100664110(__users), new __Func_2(CS___8__locals15, __IntPtr.op_Explicit_100665307(“__ctor_b__8_100663306″))), FlashLinqToObjects___c__DisplayClassf.CS___9__CachedAnonymousMethodDelegate13).GetEnumerator_100664907();
try
{
while (enumerator_15.MoveNext_100665359())
{
v = enumerator_15.get_Current_100665499();
this.result.text = this.result.text+ “result: “+ v+ “\x0a”;
}
}
finally
{
if (!(enumerator_15 == null))
{
enumerator_15.Dispose_100665605();
}
}
New example project:
| FlashLinqToObjects |
![]() |












Could you put up an example of making a remote Ajax request to a web service? I’ve had a look through svn but can’t find anything on how to make external calls. thanks!
Comment by Harry — February 18, 2008 @ 6:08 pm
There is an example for a ajax Web Site over here. I will try to verify that actually it works with the latest jsc on this weekend. Cheers.
Comment by zproxy — February 18, 2008 @ 6:34 pm