3 Replies Latest reply on Jul 30, 2007 9:35 AM by ntsiii

    Actionscript error when moving code to custom component

    jef_dallas_tx
      Hi All,

      I'm trying to do some code clean up on a prototype I'm working on and while doing so, I've created an error situation.

      What I'm trying to do is separate the action script into an .as file and the pull out common blocks of code from main.mxml and create custom components.

      I have my .as file located in assets.as and is called from the main application file, main.mxml like this:
      <mx:Script source="assets/actionscript.as"/>
      and I defined the assets folder as a namespace in main.mxml as follows:
      <mx:Application ... xmlns:assets="assets.*" ...

      Then I took a block of code from main.mxml and created a custom component named issuesPanel.mxml. This page has objects that are being targeted by a function that resides in the .as file mentioned above. This page is being inserted into main.mxml like this:
      <custom:issuePanel id="issueP"/>

      I thought I had all the pieces in place, but when I compile I get error 1120: Access of undefined property within acitonscript.as. Everything works fine if all the mxml code is in main.mxml.

      Any help anyone can provide is greatly appreciated. BTW, I'm new to Flex, so go easy on me please :)

      -jf