How to import classes from an external actionscript file

This is driving me crazy, I've been trying to resolve this on my own for ages, and I've reviewed a lot of different materials, but I still can't seem to just import some external actionscript classes correctly.
I'm using Flash Builder 4 with the Flex 4 SDK on mac osx 10.6
the class I'm trying to import (I'll call it DesiredClass) is in a folder like this
/libraries/com/foreignproject/com/foreignproject/DesiredClass.as
within the class itself, the package declaration looks like this (I left all the guts out for clarity):
package com.foreignproject
    import flash.display.Sprite;
    public class DesiredClass extends Sprite
        public function DesiredClass()
I'm working on a totally different actionscript file at
/Users/username/Documents/Adobe Flash Builder 4/TestProject/src/TestProject.as
in this file I try to import the DesiredClass:
package
     import com.foreignproject.DesiredClass;
     import flash.display.Sprite;
     public class TestProject extends Sprite
          public function TestProject()
          var neatClass:DesiredClass = new DesiredClass();
And then I try to add the class I want to the source path.
I've tried adding each folder to the source path separately:
/libraries/com/foreignproject/com/foreignproject/DesiredClass.as
/libraries/com/foreignproject/com/foreignproject/DesiredClass.as
/libraries/com/foreignproject/com/foreignproject/DesiredClass.as
/libraries/com/foreignproject/com/foreignproject/DesiredClass.as
/libraries/com/foreignproject/com/foreignproject/DesiredClass.as
If I choose the libraries folder or either of the com folders then an error shows up in theTestProject.as file, saying:
Definition com.foreignproject:DesiredClass could not be found.
But f I choose either of the foreignproject folders then an error shows up in theDesiredClass.as file saying:
a file found in a source-path must have the same package structure 'com.foreignproject', as the definition's package, ".
What am I doing wrong? Please help. I bought a book on actionscript, started doing the flex-in-a-week series, read numerous online discussion boards, and I still can't import these classes.
Thanks in advance.

I don't know if this method is supported anymore but you can give it a try.
If you backed up bookmarks in IE using the following directions, you should be good!
*In IE, "File -> Import and Export -> Export Cookies".
*Open newly exported "cookies.txt" in a text editor and put a period before every line that starts with a domain. So a line starting with <b>altavista.com TRUE / FALSE 1388491200 AV_ALL 1</b> will become <b>.altavista.com TRUE / FALSE 1388491200 AV_ALL 1</b>
*Then, move the "cookies.txt" file to your profile folder.
You can get to the Profile folder two ways
*Help > Troubleshooting Information > Profile Directory > Show Folder
or
*Go to '''about:support''' and click Show Folder next to Profile Directory.

