[Laszlo-dev] [Platform-team] System calls
Henry Minsky
hminsky at laszlosystems.com
Sun Sep 14 19:39:15 PDT 2008
I'll take a pass at it.
On Sun, Sep 14, 2008 at 5:44 PM, P T Withington <ptw at pobox.com> wrote:
> It's petty clear to me that we need to bring passthrough technology up to
> the LZX level. Max already filed a request... I think it's up to you or I to
> just do it.
>
>
> On Sep 14, 2008, at 1:32 AM, "Henry Minsky" <hminsky at laszlosystems.com>
> wrote:
>
> To expand on this, I'm working on the debugger GUI component now, and it
>> almost compiles in swf9, except that I need some lines of runtime-specific
>> code to instantiate a loader class for doing eval() requests to the server.
>>
>> In swf8, the code is
>>
>> this.evalloader = new LzLoader(this.sprite, { attachname: 'debugloader'
>> });
>>
>> in swf9, it needs to be
>>
>> this.evalloader = new Loader();
>> this.evalloader.contentLoaderInfo.addEventListener(Event.INIT,
>> debugEvalListener);
>>
>> LzLoader is an internal swf8 kernel class, while Loader and Event.INIT are
>> as3
>> library classes.
>>
>> So I'm not sure what the most expedient way to deal with this is.
>>
>> I was thinking maybe something like using the <switch> tag to
>> conditionalize creating different code at the level of methods, but I still
>> need some way to insert the "import flash.xx.*;" statements into the class
>> declaration that gets generated. If I had the proposed <passthrough> tag, it
>> might looks like
>>
>> <class name="LzDebugWindow" >
>> <switch>
>> <when runtime="swf9">
>> <passthrough context="class">
>> import flash.util.*;
>> import flash.events.*;
>> </passthrough>
>> <method name="makeEvalLoader">
>> debugloader = new Loader();
>> debugloader.contentLoaderInfo.addEventListener(Event.INIT,
>> debugEvalListener);
>> </method>
>> <method name="debugEvalListener" args="event:Event">
>> ...
>> </method>
>> </when>
>> <otherwise>
>> <method name="makeEvalLoader">
>> return new LzLoader(this.sprite, { attachname: 'debugloader' });
>> </method>
>> </otherwise>
>> </switch>
>>
>>
>>
>> In this case, it might or might not be better to structure the
>> LzDebugWindow as an abstract base class with everything except the
>> runtime-specific methods, and then have the debugger/Library.lzs
>> include a runtime-specific final class which would define those
>> methods, so I'd have a common file with
>>
>> <class name="LzBaseDebugWindow">
>> ...
>> </class>
>>
>> and then make mutually exclusive swf8 and swf9 files which defined the
>> runtime-specific methods. But I'd still need this <passthrough> tag to
>> get the import statements forced into the intermediate script code.
>>
>> <library>
>> <switch>
>> <when runtime="swf8">
>> <include href="swf8debugger.lzx">
>> </when>
>> <when runtime="dhtml">
>> <!-- no debugger component in dhtml -->
>> </when>
>> <when runtime="swf9">
>> <include href="swf9debugger.lzx"/>
>> </otherwise>
>> </switch>
>> </library>
>>
>>
>>
>>
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080914/ded96f62/attachment.html
More information about the Laszlo-dev
mailing list