1 Reply Latest reply on Nov 29, 2010 11:35 AM by GordonSmith

    1120 error for "-" character

    nubonan

      Hi,

      I have a json page and in this page I have a tag with xxx-xxx format name. When I select a tag for importing data in a local variable I use this instruction:

       

      var collection:object = value.valueOf().thounds-collection;

       

      I have 1120 error in collection because the character - is present on a name tag. How to insert this character?there is a special combination of character for this?

       

      thanks to all and scuse me for bad english.

        • 1. Re: 1120 error for "-" character
          GordonSmith Level 4

          var collection:object = value.valueOf()["thounds-collection"]

           

          because o.p is really just o["p"]; both just look up a property by name on an object. The second form is useful when the property name isn't known until runtime, or it's known at compile time but doesn't conform to the naming rules for ActionScript identifiers.

           

          Gordon Smith

          Adobe fFlex SDK Team.