[Laszlo-dev] more scoping problem with "parent"

P T Withington ptw at pobox.com
Tue Apr 1 04:33:21 PDT 2008


You could try making this change for now, it might let you move  
forward while I work on the instance classes:

Index: SWF9Generator.java
===================================================================
--- SWF9Generator.java	(revision 8509)
+++ SWF9Generator.java	(working copy)
@@ -130,7 +130,7 @@
    public boolean remapLocals() {
      // TODO: [2007-12-11 dda] maybe remap selectively - anything  
that is
      // private may be remapped.
-    return false;
+    return true;
    }

    // override superclass version - we do not want the

On 2008-03-31, at 23:05 EDT, Henry Minsky wrote:
> In the hello.lzx example, there is a test of states, like this:
>
>  <view id="mystate"  x="650" y="80" onclick="this.mystate.apply()" >
>    <state name="mystate">
>      <view width="50" height="50" x="50" y="40" bgcolor="#ccccff"
>            onclick="parent.mystate.remove()">
>              <text>xxx Click me to remove state</text>
>      </view>
>    </state>
>    <view width="50" height="50" bgcolor="#ffcccc"/>
>    <text name="t1">Click me to apply state</text>
>  </view>
>
> That now gives a swf9 compiler error of
>
> ERRORS:
> Compiler error: at [/tmp/lzswf9/lzgen27335/LzApplication.as: 94]:  
> Error:
> Access of possibly undefined property mystate through a reference with
> static type flash.display:DisplayObjectContainer.
>
> parent.mystate.remove()
>       ^
>
>
> which looks like it is getting the "parent" instance var of the SWF9  
> "main"
> application, which is has a "parent" field inherited from flash's
> "DisplayObjectContainer".
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list