A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Difference between importing as files & class definition?

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Posts
    184

    Unhappy Difference between importing as files & class definition?

    Hi,

    I'm trying to get the as3corelib to work as when I run my file at the moment it tells me:

    5001: The name of package 'com.adobe.images' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. /Users/markbunyan/Websites/craftmagic.co.uk/JPG_encoder/JPGEncoder.as

    I thought I had imported the as3corelib fine but can't get this to work. Can I simply import the code from JPGEncoder.as???

    Also can anyone help me with a plain explanation of importing classes???

    Cheers

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Inside the class you have the package path:
    package com.adobe.images
    {
    import flash.display.Sprite;
    public class MyClass extends Sprite

    When you import the class you would write

    import com.adobe.images.MyClass;
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    May 2004
    Posts
    226
    Did you copy folders and/or files from "com/adobe/" into "/Users/markbunyan/Websites/craftmagic.co.uk/"? If so that is probably the issue, the adobe package names will get all fudged up.

    Just add the entire as3corelib (the parent of the "com" folder) to your movies Publish Setting > Flash > ActionScript 3.0 > Settings > classpath.

    or move the as3corelib "com" folder into "/Users/markbunyan/Websites/" if that is the the classpath you always use.

  4. #4
    Senior Member
    Join Date
    Oct 2000
    Posts
    184

    Got it working but don't really understand it yet...

    Hi Guys cheers for your responses

    I've got it working on the XP partition of my macbook but it still won't work on my macPro. I think there is a folder called _MACOSX in the corelib download that shows up on a PC but doesn't appear to be there when I look at the same corelib download on my mac... Very strange...

    In answer to the question I didn't copy the corelib files anywhere apart from applications/Flash/Config/AS3/Classes. I'd actually got the wrong class path as well.

    package com.adobe.images is already inside the class (as previously stated) so the classpath in flash needs to point to the src folder inside the corelib download...

    Thanks for your help...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center