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/

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 JSP that outputs XML without HTTP request

    It should be a simple solution but I can't seem to find a concise recommendation anywhere. We are building a B2B subsytem for our app and we need to send XML to our vendor. I'm evaluating the possibility of using JSPs for that and everything looks good until the time you actually want to invoke it. It's obvious how to code the JSP itself, but I'm looking for an efficient way to call it to generate XML. We do not have an HTTP request or a servlet, the communication is on the EJB level. So I can't get a RequestDispatcher for example, and we don�t have HttpServletRequest/HttpServletResponse either. It is NOT a servlet or JSP calling another JSP, it's a regular Java class or EJB.
    Ideally, I would rather bypass the whole HTTP infrastructure and just use JSP as a formatter. So it boils to a question of how to invoke it and how to pass the parameters without HTTP session or request. One of the alternatives we are reviewing is using XSP but we would prefer JSPs if we can figure out how to call it efficiently. HttpUrlConnection is not a good option, we'd like a direct call.
    Any suggestions will be greatly appreciated.

    Thanks for the response. Let me clarify the requirements for the question. The way we are supposed to send XML to the vendor is via CORBA (don't ask me why:-) where the only parameter essentially is a string containing the XML document. So the quesiton is not how to send it to the vendor, but how to format our JavaBeans into XML.
    We can't use JAXB because it doesn't support schema. We tried a few libraries out there but they stumble on our schema and we can't change it because it comes from the vendor. So it sounds like our only choice for today is to generate XML ourselves.
    The data is stored in JavaBean packet objects and that's our input. Our output should be a string with XML document conforming to the schema. Posting a request to ourselves will of course work, but that's too much unnecessary overhead. Another option is implementing HttpServletRequest and HttpServletResponse and calling service method directly. Better suggestions?

  • 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.

  • 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

  • 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 does call library / .dll file work?

    I'm helping someone troubleshoot their machine / LabVIEW program.  I'm fairly new to LabVIEW, and I'm not sure what part of the program is doing.  I've attached the .vi in question.  In the middle of the page there is a sub.vi with a blank icon with two dots in it (peak_detect_dll.vi).  This sub.vi has a call library function node, which I understand calls the file it points to in the config:  s3ilvutils.dll (also attached).  I don't understand what this file does.  I've searched the help and the discussion board.  Can anyone explain to me what this is doing?
    Jeremy Backer
    CLAD
    Attachments:
    count.vi ‏31 KB
    peak_detect_dll.vi ‏8 KB
    s3ilvutils.zip ‏3 KB

    Well I typed too slowly! See that you have a bunch of other answers in the time I took. It was probably written in another language, but dll's can be created in LabVIEW as well. The "C" calling convention only describes a interface convention, doesn't guarantee that C was the language it was developed in, although it probably is a good bet that it was C/C++. I don't think there is an "easy" was to reverse engineer what is in the dll, that is one reasons some functions are put in them, to protect the Intellectual Property, another is to encapsulate a bunch of functionality in a portable block, although yours only has three calls, so that isn't "a bunch".  
    Starting with the "peak_detect_dll.vi": this vi encapsulates a call to the s3livutils.dll, which appears to take a data array from a unit (S3?), pass in this data and parameters for a threshold level and minimum signal width (obviously, the vi's names agree with those of the dll). It returns an array of dbl's, which are apparently the detected peaks above the threshold, and a I32 giving the number of these peaks, which in the highest level vi is not used.  This information can be seen if you right click on the "call library function" in the peak_detect_dll.vi and select "configure".  Dll's are used like for a number of reasons, usually because there is an existing library call, written in another language, or a developer felt that the algorithm used was more efficient than native C. If you right click and select configure you will see (under the pulldown "Function name") that there is additional functionality contained in the dll that may (or may not) be used elsewhere in the program in another dll call.
    Not sure what exactly you need, but this is just a snippet of code that apparently finds peak values in the input array above some threshold.
    Message Edited by LV_Pro on 10-19-2009 08:42 AM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • 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.

  • How to call another class function in SharePoint?

    Facing 'ConvertViewToHtml' does not exit in current context. Here is my code:
    namespace ChangeControl3_Nov
    class eGA_Utility
    public static void SendmailwithTwo(string To, string subject, string Body, string frommail, byte[] docFile, byte[] docFile1, string fileName1, string fileName3)
    string smtpServer = SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address;
    string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;
    string smtpReplyTo = SPAdministrationWebApplication.Local.OutboundMailReplyToAddress;
    MailMessage mailMessage = new MailMessage();
    System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress(frommail, "Quality Management");
    mailMessage.From = from;
    mailMessage.To.Add(new MailAddress(To));
    mailMessage.Subject = subject;
    mailMessage.IsBodyHtml = true;
    mailMessage.Priority = MailPriority.High;
    mailMessage.Body = ConvertViewToHtml();
    MemoryStream stream = new MemoryStream(docFile);
    string fileName2 = fileName1;
    Attachment attachment = new Attachment(stream, fileName2);
    mailMessage.Attachments.Add(attachment);
    MemoryStream stream1 = new MemoryStream(docFile1);
    string fileName4 = fileName3;
    Attachment attachment1 = new Attachment(stream1, fileName4);
    mailMessage.Attachments.Add(attachment1);
    SmtpClient smtpClient = new SmtpClient(smtpServer);
    NetworkCredential oCredential = new NetworkCredential("", "");
    try
    smtpClient.UseDefaultCredentials = false;
    smtpClient.Credentials = oCredential;
    smtpClient.Send(mailMessage);
    catch (Exception)
    I would like to call "ConvertViewToHtml()" from FormCode.cs in this line: 
    mailMessage.Body = ConvertViewToHtml();
    namespace ChangeControl3_Nov
    public partial class FormCode
    public string ConvertViewToHtml()
    try
    byte[] sourceFile = null;
    XPathNavigator root = MainDataSource.CreateNavigator();
    string myViewName = this.CurrentView.ViewInfo.Name.Replace(" ", string.Empty);
    string myViewXslFile = myViewName + ".xsl";
    // Create the xsl transformer
    XslCompiledTransform transform = new XslCompiledTransform();
    transform.Load(ExtractFromPackage(myViewXslFile));
    // Generate a temporary HTML file
    string fileName = Guid.NewGuid().ToString() + ".htm";
    string filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), fileName);
    using (XmlWriter writer = XmlWriter.Create(filePath))
    // Convert the XML to HTML
    transform.Transform(root, writer);
    writer.Close();
    // Return the HTML as a string
    sourceFile = File.ReadAllBytes(filePath);
    return System.Text.Encoding.UTF8.GetString(sourceFile);
    catch (Exception ex)
    return "<html><body>Unable to convert the view to HTML <p>" + ex.Message + "</p></body></html>";
    How to do this? Thanks in advance!

    Hi Sam,
    According to your description, you might want to call a function from other class.
    Before calling this function, it will require to initialize a FormCode object and then we can call the functions of the FormCode class.
    You can take a look at the code snippet provided by tompsonn in this similar thread:
    http://www.overclock.net/t/1411342/calling-a-function-from-another-form-c
    More information about working with Partial Classes and Methods:
    http://msdn.microsoft.com/en-us/library/wa80x488.aspx
    Thanks 

  • How to call a class method from a jsp page?

    Hi all,
    i would like to create a basic jsp page in jdev 1013 that contains a button and a text field. When clicking the button, i would like to call a method that returns a string into the text field.
    The class could be something like this:
    public class Class1 {
    public String getResult() {
    return "Hello World";
    How do i go about this?
    Thanks

    Here is a sample:
    HTML><HEAD><TITLE>Test JDBC for Oracle Support</TITLE></HEAD><BODY>
    <%@ page import="java.sql.*, oracle.jdbc.*, oracle.jdbc.pool.OracleDataSource" %>
    <% if (request.getParameter("user")==null) { %>
    <FORM method="post" action="testjdbc.jsp">
    <H1>Enter connection Parameters</H1>
    <H5>Please enter host name:</H5><INPUT TYPE="text" name="hostname" value="localhost" />
    <H5>Please enter port number:</H5><INPUT TYPE="text" name="port" value="1521" />
    <H5>Service nanme:</H5><INPUT TYPE="text" name="service" value="XE" />
    <H5>Please enter username: </H5><INPUT TYPE="text" name="user" />
    <H5>Please enter password</H5><INPUT TYPE="password" name="password" />
    <INPUT TYPE="submit" />
    </FORM>
    <% } else { %>
    <%
    String hostName = request.getParameter("hostname");
    String portNumber = request.getParameter("port");
    String service = request.getParameter("service");
    String user = request.getParameter("user");
    String password = request.getParameter("password");
    String url = "jdbc:oracle:thin:" + user + "/" + password + "@//" + hostName + ":" + portNumber + "/" + service;
    try {
    OracleDataSource ods = new OracleDataSource();
    ods.setURL(url);
    Connection conn = ods.getConnection();
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();
    // gets driver information
    out.println("<TABLE>");
    out.println("<TR><TD>");
    out.println("<B>JDBC Driver version</B>");
    out.println("</TD>");
    out.println("<TD>");
    out.println(meta.getDriverVersion());
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR><TD>");
    out.println("<B>JDBC Driver Name</B>");
    out.println("</TD>");
    out.println("<TD>");
    out.println(meta.getDriverName());
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR><TD>");
    out.println("<B>JDBC URL</B>");
    out.println("</TD>");
    out.println("<TD>");
    out.println(meta.getURL());
    out.println("</TD>");
    out.println("<TABLE>");
    conn.close();
    } catch (Exception e) {e.printStackTrace(); }
    %>
    <%-- end else if --%>
    <% } %>
    </BODY>
    </HTML>

  • How to call derived class to base class

    Hello everybody,
    I create a GUi application in java swing. Now i want to navigate between the screen but the timing between the screen is very slow bcoz i imported the class from package to another package. Now i want to extends one package to another package to reduce the navigation time but it saying error bcoz i cant able to call my derived class to base class. if anyone know the answer for this please answer this immediately.
    If any other method is there to optimise the navigation time please tell me
    by
    (kamal)

    Sorry, I've got major difficulties understanding your query:
    I create a GUi application in java
    ication in java swing. ok
    Now i want to navigate between
    the screenwhat? switch screens? display a different dialog?
    but the timing between the screen is very
    slowtiming? do you mean the time it takes to display a different dialog?
    bcoz i imported the class from package to
    another package.how did you come to the conclusion that that is the reason for the slowness? Did you do any profiling or is this just guess-work?

  • 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()

Maybe you are looking for