Creating class instances at different depths

I have a custom class called line that takes two sets of co
ordinates and draws a line between them.
The class uses _root.createEmptyMovieClip() to make a
container to draw in to but I need it to draw in to other movies on
the stage in a similar way to createEmptyMovieClip() eg
_root.childClip1.childClip2.line=new Line(x1,y1,x2,y2);
I have tried createEmptyMovieClip(),
this.createEmptyMovieClip(), _parent.createEmptyMovieClip() etc but
with no joy.
How can my Line constructor function get the path information
from the declaration or do I have to pass it as a parameter?

Whenever I design a class, that class always takes a
target:MovieClip parameter. then I create a container for the class
inside that target. This way, I can place my class objects inside
any clip I so desire at any level.

Similar Messages

  • Problem referencing a newly created class instance - I don't understand why

    Hi,
    I am completely new to actionscript although I do come from a OOP background. I have been asked to trial Flash and Actionscript 3 in particular - so I do come with a few preconceptions on how I expect actionscript to behave.
    I have a problem I donot understand. I have created a new class and to test it I use a simple test harness in the form of a .fla file.
    The issue I have is when I create a new instance of the class and assign it to a variable, subsequent background changes to that instance of the class are not 'picked-up' when referenced through the variable. I would expect that given instance of class could be assigned to many different variables and any updates using one variable would  accessible using any of the other variables.
    My test class, XMLDataLoader, is coded as follows:
    package  {   
        public class XMLDataLoader {
            import flash.events.*;
            import flash.net.*;
            import flash.utils.*
            private var _xmlData:XML;
            private var _xmlLoaded:Boolean;
            public function XMLDataLoader(pFileName:String){
                init(pFileName);
            public function getXMLData():XML {
                return this._xmlData;
            public function XMLLoaded():Boolean {
                return this._xmlLoaded;
            private function init(pFileName:String):void
                // Create the URLLoader instance to be able to load data
                  var loader:URLLoader = new URLLoader( );
                var urlRequest:URLRequest = new URLRequest(pFileName);
                this._xmlLoaded = false;
                // Define the event handlers to listen for success and failure
                   loader.addEventListener ( Event.COMPLETE, handleComplete );
                loader.load(urlRequest);
                function handleComplete ( e:Event ):void
                    trace ( "The data has successfully loaded" );
                    this.xmlData = new XML(e.currentTarget.data);
                    this._xmlLoaded = true;
    The class simply reads a text file and assigns its contents to the class variable _xmlData. The class variable _xmlLoaded identifies when the load is complete.
    The test harness is a simple flash app consisting if a single timeline with 1 frame, 1 symbol on the stage and the following actionscript code:
    import flash.events.TimerEvent;
    var t:XMLDataLoader = new XMLDataLoader("Test Article.xml");
    var xmlData:XML;
    var waits:uint = 0;
    wait(1);
    function wait(ct:uint):void
        var TimerInstance:Timer = new Timer(500, 1);
        TimerInstance.addEventListener(TimerEvent.TIMER, TimerHandler);
        TimerInstance.start();
        function TimerHandler(event:TimerEvent):void
           if(t.XMLLoaded()){
                xmlData = t.getXMLData();  
                trace(xmlData.toXMLString);
            } else {
                trace(ct + " - Waiting....");
                if (ct <= 10) {
                    wait(++ct);
    The script defines a variable and assigns it a new instance of the XMLDataLoader. Originally, I immediately followed this with a trace statement but  insuffient time had elapsed to allow the load to complete, so I had to introduce a wait function to force a delay. This wait function is recursive. It checks to see if the load is complete. If it is, a trace statement will outoput the xml. If not the function will call itself again (upto 10 times)
    The resultant output is as follows:
    The data has successfully loaded
    1 - Waiting....
    2 - Waiting....
    3 - Waiting....
    4 - Waiting....
    5 - Waiting....
    6 - Waiting....
    7 - Waiting....
    8 - Waiting....
    9 - Waiting....
    10 - Waiting....
    According to this output, the XML has been loaded before the end of the first timer cycle but this is not detected in the test harness. I have stepped through the code in debug mode and I have confirmed that the XML was loaded, and the class variables where correctly set, including _xmlLoaded = true. However, in the test harness the instance both class variables  are null. I don't believe this should be the case but obviously I must be wrong - can anyone explain where my logic is flawed. I did think scoping might be the problem but having tried a couple of modifications, I concluded that it wasn't.
    Thanks in advance.

    never nest named functions.  unnest TimerHandler and retest.
    (and, you should be using listener to determine when loading is complete.)

  • Creating Class Instances from Strings

    Folks,
    I have a class called Employee. I would like to create instances of this class based on the user input in certain JTextFields in a form. For instance, if the user inputs First Name = John and Last Name = Doe, then the instance John_Doe of the Employee Class is created. I played w/ newInstance() and Class.forName() but can't seem to get that working. Does this require reflection? I just need someone to point me in the right direction.
    Thanks,
    steve

    Dear jverd (and walken),
    Thanks for your note. I'm sorry, I don't really
    understand what you mean by "is the class determined
    at runtime or just the parameters?"It sounds like walker answered your immediate questions, but just to clear up this (which I guess I didn't state very clearly), what I meant was, will you sometimes be creating an Employee, and sometimes some other class, or will it only be the employee's name, etc., that's different for each one you create?
    If, at the time you're writing your code, you know which class you're creating, then you don't need reflection. You just do new WhateverTheClassIs() (possibly passing parameters, such as names, to the constructor.
    On the other hand, if the class to be instantiated will be determined at runtime--maybe you prompt the user for which class, and he enters "Employee"--then you need to use reflection.
    You shouldn't need to worry about reflection for a while. Get the fundamentals of the language solidly under your belt before you tackle that. Good luck! :-)

  • How to create an instance

    Hi all,
    Actually, I want to create an instance without priting or sending to any destination.
    My code steps should be:
    1. logon
    2. get report object
    3. set parameters information
    4. create an instance / schedule report
    once I create all instances for different reports, then I need to read all created instance objects (report with data populated) and sent to printer.
    Is this possible? If possible, please suggest how to proceed further.
    Thanks,
    Krishna

    here is a general code sample - you may need to modify it.
    <%
    IEnterpriseSession oEnterpriseSession = null;
    IInfoStore oInfoStore = null;
    String username = "administrator";
    String password = "<password>";
    String cmsname = "<cmsname>";
    String authType = "secEnterprise";
    String reportName = "<reportname>";
         oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);
         oInfoStore = (IInfoStore)oEnterpriseSession.getService("","InfoStore");
         String query =      "select top 1 * from ci_infoobjects where si_name='" + reportName + "' and si_instance=0";
         IInfoObjects reports = oInfoStore.query(query);
         IReport report = (IReport) reports.get(0);
         ISchedulingInfo schedInfo = report.getSchedulingInfo();
         schedInfo.setRightNow(true);
         schedInfo.setType(CeScheduleType.ONCE);
         // schedule the report to default destination.
         oInfoStore.schedule(reports);
         // retrieve report instance. You may have do this multiple times if the report is still in process.
         query = "select top 1 * from ci_infoobjects where si_name='" + reportName + "' and si_instance=1 order by si_creation_time desc";
         IInfoObjects instances = oInfoStore.query(query);
         IInfoObject instance = (IInfoObject) instance.get(0);
         IReportAppFactory rptAppFactory = (IReportAppFactory)es.getService("", "RASReportService");
         ReportClientDocument clientDoc = rptAppFactory.openDocument(instance, 0, Locale.ENGLISH);
         //set PrintReportOptions object properties. Look in RAS SDK documentation for further info.
         clientDoc.getPrintOutputController().printReport(PrintReportOptions object);
         clientDoc.close();
    oEnterpriseSession.logoff();
    %>

  • Creating custom class instances for XML nodes

    Hi guys,
    I'm trying to load an external XML document in my application
    and create an instance of a custom class for each node in the XML
    based on the value of some of their elements. The instances created
    will eventually end up in a DataGrid by the way. The problem I'm
    having is there seems to be many ways of doing small parts of this
    and I have no idea how to make them all gel. Initially I'm using
    HTTPService to load the XML file but I've seen people just use an
    XML object. Then, after that, I initially set the loaded XML to an
    ArrayCollection but others have used XMLList or XMLListCollection.
    I've no idea what's the best way to do this.
    Eventually, when I've created all of these instances by
    looping over the XML and creating them how will I make them
    bindable to the data grid? I'm guessing I'll have to group them
    somehow...
    Any help would be greatly appreciated. Thanks

    Hey Tracy,
    That is exactly what I was talking about in a previous post
    you replied to
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&threadid=1344350
    Anyhow, Below is some code I created to do what your saying
    somewhat dynamically. The idea being you can have many different
    object types that you may want to populate with data from XML. In
    my case I am using e4x as the result type from my web services. At
    present I have about 6 different classes that call this function.
    I'd love to get some opinions on the function. Good bad or
    ???? Any improvements etc????
    package . . . .
    import flash.utils.describeType;
    import flash.utils.getDefinitionByName;
    import flash.utils.getQualifiedClassName;
    import mx.utils.ObjectUtil;
    * Utility class to convert xml based Objects to class
    instances.
    * Takes a value object as the destination and an xmlList of
    data
    * Look through all the items in the value object. Note we
    are using classInfo..accessor since
    * our objects are bound all variables become getter /
    setter's or accessors.
    * Also note, we can handle custom objects, arrays and
    arrayCollections.
    * History
    * 03.11.2008 - Steven Rieger : Created class
    public final class XMLToInstance
    public static function xmlToInstance( destinationObject :
    Object, sourceXMLList : XMLList ) : void
    // Get the class definition in XML, from the passed in
    object ( introspection so to speak )
    var classInfo : XML = describeType( destinationObject );
    // Loop through each variable defined in the class.
    for each ( var aVar : XML in classInfo..accessor )
    // If this is String, Number, etc. . . Just copy the data
    into the destination object.
    if( isSimple( aVar.@type ) )
    destinationObject[aVar.@name] = sourceXMLList[aVar.@name];
    else
    // Dynamically create a class of the appropriate type
    var className : String = aVar.@type;
    var ObjectClass : Class = getDefinitionByName( className )
    as Class;
    var newDestObject : Object = Object( new ObjectClass());
    // If this is a custom type
    if( isCustomType( className ) && ObjectClass != null
    // Recursively call itself passing in the custom data type
    and the data to store in it.
    // I haven't tested nested objects more than one level. I
    suppose it should work.
    // Note to self. Check.
    xmlToInstance( newDestObject, sourceXMLList[aVar.@name] );
    else
    // Must be some sort of Array, Array Collection . . .
    if( ObjectClass != null )
    var anXMLList : XMLList = new XMLList(
    sourceXMLList[aVar.@name] );
    for each( var anItem : XML in anXMLList )
    // I'm sure there are more types, just not using any of them
    yet.
    if( newDestObject is Array )
    newDestObject.push( anItem )
    else
    newDestObject.addItem( anItem );
    // Add the data to the destination object. . . .
    destinationObject[aVar.@name] = newDestObject;
    } // end function objectToInstance
    public static function isSimple( dataType : String ) :
    Boolean
    * This function is pretty self explanatory.
    * Check to see if this is a simple data type. Did I miss
    any?
    * History
    * 03.11.2008 - Steven Rieger : Created function
    switch( dataType.toLowerCase() )
    case "number":
    case "string":
    case "boolean":
    return true;
    return false;
    } // end isSimple
    public static function isCustomType( className : String ) :
    Boolean
    * This function is pretty self explanatory.
    * Check to see if this is a custom data type. Add them here
    as you need. . .
    * History
    * 03.11.2008 - Steven Rieger : Created function
    var aClassName : String = className.replace( "::", "."
    ).toLowerCase();
    aClassName = aClassName.substr( aClassName.lastIndexOf( "."
    ) + 1, aClassName.length - aClassName.lastIndexOf( "." ) );
    switch( aClassName )
    case "ndatetimevo":
    case "expenselineitemvo":
    return true;
    return false;
    } // end isCustomType
    } // end class
    } // end package

  • Creating an instance of a class from within another class

    I am trying to create an instance of MCQ in the T class but I am getting this error:
    File: E:\JAVA PROGRAMS\assignment 1\T.java [line: 15]
    Error: cannot find symbol
    symbol : class MCQ
    location: class T
    here are the two classes:
    // class T
    import java.awt.*;
    import java.util.*;
    import java.lang.*;
    public class T{
    public T(String aT)
    pest = aT;
    public static T t_one()
    T aT = new T("Calculator");
    aT.addQ(new MCQ( " 2 + 2", "equals 4", "equals 5", "equals 0", " equals -2",
    "is a prime number", 1));
    return aT;
    private String pest;
    //class Q
    import java.awt.*;
    import java.util.*;
    import java.lang.*;
    public abstract class Q{
    Vector q = new Vector();
    public String aT;
    abstract void addQ(Q aQ);
    public class MCQ extends Q{
    String a,b,c,d,e,f,g;
    int answer;
    public MCQ (String a, String b, String c, String d, String e, int answer)
    this.a = a;
    this.b = b;
    this.c = c;
    this.d = d;
    this.e = e;
    this.answer = answer;
    void addQ(Q aQ)
    q.addElement(new T(aT));
    I tried to make reference to MCQ by doing this in class T:
    MCC qT = new MCQ() ;
    but that presents a whole other set of problems.
    please help I think I have tried everything!

    Use code tags (http://forum.java.sun.com/help.jspa?sec=formatting)
    Don't import java.lang.* . You get those automatically.
    Your MCQ class is really Q.MCQ (the way you posted, anyway).
    If Q weren't abstract, you could do:
    new Q().new MCQ(...)But, you can't create a Q without defining 'add'. You could do it anonymously, but that makes no sense. Put Q and MCQ in separate files and try again.

  • Create an instance of my class variable

    Hello all,
    I'm a newbie to iPhone/iPad programming and am having some trouble, I believe the issue is that I'm not creating an instance of my class variable.  I've got a class that has a setter and a getter, I know about properties but am using setters and getters for the time being.  I've created this class in a View-based application, when I build the program in XCode 3.2.6 everything builds fine.  When I step through the code with the debugger there are no errors but the setters are not storing any values and thus the getters are always returning 0 (it's returning an int value).  I've produced some of the code involved and I was hoping someone could point out to me where my issue is, and if I'm correct about not instantiating my variable, where I should do that.  Thanks so much in advance.
    <p>
    Selection.h
    @interface Selection : NSObject {
      int _choice;
    //Getters
    -(int) Choice;
    //Setters
    -(void) setChoice:(int) input;
    Selection.m
    #import "Selection.h"
    @implementation Selection
    //Getters
    -(int)Choice {
      return _choice;
    //Setter
    -(void)setChoice:(int)input{
              _choice = input;
    RockPaperScissorsViewController.m
    #import "RockPaperScissorsViewController.h"
    @implementation RockPaperScissorsViewController
    @synthesize rockButton, paperButton, scissorsButton, label;
    //@synthesize humanChoice, computerChoice;
    -(void)SetLabel:(NSString *)selection{
              label.text = selection;
    -(IBAction)rockButtonSelected {
    //          [self SetLabel:@"Rock"];
              [humanChoice setChoice:1];
    </p>
    So in the above code it's the [humanChoice setChoice:1] that is not working.  When I step through that portion with the debugger I get no errors but when I call humanChoice.Choice later on in the code I get a zero.
    -NifflerX

    It worked, thank you so much.  I put
    humanChoice = [[Selection alloc]init];
    In viewDidLoad and it worked like a charm.  Thank you again.
    -NifflerX

  • Why portal server can't create an instance of axis.Service class?

    Hi,gurus,
    We developed a uwl custom connector,The time out occured in that custom connector.After adding the time out value from 30s to 300s,the problem still existed.
    The code is like below:
    String endpoint = "http://172.16.127.4:8080/appframe-web/services/WorkItemService";
    Service service = new Service();    // time out code
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    call.setOperationName("wisForPortal");
    call.addParameter("userCode", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);/
    call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
    String temp = "36";
    Object result = call.invoke(new Object[]{temp});
    The time out occured when the portal server create an instance of Service class.Does that mean the server can't find the jars?
    But the object declaration like "Service service=null;" is all right.
    Any ideas?Thanks in advance.

    I have a project called 'Default EAR' in my workspace.
    But I can't add the JAR to the that project. These instructions are for WSAD 4, but I assume WSAD 5 is similar:
    Go to menu File and select Import. Choose "File System" to import from. Specify "Default EAR" as your folder and select the jar file from the directory/browse prompt.
    This is assuming your web app is connected to Default EAR and not some other EAR file. Also once you've done this, you will find that the jar file automatically becomes part of your build path. You didn't have to do anything extra to make that happen.

  • Creating multiple instances of a class in LabVIEW object-oriented programming

    How do you create multiple instances of a class in a loop?  Or am I thinking about this all wrong?
    For instance, I read in a file containing this information:
    Person Name #1
    Person Age #1
    Hobby #1
    Hobby #2
    Hobby #3
    Person Name #2
    Person Age #2
    Hobby #1
    Hobby #2
    Hobby #3
    Person Name #3
    Person Age #3
    Hobby #1
    Hobby #2
    Hobby #3
    If I define a Person class with name, age, and an array of strings (for the hobbies), how can I create several new Person instances in a loop while reading through the text file?
    FYI, new to LabVIEW OOP but familiar with Java OOP.  Thank you!

    First of all, let's get your terminology correct.  You are not creating multiple instances of a class.  You are creating Objects of the class.
    Use autoindexing to create an array of your class type.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to reference the class-instance, created in parent class.

    Hi, I have following scenario. During compilation I am gettting error message -- "cannot resolve symbol - symbol : Variable myZ"
    CODE :
    under package A.1;
         ClassZ
         Servlet1
              ClassZ myZ = new ClassZ;
    under package A.2;
         Servlet2 extends Servlet1
              myZ.printHi();
    How to reference the class-instance created in the parent class?

    some corrections ...
    under package A.1;
         ClassZ
         Servlet1
              init()
                   ClassZ myZ = new ClassZ;
    under package A.2;
         Servlet2 extends Servlet1
              myZ.printHi();

  • How to create an instance of a class which is stored in a String?

    I've class name stored in a String Object.
    now i've to create an instance of that class name.
    How?

    This is very dangerous ground because you give up compile-time safety, but you can get a Class object using Class.forName(String). Then you can use methods of the class Class to operate on it (including creating an instance).

  • How to create an instance of a protected class outside the enclosing packag

    Hi all,
    I have a piece of code like this:
    package test;
    public class A {
    protected class B { }
    How to create an instance of B outside the package test ? Could you please give me an example ?
    Thanks
    Ha Chau

    Thank WirajR for your reply, but in your solution,
    you have to create an instance of B inside class A
    and pass it outside. I would like to know whetherwe
    can create an instance of class B outside thepackage
    test. That means I want the instance creation
    expression of B appears outside the package test.Can
    we do that?
    If you want to use a class this way then it shouldn't
    be marked protected. I can't see why you don't
    just declare it public if that's what it is.
    Wouldn't be much point to haveing a protected
    modifier if it had no effect, would there?I think there is use for it if you use an interface to filter out the parts you want to give public access to, and keep the part you want to keep protected, protected

  • How to create an instance of a class?

    how do you create sn instance of a class, and how do you call a method from another class?

    You may need to read thru the information provided on this page to understand how to create objects: http://java.sun.com/docs/books/tutorial/java/data/objectcreation.html
    I'd also suggest you read the tutorial available at: http://java.sun.com/docs/books/tutorial/java/index.html
    Regarding how you call a method belonging to another class you could do it in the foll. ways depending on whether the method is static or not - a static method may be called using the class name followed by a dot and the static method name while a non-static method would require you to create an instance of the class and then use that instance name followed by a dot and the method name. All said and done i'd still suggest you read thru the complete Java programming tutorial to get a good grounding on all these concepts and fundamentals of the language if you are looking to master the technology.
    Thanks
    John Morrison

  • Creating an instance of a class with no default constructor

    Hello gurus,
    I wrote my own serialization and RMI protocol for both C++ and Java that follows closely what the default Java version does. I'm trying to recreate an object on the Java side that was sent over the wire. The first step is to create an instance of the class. How do I create an instance of a class that has no constructor (i.e. the only instances are static, created by the class itself and returned by static methods) or one that has no default constructor (like Integer)? The Java serialization seems to support it but the reflection API doesn't seem to have any support for this (i.e. Class::newInstance() and Constructor::newInstance()). It seems that through the standard API you can only create an object via one of its constructors. There must be a "hidden" method somewhere that allows the Java serialization to create an object without calling a constructor - where is it?
    Dominique

    There must be a "hidden" method
    somewhere that allows the Java serialization to create
    an object without calling a constructor - where is
    it?You are correct, the way in which the Serialization creates Objects is "hidden" deep within the runtime.
    If it were not hidden, you would be able to find it, and use it to violate the integrity of the VM.

  • Creating an instance of a class at runtime?

    Does anyone know how to create an instance of a class at RunTime? For example, I want to load classes from a JAR file at RunTime, and then create instances of certain classes of each JAR. I ask this because I do not see how to create an instance of one of those classes the traditional way, SomeClass var = new SomeClass(). I am pretty sure that someone out there has done this and succeeded in doing it. All of the post on this stuff only talk about loading the class from a JAR file, but I have already loaded them using URLClassLoader�s findClass() method. I have also created an instance of the class that findClass() returns using newInstance(), but newInstance() returns an object of type Object. How can I convert this object to an object of type SomeClass? You cannot cast it because the compiler will complain due to the import statement issue. So if you cannot include the import statement because that classpath does not exist, then how the heck would you cast the newInstance() object into a SomeClass object?

    You can cast the returned object to the type you need...that is what I do in my applet. The trick is that you must get the instance of the applets class loader (or you get a classCastException). Pay attention to this line below - that's the real key here.
    "// Get a reference to the applets own classloader"
    protected CBaseQuestionnaireFile m_BaseObject = null;// declared up front
    m_BaseObject = loadAndRunClass("com.cpm.dataentry.questionnaire.CQuestionnaireFile");// fully qualified base object
    Here is the load and run method:
       CBaseQuestionnaireFile loadAndRunClass(String classname)
          com.cpm.common.base.CBaseQuestionnaireFile questBase = null;
          Class cClass = null;
          try
             // first we open the jar file with the classes we need
             String[] aJarList = new String[10];
             // Questionnaire format file
             File fURL1 = new File(GetMainFrame().m_strQuestionnaireFileName);
             URL url1   = new URL(fURL1.toURL(),"");
             URL urlNew = new URL("jar:" + url1.toExternalForm() + "!/" );
             // Server base class directory
             String strServerDirectory = "http://" + GetMainFrame().m_strHost + "/APPLETS/";
             File fURL2 = new File(strServerDirectory);
             URL url2 = new URL(fURL2.toURL(),"");
             URL urlNew2 = new URL("jar:" + url2.toExternalForm() + "!/" );
             // Local base class directory
             String strLocalDirectory = CSystem.GetBasePath() + "/Research/bin/";
             File fURL3 = new File(strLocalDirectory);
             URL url3 = new URL(fURL3.toURL(),"");
             URL urlNew3 = new URL("jar:" + url3.toExternalForm() + "!/" );
             File fURLBase = new File(CSystem.GetBasePath() + "/Research/bin/base.jar");
             URL urlBase = new URL(fURLBase.toURL(),"");
             URL urlNewBase = new URL("jar:" + urlBase.toExternalForm() + "!/" );
             File fURLControl = new File(CSystem.GetBasePath() + "/Research/bin/controls.jar");
             URL urlControl = new URL(fURLControl.toURL(),"");
             URL urlNewControl = new URL("jar:" + urlControl.toExternalForm() + "!/" );
             File fURLUtil = new File(CSystem.GetBasePath() + "/Research/bin/utlities.jar");
             URL urlUtil= new URL(fURLUtil.toURL(),"");
             URL urlNewUtil = new URL("jar:" + urlUtil.toExternalForm() + "!/" );
             // Determine where to look
             URL[] urlList = null;
             if(GetMainFrame().m_isStandalone == false) {
                // From a browser
                CSystem.PrintDebugMessage("Running as an applet");
                if(GetMainFrame().m_bOnLineMode == true) {
                   // On line
                   CSystem.PrintDebugMessage("*** On Line Mode ***");
                   urlList = new URL[2];
                   urlList[0] = urlNew;
                   urlList[1] = urlNew2;
                else {
                   // Off line
                   CSystem.PrintDebugMessage("*** Off Line Mode ***");
                   urlList = new URL[4];
                   urlList[0] = urlNew;
                   urlList[1] = urlNewBase;
                   urlList[2] = urlNewControl;
                   urlList[3] = urlNewUtil;
              else {
                 CSystem.PrintDebugMessage("*** Stand Alone Mode ***");
                 urlList = new URL[1];
                 urlList[0] = urlNew;
    CSystem.PrintDebugMessage("Question file/path: " + GetMainFrame().m_strQuestionnaireFileName);
            // Set the wait cursor
            GetMainFrame().SetWaitCursor();
            // Get a reference to the applets own classloader
            Class myClass = getClass();
            ClassLoader appletClassLoader = myClass.getClassLoader();
            // Call our multi-jar class loader
            JarClassLoader jarLoader = new JarClassLoader(urlList,appletClassLoader);
    CSystem.PrintDebugMessage("CPM Test - passed Jar Loader" + jarLoader.toString());
             // Load the classname from the jarfile
             try
                  cClass = jarLoader.loadClass(classname);
             catch(ClassNotFoundException cnfe)
                Object[] optionsConfirm = { "Ok" };
                JOptionPane.showOptionDialog(GetMainFrame(),"Questionnaire file is either damaged or has been tampered with.", "Questionnaire File Error",
                JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, optionsConfirm, optionsConfirm[0]);
                GetMainFrame().m_strQuestionnaireFileName = "";
                // Clear the wait cursor
                GetMainFrame().ClearWaitCursor();
                return null;
             Class cSuperclass = cClass.getSuperclass();
    CSystem.PrintDebugMessage("Test Superclass type is: " + cSuperclass.toString());
             Object o = cClass.newInstance();
    CSystem.PrintDebugMessage("Test plain class type is: " + o.toString());
             // Never remove this line of code
             // without it, a crafty user could use our load routine
             // to load/and run some nasty code
             // This test makes SURE that *ONLY* questionnaires get opened
             // and their methods get called
             if(o instanceof com.cpm.common.base.CBaseQuestionnaireFile)
                // Create the object
    CSystem.PrintDebugMessage("Test Is instance of CBaseQuestionnaireFile");
    CSystem.PrintDebugMessage("CPM Test - Casting to Base Class");
                questBase = (com.cpm.common.base.CBaseQuestionnaireFile)o;
    CSystem.PrintDebugMessage("CPM Test - Getting languages from questionnaire");
                GetMainFrame().GetLanguagesFromQuestionnaire(questBase);
    CSystem.PrintDebugMessage("CPM Test - Setting locale from Questionnaire selection");
                questBase.SetQuestionnaireLocale(GetMainFrame().m_locale);
    CSystem.PrintDebugMessage("CPM Test - Initializing Questionnaire");
                questBase.Initialize();
                questBase.InitializeCards();
              else
                Object[] optionsConfirm = { "Ok" };
                JOptionPane.showOptionDialog(GetMainFrame(),"Questionnaire file is either damaged or has been tampered with.", "Questionnaire File Error",
                JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, optionsConfirm, optionsConfirm[0]);
                GetMainFrame().m_strQuestionnaireFileName = "";
                // Clear the wait cursor
                GetMainFrame().ClearWaitCursor();
                return null;
          catch (Exception e)
              exDialog.showForThrowable(e.toString(),e);
         // Clear the wait cursor
         GetMainFrame().ClearWaitCursor();
         // Set MouseListener Pointer
    //     questBase.SetMouseListenerPointer(GetMainFrame().m_mouseListener);
         return questBase;
       }

Maybe you are looking for

  • All Applications crash when I try to print (2)

    I have and epson EPL-6200L b/w laser printer and an epson 1270. the 1270 s fine. the 6200 crashes EVERY application, from text edit to adobe inDesign. In text edit, I can open the 'page setup' dialog box and edit, but clicking the 'print' button caus

  • Video Download Crash

    On my first attempt to download a video from the itunes store, itunes crashed during the download. Not only that but simply attempting to open the default video playlist in itunes crashes the app immediately. a brief glimpse ( before the crash) of so

  • Custom Object Test query/report

    Is there a way to run a query or get a report for the scripts containing Custom Object Tests?

  • Printed Documentation is not enabled.

    Hi all, I am using Robohelp - X3 on Windows XP Operating system with Office 2003. I couldn't see the Printed Documenation option at all. I am worried whether this could be a compatibiity issue. Please help me by reverting with a solution for this. Re

  • Jdbc adaptor picking the messages at same time.

    hi, there are  5 messages blocked in status Delivering are blocking the 5 JDBC Threads allowed at the Adapter Engine itself. Even if I allow a bigger number of concurrency messages it will not change the real number of simultaneous threads. You need