Similar Messages

  • How to import music from an external hard drive to my itunes on my computer?

    how can import music from an external hard drive that i saved my itunes music to. i dragged the music from my hard drive to the itunes on my computer but the music does not play from my itunes. it does however play on my ipod. it gives me an error that the original can not be found and do i wish to locate it. i am thinking that i did not drag the right file or all of the files necessary .thanks. kevin

    To import music into your iTunes library on the computer go to iTunes>Help>iTunes Help>Add items to iTunes and follow the instructions

  • How to import pictures from an external memory into Iphoto?

    How to import pictures from an external memory into Iphoto. Is there a way to open all the pictures in my computer in the Iphoto?

    to import photos either use the iPhoto file menu ==> import command or drag the photos to the iPhoto icon in the dock
    LN

  • How to import data from excel or csv files to Oracle table

    hello everybody,
    I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
    Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
    So, how can I import the excel data into Oracle table.
    Thank you in advance.
    cheers,
    shima

    Even easier. Download JDeveloper 11G from this site.
    Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
    Columns -- move the selected columns that you want to load to the box on the right
    Data Types -- select column name from second column to which the data for each column of the import file should load
    DML -- click this tab to generate the INSERT SQL
    Once done click 'Insert'

  • How to import cookies from an exported IE file

    Can cookies be imported into Firefox directly from an IE ".txt" file? (The IE "Favorites" bookmark file came in fine.)
    I'm setting up a new Linux machine and don't have/want IE on it, so the ability to import data from another browser isn't much help.

    I don't know if this method is supported anymore but you can give it a try.
    If you backed up bookmarks in IE using the following directions, you should be good!
    *In IE, "File -> Import and Export -> Export Cookies".
    *Open newly exported "cookies.txt" in a text editor and put a period before every line that starts with a domain. So a line starting with <b>altavista.com TRUE / FALSE 1388491200 AV_ALL 1</b> will become <b>.altavista.com TRUE / FALSE 1388491200 AV_ALL 1</b>
    *Then, move the "cookies.txt" file to your profile folder.
    You can get to the Profile folder two ways
    *Help > Troubleshooting Information > Profile Directory > Show Folder
    or
    *Go to '''about:support''' and click Show Folder next to Profile Directory.

  • How to import bookmarks from an external hard drive to a computer with firefox 3.6

    My laptop crashed this morning. I kept everything backed up on an external hard drive. Now I'm trying to import my bookmarks to a desk top...... Need Help

    this doesn't help - I get to the favorites folder on the external hard drive through the import process, but don't see how to do the actual importing. there's a button for "open file," but not sure what to do

  • Loading class from an external .swf file

    Hi,
    My flash application has lots of resources which will change all the time. In order to keep the the user from having to download my main .swf file over and over again, and in order to keep the main file's size low, I would like to put the resources into separate .swf files and load them dynamically from a url using a Loader.
    Once downloaded I would like to extract the classes that are in the resource swf and use them in the main swf. Can anyone share some code for doing this? Note that I am not just interested in using a symbol from the resource swf. I would like to use a class, with all of its methods and everything, and my main swf does not contain the class definition. Only the resource swf does.
    Thanks!!

    This is a great question for flash programming.
    And when you know the answer to this, you are likely to use it on daily basis like the top level programmers  of an agency.
    ApplicationDomain is your answer and the adobe docs has a chapter on this.
    ApplicationDomain is where all of your classes will be loaded into and when you use a loader you have the ability to target this with the laoderContext.
    AplicationDomain.currentDomain loads all classes into the main app and if your main app already has these classes, then the app uses the parents classes
    new Application.Domain() specifies a seperate repo of classes that are loaded in so that classes in the main app will not be confused by the classes in a loaded swf. that refer to the same names.
    this locks down the communication between the swfs but will use the newer updated classes on the child when a child is loaded in with the same class names as the parents.
    new ApplicationDomain(currentDomain)  will enclose a new repo with the parent repo of the class definitions.

  • Importing ITunes FROM my external hard drive to my Library

    Need to know how to IMPORT ITunes FROM my external hard drive to my ITunes library... as of right now...all it lets me do is import one by one...big pain.
    any assistance or advice is appreciated...

    You should probably post in itunes forum, not iphone forum for more answers.

  • How to import pictures from folder to Bridge

    My problem is that I don't know how to import photos from my external hard drive to Adobe Bridge. No problem importing from camera, but I cannot find a way to import from anywhere else. Does anyone know how?

    All you need to do is open Bridge and then in the Folders Panel click on the external drive and drill down to the folder you want.
    And if you want the files on your main drive just drag and drop the files from one disk to another and they will be copied to that new location. For other options you are used to have in Photodownloader:
    Adobe has a free DNG converter for download and renaming and adding metadata template can be done also in Bridge with batch rename or select the files for same metadata together and fill in once.

  • How do i import bootcamp from a external hard drive

    Hello, I have a 2007 24 inch 2.8ghz 7.1 intel imac, I have just upgraded my internal hard drive from a 500gb seagate barracuda to a 1.5tb western digital caviar green. I have a external usb 3.0 sata hard drive enclosure that has the original 500gb hard drive in it. I have succesfully imported my mac osx from the external 500gb drive to the new internal 1.5tb drive. I have partitioned the new internal hard drive for bootcamp but I can not figure out how or if I can import bootcamp from the external to the internal drive. When I boot up it shows my new mac osx hdd and the external usb mac osx hdd but no bootcamp. I know I cant boot windows from an external hard drive but can I import it from a external hard drive? Thank you in advance, Dave.

    Try this link, http://www.libbyh.com/2008/01/17/cloning-my-boot-camp-partition-to-a-new-hard-dr ive/

  • How do I import video from an external drive into I movie

    How do I import video from an external drive into I movie?..I can't seem to get it to work I am new to apple

    you can either drag it to the imovie window or import it from the file menu.
    unless it's in an unsupported format.

  • 'Basic' external actionscript file/class usage

    Hey All,
    I'm a bit baffled by something that should, in my humble opinion, be a piece of cake...
    The setup is really easy. A simple application with a single textinput, a button and a text component.
    When the button is clicked a function is called that sets the text from the inputfield to the text component.
    code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                public function click(inputText:String):void {
                    outPutTxt.text = inputText;
            ]]>
        </mx:Script>
        <mx:TextInput x="10" y="10" id="inputTxt"/>
        <mx:Button x="178" y="10" label="Button" id="Btn" click="{click(inputTxt.text)}"/>
        <mx:Text x="251" y="12" text="Text" id="outPutTxt"/>
    </mx:Application>
    As I said, really easy.
    What I want to do is put the function 'click' into an external actionscript file or class. And still be able to, from within the external file, modify the outPutTxt stuff.
    I'm aware that I could create a public bindable variable inside of the external file and then bind the outPutTxt to that variable, but I would really like to be able to 'simply' force the value...
    Is that possible? If yes: how plix
    If it's not possible, I'd like to know as well! And in that case, how would I then re-use the same instance of a class/file in multiple seperate components? Say I got a 'login' thingie where a user logs in (data stored externally in a seperate actionscript file/class) and I want to re-use that information on other pages... Or is this done automatically?
    Any and all comments/answers are higly appreciated!
    Pieter

    Hey Levancho,
    thanks for your answer!! Much appreciated.
    However, the code you proposed threw an error...
    Errormessage:
    ReferenceError: Error #1069: Property outPutTxt not found on controls.Control and there is no default value.
        at controls::Control/btnClick()[C:\...\FlexTest_03\src\controls\Control.as:13]
        at FlexTest_03/__Btn_click()[C:\...\FlexTest_03\src\FlexTest_03.mxml:11]
    So I tried something else where I bind the text in my OutPutTxt to a variable inside of the external class file.
    Code:
    Class:
    package controls
        public class Control
            [Bindable]
            public var outPutText:String = "";
            public function Control()
            public function btnClick(inputText:String):void {
                this.outPutText =  inputText;
    Mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                import controls.Control;
                [Bindable]
                private var control:Control = new Control();
            ]]>
        </mx:Script>
        <mx:TextInput x="10" y="10" id="inputTxt"/>
        <mx:Button x="178" y="10" label="Button" id="Btn" click="{control.btnClick(inputTxt.text)}"/>
        <mx:Text x="251" y="12" id="outPutTxt" text="{control.outPutText}"/>
    </mx:Application>
    And this basically did what I wanted to do... so I just need to do some major binding between my application and the classes I'll be using for my business logic.
    Now for something else entirely...
    Is there a way for me to pass the instance of my class between flex components?
    Pieter

  • How to import tab delimited using external table?

    Hi all,
    I'm using external table to import data from a tab delimited file. However, I keep getting an error message. I used both TERMINATED BY OX'09' and X'09' but still could not get it work.
    Does anyone know how to solve this problem?
    Thank you very much.

    Hi
    Try this:
    import datafile="/myfiles/mydata" out=mydata dbms=tab replace delimiter='&' getnames=yes
    run;
    Thanks

  • How to import mailboxes from Time Machine to new Mac

    I had Time Machine backing up our old G5. We got a Mac Pro back in November and I never was able to import the mail from the G5 to the Mac Pro so I left it alone and just kept using mail on the old G5. Well, the G5 took a dump last monday. I currently have the Time Machine backup for that computer connected to our Mac Pro (but not using it as backup yet). So, the mail from the G5 should be on the Time Machine backup right? If so, can I import it into Mail on the Mac Pro?
    I also pulled one of the hard drives from the G5 and have it in the Mac Pro in the 2nd bay just to make sure that HD wasn't dead. It works fine and I tried importing the .mbox files from that drive but it appears that all the mail on that particular drive are from like 2006. So, again, I need to find out how to import mail from the Time Machine drive. Any thoughts?
    10.7.4
    Mail 5.2

    Back up what data? Mail data? I don't have any yet. I haven't used Apple Mail on this Mac Pro yet.
    Edit: Launching Mail and holding Option right afterwards does nothing. Holding down option and then launching Mail does nothing.
    Oooooh.... launching time machine while holding down option......
    Edit again.... I don't have a Time Machine menu because that disk is not currently set up as time machine for the Mac Pro yet. I don't want to use it as a backup for this computer yet. I just want to be able to pull some of the backed up contents from it until I'm set.

  • How do I boot from an external CD drive?

    On a different thread, I've been reporting problems with my internal HD.
    When I went to Disk Utility and ran Verify Disk on the HD, I got the error back telling me that the Mac HD needs repairing. Now, to run the repair facility, I seem to have to reboot from the OS X CD rather than the Mac HD.
    Trouble is, my internal optical drive failed some time ago (seems to be a known fault with iMacs that have the MATSHITADVD-R UJ-846 optical drive) and I've been using an external optical drive connected via firewire with no problems...until now. When I went to reboot from the CD (holding the C button down whilst selecting Reboot), my Mac just booted again from the internal HD.
    How do I reboot from an external CD?
    If I can do this, I can run the disk repair utility and hopefully all will then be well...
    (Please spell out any suggestions for me as I am really quite new to all this stuff - Thanks!)

    Hi Chris.
    What is the version of the OS on the computer and what is the version of the OS Disc that you have inserted?
    Make sure you have inserted the same version of the OS disc that is currently running on the computer.
    For Example. If there is 10.5.x running on your computer, you have to insert 10.5 Disc and boot to it.
    Cheers,
    Gop's.

