dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Import Class from Another folder, Problem

Hybrid View

  1. #1
    Senior Member
    Join Date
    May 2007
    Posts
    102

    Import Class from Another folder, Problem

    Hi,

    i am using FlashDevelop and have created a project called NavBar. I have created a few folders, 1 of which is called app which contains another called gui but within this has a document class called NavigationBar.as.

    Now, i've created a Main.as file which resides undeaneath the src folder and what i am trying to do is import the NavigationBar.as in my Main.as file. However, every time i type app and do the '.' and press enter i get,
    flash.system.ApplicationDomain., how can i make AS aware of my class file, Navigati
    onBar.as in app > gui > NavigationBar.as and any document class file for that matter?

    1 other thing is that in my Navigationbar.as file i did the following..
    package app.gui
    {
    // rest of code skipt


    }
    but when i build it i get the following error:
    C:\Users\vista\Documents\FlashDevelopProjects\NavB ar\app\gui\NavigationBar.as: Error: A file found in a source-path must have the same package structure '', as the definition's package, 'app.gui'.
    how can i also sort this out?

    Thanks

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Ideally, you'd move the app folder to underneath src. Then since src is in your path, you should be okay. Otherwise, you have to add NavBar to your path, and get rid of whatever entry is causing the last error. What is your path now?

  3. #3
    Senior Member
    Join Date
    May 2007
    Posts
    102
    Hi,

    thanks for the reply, i moved my app folder underneath src folder and i built my main.as document class, and it gave me a warning:
    Warning: Source path entry, 'C:\Users\vista\Documents\FlashDevelopProjects\Nav Bar\src', is a subdirectory of source path entry, 'C:\Users\vista\Documents\FlashDevelopProjects\Nav Bar'.
    Build halted with errors (fcsh).

    when i built it again, it said it was succesful. I also built the NavigationBar.as and it gave me no warning but said succesful.

    Should i be worried about the warning?

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Meh. I'd fix it. Just remove the source path entry "C:\Users\vista\Documents\FlashDevelopProjects \Nav Bar"

    Since everything is under a single source path now, you don't need both. Overlapping source path entries can cause problems, which is why the warning comes up.

  5. #5
    Senior Member
    Join Date
    May 2007
    Posts
    102
    I see, this might sound silly, but how do i remove the source path entry?

    Is it the case of my going to my C:\Users\vista\Documents\FlashDevelopProjects\NavB ar folder and removing something?

  6. #6
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    No. Open your project in FlashDevelop. Open the Project menu, then select Properties. Go to the classpaths tab and remove the entry you don't want.

  7. #7
    Senior Member
    Join Date
    May 2007
    Posts
    102
    I looked in the Classpaths tab menu and i could only see only 1 entry, src, but no other. Do i need to do something else? like arranging my files correctly or something?

  8. #8
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    It's possible you added it to the global classpaths, those are a separate setting. Check there.

    If it's not there, then don't worry about it, especially if you are not getting that error anymore. Maybe flashdevelop just got confused for a bit.

  9. #9
    Senior Member
    Join Date
    May 2007
    Posts
    102
    Nope, it's not there. I do still get the warning, but no error, only a warning when i compile my main.as file but whn i build it again, it replies build successful. I'll probably leave it as it is, thanks for u'r help
    Last edited by nvidia123; 11-10-2009 at 12:44 PM.

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