3 Replies Latest reply on Jun 3, 2008 2:23 PM by VarioPegged

    AS verus <mx> passing vars by reference

    Frank_Phillips
      I have created a component that I need to use via actionscript. I also need to set some parameters by reference so that changing a var in the parent will change all objects created with the new component. Here's the problem:

      I can use a standard creation of the object fine:
      <local:RoomItem id="Rooms" x="{roomX}" y="{roomY}" scaleX="{ZoomScale}" scaleY="{ZoomScale}"/>

      I can modify roomX, roomY and ZoomScale and the objects move around as they should.

      I am attempting to create the object in a .as function based on an XML return and referencing the same vars.

      I get a 1067: Implicit coercion error at the lines marked in the code block. How can these be passed in action script to get the same result as the <mx>'ish version? Thanks

      Here's the .as function, or part of it: