Ignore this message. I've just seen the error of my ways. I shouldn't
be nesting the function inside the constructor function. Knew it must be
something obvious.

-----Original Message-----
From: Cheetham, Marcus 
Sent: 24 July 2009 11:17
To: 'Flash Coders List'
Subject: Package problem in Flex

 
I'm importing an AS3 class into my Flex app. It imports fine and the
trace message in the constructor works ok.
However, when I try to create additional functions (Hello)  I get the
message :

"1114: The public attribute can only be used inside a package."

This is despite the fact that I have created a package. Any idea what
I'm doing wrong? Here's the class code:

-------------------------------------------------------------
package com.pearson.utils
{
        public class PlaceItemsInSeries
        {
                
                public function PlaceItemsInSeries()
                {
                        
                        trace("Place Items in Series Class");
                        
                        public function Hello():void
                        {
                                trace("Hello");
                        }
                }
        }
}
-----------------------------------------------------------------

In the Flex module I'm importing the class using this code:

import com.pearson.utils.PlaceItemsInSeries;

I'm calling the function later on using this code:
PlaceItemsInSeries.Hello();

It doesn't work due to the package error

 
This email was sent by a company owned by Pearson plc, registered office at 80 
Strand, London WC2R 0RL.
Registered in England and Wales with company number 53723

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to