Thanks Muzka,

but my issue is more with setting the class path to the com package so flex can find it.

Any ideas.

Muzak wrote:
To use the ClassA.as class in your project, you have to import the package (the 
folder structure seperated by dots)

<mx:Script>
  <[CDATA[>
    import com.rtmp.util.ClassA;
    private var myClass:ClassA;

    private function appInit():void {
        myClass = new ClassA();
    }
  </]]>
</mx:Script>


The class itself should also be defined in the package com.rtmp.util

package com.rtmp.util {
    class ClassA() {
        //etc..
    }
}

Note that I wrote ClassA with an uppercase C.
It's good practice to have class names start with an uppercase.
You might wanna read this Jen's article about AS Best Practices:
http://www.adobe.com/devnet/flash/articles/as_bestpractices.html

It's written for AS2 but most of it applies to AS3 or programming in general as 
well.

regards,
Muzak


----- Original Message ----- From: "tommek" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, April 29, 2007 9:05 AM
Subject: [Flashcoders] Flex eclipse classpath


Hello people,

I have been trying to setup flex with in eclipse to use a custom class path all week end with no luck, it's been doing my head in, and need some help.

I have created a new Flex project etc and thats all good.
When i write my actionscript within my mxml file in the <mx:Script> tag i have 
access to the packages like com / flash / etc.

Then when i try to add my custom class path by:

Right click > properties > build path > source path >

then add c:\AS3_com

which has c:\AS3_com\com\rtmp\util\classA.as

It adds a (source path) AS3_com dir to my project.

Then when i write as in the  <mx:Script> tag i don't have access to the 
packages com /flash / etc.

am I setting my source path correctly or is their some thing i'm missing in setting up flex in eclipse to allow it import and write as3 custom class.

any help would be good.

Thank tom.


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


--
Tom Kaurin Eyecon P/L, 197b Boundary Street, West End QLD 4101. Mobile: +61 405 731 239 Phone: (07) 3846-0319 Fax: (07) 3503-9040 Email: [EMAIL PROTECTED]
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to