Basic Question:  How to call a Class in mxml and Run it

Hi.  I'm doing my bit to try and learn Away3D.  I have successfully run the application from Flash Builder 4.0 standard as an ActionScript Project.  However now I want to run it as a Flex Project which gives me the ability to run it as a desktop application via AIR.
I have the following code:  (Why is my code not executing the SphereDemo.as Class which is supposed to be able to display a Poly Sphere on the viewport?)
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       creationComplete="runMe();">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            public function runMe():void
                var mySphere:SphereDemo = new SphereDemo();
                mySphere;
                //SphereDemo;
        ]]>
    </fx:Script>
</s:WindowedApplication>

Here is the complete error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at AwayAS/initEngine()[C:\Users\root\Adobe Flash Builder 4.6\AwayMXML\src\AwayAS.as:27]
    at AwayAS()[C:\Users\root\Adobe Flash Builder 4.6\AwayMXML\src\AwayAS.as:17]
    at SphereDemo()[C:\Users\root\Adobe Flash Builder 4.6\AwayMXML\src\SphereDemo.as:8]
    at AwayMXML()[C:\Users\root\Adobe Flash Builder 4.6\AwayMXML\src\AwayMXML.mxml:12]
    at _AwayMXML_mx_managers_SystemManager/create()[_AwayMXML_mx_managers_SystemManager.as:51]
    at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\4.y\frameworks\ projects\framework\src\mx\managers\systemClasses\ChildManager.as:311]
    at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\4.y\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:3057]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2843]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2723]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/timerHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:542]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