Maybe you are looking for

  • Problem with HP Printer Sharing?

    I have an HP laserjet 1022 printer that has always worked shared. It's connected to my iMac via usb, and I have always been able to print to it with printer sharing. A few weeks ago however, the print sharing with my macmini and macbook wasn't workin

  • Problems setting up Time Machine using a network drive

    I am having problems setting up TimeMachine on my Mac Mini to work with a WD MyBookLive network drive.  The network drive came with a TimeMachineBackup shared folder preconfigured.  When I first connected the drive to the router and turned on TimeMac

  • Cfadminapi

    Using cfadminapi, we have been able to automate the creation of sandboxes, and the creation of datasources so that our customers can do this themselves without the need for access to the cfadmin, or having to wait for support staff to do this for the

  • Hp 1350 all-in-one not printing-except test page

    I cannot get my printer to print.  Things show up in the que but don't print.  I checked all of the cables...unplugged, rebooted, etc., etc.  nothing seems to work.  It constantly prints out "test page" every time I turn it on.  I changed the ink awh

  • How can I get the book box in preferences' general tab to show up so I can start adding books to my ipad?

    How can I get the book box in preferences' general tab to show up so I can start adding books to my ipad? I am running OSX 10.9 and Itunes version 11.1.3(8) 64 bit.  I have tried re-installing Maveriks and reinstalling Itunes but the box for books is