OK - here we go...

I have a Library Project called MyLibrary, containing 2 files:
SubApp1.mxml and functions.as.  Code for each shown below:

SubApp1.mxml
-------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" width="403" height="341">
        <mx:Script>
                <![CDATA[
                        
                        import mx.controls.Alert;
                        include 'functions.as';
                        
                        public function startSubApp1():void
                        {
                                Alert.show("SubApp1 Started...");
                        }
                        
                ]]>
        </mx:Script>
        
        <mx:Button id="btnSubApp1" label="SubApp1Button"
click="startSubApp1()"   x="143.5" y="60"/>
        
</mx:Application>
-------------------------

functions.as
-------------------------
public function test():void
{
        Alert.show("Inside test function in functions.as");
}
-------------------------

I have a Flex project called MainApp containing one file called
MainApp.mxml, code shown below:

MainApp.mxml
-------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" width="401" height="353">
        <mx:Script>
                <![CDATA[
                        
                        import mx.controls.Alert;
                        
                        public function startMainApp():void
                        {
                                Alert.show("MainApp Started...");
                                Alert.show("Calling SubApp1...");
                                var tmp = startSubApp1();
                                Alert.show("Back in MainApp after SubApp1...");
                                Alert.show("Calling test()...");
                                var tmp2 = test();
                                Alert.show("Back in MainApp after test()...");
                        }
                        
                ]]>
        </mx:Script>
        
        <mx:Button id="btnMainApp" label="MainAppButton"
click='startMainApp()' x="143.5" y="29" />
        
</mx:Application>
---------------------------

In the Flex Library Build Path of MyLibrary, I select SubApp1 to be
included in the classes.  Then I open the MainApp Project properties
and add MyLibrary Project to the Library Path in the Flex Build Path,
then check the MyLibrary project in the Project References for MainApp.

The problem is I keep getting errors on the lines calling the
functions startSubApp1() and test() in MainApp.mxml.

In my MainApp.mxml file, I've tried:

import MyLibrary; -> nothing changes (same errors)
import MyFakeLibrary -> nothing changes (same errors)
import "MyLibrary"; -> throws an error on this line
include MyLibrary; -> throws an error on this line
include "MyLibrary"; -> throws an error on this line
include "functions.as"; -> throws an error on this line
include "MyLibrary.functions.as"; -> throws an error on this line

But at the end of the day, I thought this wasn't necessary, due to the
linking of the projects through build paths, project references etc.

Starting to go bald, I've pulled out so much hair...

Cheers,
K.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to