Similar Messages

  • How to call a class that extends a frame from a panel ?

    How to call a class that extends a frame from a panel ?
    I am trying to create an application say "Videoshow"
    Videoshow has a panel which in turn consists of 2 components : 1]a textarea( to show the contents of a page) and 2] a mediaclip(to show the video).
    Now I have an application "MediaApplication"(to show the videoclip) which extends Frame (Code from Java 2 Unleashed, Chap 21). I want to show this MediaApplication in Component 2 of the above panel. But when I do this, I only see the MediaApplication frame instead of the whole SlideShow.
    I want to do something likethis.
    VideoShow :
    |---------------------------------|-------------------|
    | |
    | (Comp 1) | (Comp 2)
    | TEXTAREA | Video Clip
    | |(MediaApp entends Frame)
    |---------------------------------|-------------------|
    What is the best way to achieve this ? Also which component can I use to show the videoclip ?

    im not familiar with the code you mention from Java 2 Unleashed, but your best bet is to read up on Swing a bit - so you get an idea of how Swing containers and components work - then im sure you'll find a solution to your problems. Then if you encounter any difficulties whilst your attempting to do that, post your code in the Swing forum and im sure someone will help you.

  • How to call java class from pl/sql procedure ?

    Hello everyone,
    My query is..
    There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
    and the other thing is.. oracle is in one machine and java is in another .. :(
    hope ..u can help me out !!
    Thank in advance !!

    but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
    so how to call java class file which is on another machine and oracle in another..

  • How to  call library classes threw xml

    In my flash library has "MC",
    var xml:XML=<m c="MC"></m>
    How to call MC class threw xml.

    It's a bit cryptic but I think you mean like this:
    import flash.utils.getDefinitionByName;
    import flash.display.MovieClip;
    var xml:XML = <m c="MC"></m>;
    var classRef:Class = getDefinitionByName(xml.@c) as Class;
    var movieclip:MovieClip = new classRef() as MovieClip;
    addChild(movieclip);
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • How to call Sri Lanka mobile phones and land-lines...

    How to call Sri Lanka mobile phones and land-lines from skype? When i am in overseas how to use skype to call to Sri Lanka mobile phones and land-lines? Can i know the process, how to get skype credit?, how to get subscriptions?, what are the rates for mobile phones and land-lines?

    CajoTech wrote:
    Were unable to call corporative landline numbers in Finland (010 and 020 numbers). We have 1 package for landline calls inside finalnd and the other one for making calls to mobile phones. Any idea what else do we need?
    Hello and welcome to the Skype Community.
    Your account shows that you have an Unlimited World Subscription which includes calls to private landlines in Finland. Your Subscription does not include calls to corporate landlines or to cellphones in Finland. To call corporate landlines you need to Buy Skype credit and to call cellphones either credit or a specific Skype subscription 
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • How to make a button to stop and run a for loop?

    How to make a button to stop and run a for loop?  and if it is stopped it shall start from where i t stopped.

    Your VI has some very fundamental flaws.
    The start/stop button is outside the FOR loop, thus it will NOT get read during execution of the FOR loop, but only before the FOR loop starts. Think dataflow!
    Thus the terminal of the start/stop button belongs inside the FOR loop.
    Your FOR loop iterates 20x, which probably takes about a nanosecond. You will NOT be fast enough to reliably press the start/stop button during a specific iteration of the FOR loop.
    Your code does not "stop and run" a FOR loop (sic). The loop always spins, but executes an empty case when "Stopped". I guess that's what you actually want?
    Once you solve (2), the x indicator will contain a random value whenever you "stop".
    As soon as the 20 iterations complete, the outer while loop spin an things start over, another nanosecond later.
    Place e.g. a 500ms wait inside the FOR loop to solve this.
    Don't place terminals of indicators on top of formula nodes.
    Your formula does not produce any output, so really has no purpose.
    Use a real "stop" button to terminate the while loop (mechanical action: latch when released). Right now you are using a plain switch, which does not reset to false before the next run. This means that you need to manually reset it before running the program again.
    It is oftern useful to operate the VI in execution highlighting mode. You will immediately see that your button does not get read during execution of the FOR loop. Try it!
    LabVIEW Champion . Do more with less code and in less time .

  • HT201363 my ipad2 is disabled because i put in the wrong passcode and it locked. How do I get it back up and running?

    my ipad2 is disabled because i put in the wrong passcode and it locked. How do I get it back up and running?

    See Here  >  http://support.apple.com/kb/HT1212

  • How to call a class file in a jsp without deploying anything in j2ee

    Hi,
    I am new in J2EE. I have some jsps, which I configured using web.properties(documentroot=c:/jsp/). I am able to get
    those pages by the web browser. I have some import statements in some jsps, now I
    am trying to access those page but it is failing, it says
    org.apache.jasper.JasperException: Unable to compile class for
    JSPD:\j2sdkee1.3\repository\pradip\web\_0002fLogin_0002ejspLogin_jsp_0.java:1:
    Class com.gui.UPMGuiGlobalConstants not found in import.
    import com.gui.UPMGuiGlobalConstants;
    Actually I have not deployed any class file or jsps.. Now my question is can I access
    these jsps without deploying anything, like can I put my .jar file in any j2ee
    directory(like lib or anywhere else, I already tried after putting in /lib) and restart the
    j2ee and use it. So how can I call a class file from a jsp without any kind of
    deployment?
    Please send me the reply as soon as possible.
    Regds,
    Pradip

    After you put the jar containing the class to import into the WEB-INF/lib directory, you still need to include it in the jsp.
    Putting the jar into the lib dir, will make it available to the vm, but as in any other java class, you still need to import it into the class, that the jsp will be compiled into.
    And you do that by putting
    <%@page import="com.gui.UPMGuiGlobalConstants" %>somewhere near the top of your jsp. (well you don't need to put it there, but it good style ;)
    That should do it.

  • Some basic questions: Help defining Real World Classes

    I am trying to write a small applet using proper OO concempts and Java technique and I'm confused on the proper way to do this. I think I know several ways that work and have all the peices I need such as JMail and JDBC drivers, but would appreciate help on understanding how to properly structure my classes and objects.
    The application will simply do the following: I have a database table that receives a new entry when a truck is late for its delivery. When this new record is created, I need to send an email to the driver manager who will then decide (via a jsp page) whether the customer should receive an email about the late delivery. For each truck, there will only be one driver manager and one client to be notified.
    What I'm confused about is what classes and objects to create (and why). My first thought is to create a LateTruck class, a DriverManager class and a Customer class and have the LateTruck class call up the DriverManager to send an email then have the JSP page reinstantiate the LateTruck and instantiate the Customer class to send the email to the client.
    If I do it this way, is there a proper way to send the email? Do I send the email as a method in LateTruck which gets the email address from DriverManager such as
    LateTruck.Order1234.SendEmail(DriverManager.JoeBlow.Email)
    or do I use LateTruck to write the email message which I then pass to DriverManager such as
    DriverManager.JoeBlow.SendEmail(message)
    Should I even break up the applet into three classes and objects? Since each LateTruck only needs one DriverManager and one Client, is the proper way to do this to create only one class called LateTruck which has DriverManager, DriverManagerEmail, ClientName and ClientEmail all as properties of LateTruck?
    Thanks for any help in understanding the basics here.

    Is that the story of Static Write and the Seven Classes and the evil stepmother Wilma Gates who kept asking "Mirror Site, Mirror Site on the web, who's got the buggiest InterDev?

  • How to call a class from a method ?

    Hi,
    I have a Connection class and another class called 'B' class.
    class Connection {
    public static void main (String args[]) {
    try{
    Class.forName("...jdbcDriver...);
    String url="jdbc:...//localhost:.../DBName";
    Connection con=DriverManager.getConnection(url,"...","...");
    Statement stmt=con.createStatement();
    }catch (Exception e) {e.printStackTrace();}
    class B {
    public void someMethod {
    How do I call the Connection class to do this ?
    stmt.executeQuery(query);
    Thanks a lot !
    Phil

    Thanks !
    class Connection {
    public returnType Connection{
    Statement stmt=con.createStatement();
    return stmt;...
    ...main {
    class B {
    public someMethod {
    Connection conn = new Connection();
    conn.Connection.executeQuery(query);
    woah - what is that??
    And why make a new Connection here, I thought you did that in your Connection class (which is not a good choice of names, by the way, since it matches the name of the java.sql.Connection interface)
    Is this what you mean ? But, what is the returnType
    above ?You intend to return your stmt reference, right? So, the return type of that method has to match the type of thing you are returning, which is Statement.
    >
    Thanks !
    Philip

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How to call Java class from Forms 6i?

    Hi friends,
    I need to call a Java class from my Forms 6i application.
    (It runs under WIndows XP. It's a client/server application and I have only the client and the Form builder installed on my PC)
    I don't know almost anything about Java's world so your help would be very useful for me.
    Could you tell me exactly what i have to do?
    I've read in metalink several Notes, but they supposed that the Java architecture is already installed in the computer.... I only have the default installation of Developer 6i... so I would need to know:
    - How to install/configure the neccesary to execute Java classes without problem
    - How to invoke the .class from Forms 6i.
    Thanks a lot
    Jose.

    And also this one:
    Problem Description
    Installed Forms 6i Rel 2 on a MS Windows machine. When trying to Import the Java
    Classes getting the errors
    PDE-UJI0001 Failed to create the JVM
    Solution Description
    You need to to install JDK 1.2.2 to run the Java Importer. And set the PATH's
    and classpath's correctly.
    Explanation
    1. Download and install the JDK 1.2.2.
    Possibly available at: http://java.sun.com/products/archive/
    2. Assuming the JDK 1.2.2 is installed in c:\jdk1.2.2 directory and the JRE in
    C:\PROGRA~1\JAVASOFT\JRE\1.2 directory; ORACLE_HOME=C:\Dev6iR2.
    Set the PATH to
    set PATH=c:\jdk1.2.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin\classic;%PATH%
    ( If you are using ias9i then the JDK 1.2.2 comes with the ias installtion ,
    in this case please set the PATH to
    D:\ias9i\Apache\jdk\bin;D:\ias9i\Apache\jdk\jre\bin;D:\ias9i\Apache\jdk\jre\bin\classic;%PATH% )
    3. Set the CLASSPATH to set CLASSPATH=%CLASSPATH%;C:\Dev6iR2\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
    (If you do not set the CLASSPATH correctly you will get the error
    PDE-UJI002 Unable to find the required java importer classes)
    4. Now run the Forms Builder by using the command.
    C:\Dev6iR2\bin\ifbld60.exe
    Now the Java Importer Should Run fine.
    Francois

  • Basic question, how to create rtf template with a given xml file

    Hello guys
    I am new to BI publisher and I am learning how to create rtf templates using given xml fiel definitions by following the bi publisher guide
    The steps I am following is:
    1, create template using template builders, which is downloaded into MS words.
    2, In the empty template, map the xml columns with template field using BI publisher tag
    3, upload the template to BI Publisher as a layout.
    That's all I can understand.
    My question is:
    1,in which above step do I import XML file into template builder (if not bi publisher), how to do so?
    2,After template is created, how to associate this template layout with existing reports in BI Publisher, or is it necessary at all?
    3,In the template content in MS Word template builder, what should I enter other than BI publisher tags for mapping XML field to desired template field
    Or, if my understand of this process is entirely wrong, what's the right process of creating rtf template with a given XML file definition
    Thanks

    If you have a BI Publisher desktop installed, have a look a the demos,.. should answer most of your basic questions.
    (Windows) Start->Programs->Oracle BI Publisher Desktop->Demos
    Invoice Demo - good one for those with E-Business Suite
    Report Demo - Sample using BI Publisher

  • How to call java class file from jsp

    hi
    we need to call java classes (which are written separately in .java file )from jsp file. we need it for our project if anyone knows about please reply us.
    bye
    siva sankari

    you can call the methods in a lot of ways. you could use scriptlets with the
    <%@ page import="package.class"%> and then inside instantiate an object
    <%
         MyClass mc = new MyClass(parameters if any);
         mc.theMethodYouWantToCall();
    %>or as Madathil has stated,
    or use the JSP tags
    <jsp:useBean id="anyname" class="classname"/>and then use the getProperty tag
    or even Custom Tags

  • How to call java class in jstl core

    Hi,
    Can any one guide me how to call a java method using jstl core library

    Read on about EL functions.

Maybe you are looking for