1 Reply Latest reply on Feb 7, 2007 3:17 PM by michael_ramirez44

    Problems Importing actionscript

    sshhaannee
      I am trying to just do a basic include of the following action script file. When I try to complie it gives me and error saying: 1172L Definition test:Greeter could not be found.

      Ideas, Suggestions?

      Thanks
      -Shane

      // ActionScript file
      package test
      {
      public class Greeter
      {
      public function sayHello():String
      {
      var greeting:String;
      greeting = "Hello World!";
      return greeting;
      }
      }
      }

      mxml file:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" >
      <mx:Script>
      <![CDATA[

      // Declare bindable properties in Application scope.
      [Bindable]
      public var selected_cid:String;

      import mx.controls.*;
      import test.*;

      //temp testing
      private var g:Greeter = new Greeter();

      public function handleFault():void{
      Alert.show("error loading data from server");
      }

      public function init_vars():void
      {
      selected_cid = mx.core.Application.application.parameters.cid;

      //temp testing
      Alert.show( g.sayHello() );
      }
      ]]>
      </mx:Script>
      </mx:Application>