Access variables across classes.

I have been banging my head on my desk for a little while on this one so any help would be awsome.
What I am trying to do is pull data from an XML file so that I can store paramaters for my FLV player (i.e. flv link, dimensions, video name, etc) I can get the data from the XML file and story it in a dictionary but I am unable to access the data from my main class. I know it has to be something pretty simple but I think i have been looking at it to long to see it.
// Main.as
package includes.action
    import fl.video.FLVPlayback;
    import flash.display.*;
    import flash.events.*;
    import flash.net.URLLoader;
    import flash.utils.Dictionary;
    import includes.action.XMLData;
    public class Main extends Sprite
        public var vidSrc:String = "mortgage";
        public var xmlPath:String = "includes/flash/videos.xml";
        public var elements:XMLData;
        private var videoXML:Dictionary;
        // Constructor
        public function Main():void
            //vidSrc = vid;
            //xmlPath = xmlP;
            this.getMovie();
        public function getMovie()
            var vidoes:XMLData = new XMLData(xmlPath,vidSrc);
            videoXML = vidoes.VideoAttributes;
            trace("VIDOEXML COUNT: " + videoXML.length);
            var link:String = vidoes.getVA("name");
            elements = vidoes.getVA("name");
            trace("ELEMENTS: " + elements);
            trace("MAIN:LINK: " + link);
// XMLData.as
package includes.action
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.*;
    import flash.utils.Dictionary;
    import includes.action.Main;
    public class XMLData
        // Public Vars
        public var VideoAttributes:Dictionary;
        // Private Vars
        private var pXmlPath:String;
        private var pXmlVidSrc:String;
        private var sXMLData:String;
        private  var xmlLoader:URLLoader;
        private  var xmlData:XML;
        // Constructor
        public function XMLData(xmlPath:String, xmlVidSrc:String)
            this.pXmlPath     = xmlPath;
            this.pXmlVidSrc = xmlVidSrc;
            this.xmlLoader  = new URLLoader();
            this.xmlData      = new XML();        
            this.VideoAttributes = new Dictionary();
            xmlLoader.addEventListener(Event.COMPLETE, this.LoadXML);            
            xmlLoader.load(new URLRequest(this.pXmlPath));
        public function getVA(param:String)
            //trace("Request: " + param + " :: " + VideoAttributes[param]);
            return VideoAttributes[param];
        public function LoadXML(e:Event) {
            this.xmlData = new XML(e.target.data);
            this.sXMLData = this.xmlData.toString();
            parseXML(this.xmlData);
        public function parseXML(inputXML:XML):void
            trace("==============");
            trace(this.sXMLData);
            trace("==============");           
            for(var i=0; i < inputXML.videos.videoname.length(); i++)
                if(inputXML.videos.videoname[i].@name == this.pXmlVidSrc)
                    // attributes of the video tag
                    var InputAttributes:XMLList = inputXML.videos.videoname[i].attributes();
                    // child nodes of this tag
                    var InputChildren:XMLList     = inputXML.videos.videoname[i].children();
                    // collect attributes to an array
                    // Set Attribute Name and Value
                    for each (var attr:XML in InputAttributes) {
                        var elementname:String = attr.name();
                        this.VideoAttributes[elementname] = attr.valueOf().toString();
                      for(var x:int = 0; x < InputChildren.length(); x++)
                          var childelement:String;
                          var ChildrenAttributes:XMLList = InputChildren[x].attributes();
                          for each(var cattr:XML in ChildrenAttributes)
                              childelement = InputChildren[x].name() + "-" + cattr.name();
                              this.VideoAttributes[childelement] = cattr.valueOf().toString();
basically with all my traces this is what I get back...
// Trace data
VIDOEXML COUNT: undefined
ELEMENTS: null
MAIN:LINK: null
We are in LoadXML
name - no get: mortgage
name - get: mortgage
The trace for Elements and Main:Link should give me back the name of the video but as of yet its either returning NULL or undefined.

Thank you so much you don't understand how much my forehead thanks you.. Adding the dispatch and the listener worked great..
Guess its time for me to read a bit more before I continue.. Again thank you.

Similar Messages

  • How to access variables across JSP and JavaScript?

    Hi,
    I have some .js files and in those files, some of the methods need to access to the variables that I'd declare in the jsp files. How do I do it?
    Anne

    You can do it this way, but I'm not sure if this is what you had in mind.
    Say you had a java variable called XString. And you wanted to display
    the value of XString in a javascript Alert. Here's how:
    <html>
    <body>
    <% String XString = "Hi There!"; %>
    </body>
    <script language="javascript">
    alert("<%=XString%>");
    </html>Hope This Help,
    P.

  • Accessing variable across User Exit (i.e. across function pools)

    Hi,
    I have writen a user exit for MB31 transaction. Which uses following function modules...
    EXIT_SAPLIPW1_001
    EXIT_SAPLIPW1_004
    EXIT_SAPLIE01_005
    EXIT_SAPMM07M_001
    First three functions belongs to XQSM function group and last function fuction belong to XMBC function group.
    I have two top includes, ZXQSMTOP for first 3 and
    ZXMBCTOP for the last one.
    I am not able to access the variables declared in ZXMBCTOP in the first 3 functions...
    (I am using EXIT_SAPMM07M_001 only to get the posting date.)
    How to do it?
    Advance thanks.
    Regards,
    Balaji Viswanath.

    Hi,
    there are several ways to achieve this.
    a) export the variables to a parameter using set/get parameter
    b) export the variables to a memory using export/import to/from memory
    c) create your own fm and pass the values to the fm, post it to the global memory of your fm and in the other exits, get from the global memory of your fm.
    Hope this helps
    regards
    Siggi

  • How do I access variables across threads.

    I am calling a custom callback from TestStand which is kicked off by the user clicking on a User Interface button.   I am running in Batch Mode and would like to get the index of the execution the user is viewing at the time he/she clicked on the button.   I have tried it seems like every RunState variable and TestStand API with no success.  How are you supposed to get information from parallel threads in TestStand?

    TestStand Already provides a Terminate function.  This is what you get when you Left mouse click on the TestSocket Execution Icon them immediately right-mouse click and select Terminate.   I tie into this fuctionality with my customized Operator Interface in C# I put a call back on the Terminate button click. 
    I would like for this event to notify me on the specific TestSocket Thread that is being executed for some critical things to take place before the Thread is actually terminated.
    This is the events I would like to take place:
    1) User runs test sequence in batch mode.
    2) Thread run normally.
    3) User decides he/she wishes to stop testing on 1 or all UUTs.
    4) User Clicks on either Terminate single or Terminate all.
    5) Software point of view a Callback occurs allowing for critical processing to occur before actual thread is stopped.
    6) Thread or Threads is/are stopped.
    All this takes place in TestStand 4.0 now except for step 5.   I customized the Operators User Interface to do an execution callback into the model before the thread is fully terminated.  This call works asynchronously as desired.  It calls the execution entry point into my BatchModel as desired.  If I present a popup asking for the TestSocket he/she is wishing to terminate then I can do this processing to the UUT as desired.   However is his/her response does not agree with what was selected on the Operator Interface GUI then my stuff runs on 1 TestSocket and yet another TestSocket is actually stopped.

  • Access variables in Package.

    Hi I have a apackage called share.server , in which I have defined
    Hashtable hash;
    i have another file in share package as Impl, here i want to call the "hash"
    how can i access the same "hash" in Impl.java from FilServer which is in share.server package.
    Please respond urgent, assignment is due soon.
    Thanks for any response.

    what?!
    variables belong to classes, not packages. If you want to access variables between classes you need to define some kind of public interface for them (getters and setters... ring any bells?). This is basic basic OOP, and is called encapsulation. First thing you need to do is get a basic 'OOP with java' type book and read it fully. We can't help you if you can't help yourself/

  • Local variable can't be accessed from inner class ???????? Why ??????

    Plesae help, help, help. I have no idea what to do with this bug.........
    <code>
    for ( int i = 0; i <= 2; i++ ) {
    for ( int j = 0; j <= 2; j++ ) {
    grids[i][j] = new MyButton ();
    grids[i][j].setBorder(but);
    getContentPane().add(grids[i][j]);
    MyButton sub = grids[i][j];
    sub.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if ( sub.getState() == 0 ) {
         sub = new MyButton( (Icon) new ImageIcon(imageFile));
         if ( imageFile.equals("cross.jpg") ) {
              sub.changeState(1);
         else {
              sub.changeState(2);
    </code>
    The compiler complains that "sub" is in the inner class, which is the ActionListener class, must be declared final. Please tell me what to do with it. I want to add an ActionListener to each MyButton Object in the array. Thanks ......

    OK, now I changed my code to this :
    for ( int i = 0; i <= 2; i++ ) {
      for ( int j = 0; j <= 2; j++ ) {
        grids[i][j] = new MyButton ();
        grids[i][j].setBorder(but);
        getContentPane().add(grids[i][j]);
        grids[i][j].addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            if ( grids[i][j].getState() == 0 ) {
               grids[i][j] = new MyButton( (Icon) new ImageIcon(imageFile));
              if ( imageFile.equals("cross.jpg") ) {
               grids[i][j].changeState(1);
              else {
              grids[i][j].changeState(2);
    [/cpde]
    Thanks for your advice !!!!!!
    Now the compiler says that i and j are local variables accessed from inner classes, needs to be declared final. How can I solve this then ???

  • Access variables within a timer

    How can I access variables within a timer?
    I mean variables, that I can use in another class that extends applet i.e.?

    The Code can be compiled now with the Java Compiler.
    But the image won't move on the screen.
    import java.applet.*;
    import java.awt.*;
    import java.util.*;
    public class ChangingApplet extends Applet {
      private Image EricsBild;
      private int x,y;
      private TimerTask update;
      public void start() {
      EricsBild = getImage(getCodeBase(), "heuschrecke.gif");
      x=5;y=5;
        update = new TimerTask() {
          public void run() {
            if (x<300) x++;
            if (y<200) y++;
            if (x>3) x--;
            if (y>2) y--;
            repaint();
        Timer t = new Timer(false);
        t.schedule(update, 1000, 1000);
      public void stop() {
        update.cancel();
      public void paint(Graphics g) {
        g.drawImage(EricsBild,x,y,this);
    }

  • How to access variables outside user exit

    Hi,
    I'm working with a user exit and my problem is that in a particular moment I have to access variables located outside the scope of the user exit (they are in a standard program)
    How can I reach these variables?
    thanks in advance

    Hi,
    If they are global variables then you can access them using Global assign technique,
    For example,
    FIELD-SYMBOLS: <fs_value> TYPE ANY.
    ASSIGN ('(SAPMV45A)XVBAK') TO <fs_value>.
    It is basically,
    ASSIGN ('(<Std. Program Name>)<Variable name>') TO <field symbol>.
    NOTE: To make sure they are accessible in your user exit, just put a break-point in the user exit and once you are there in debugging, type in,
    (<Std. Program Name>)<Variable name> in the Field names section and if it does not show it in RED then it is accessible..
    Hope this helps.. 
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • How to Access Variables defined in the PopUpWindow

    Hi Friends
    I am building a flex site using flex builder 2.....
    Here I need your help.....
    My Problem is how to store a variable from a popup window
    I have this problem while in the login window comes as popup
    while clicking login button in the page a popup where user
    can enter username and password...
    after submitting if the login is successufl the popup
    vanish...
    After a successful login I need to store the logged user name
    in the main index page but I am not able to store
    At first I created a variable 'loggedUsername' in the popup
    panel and after success log i assigned the username to it ... after
    it i am not able to get the loggedUsername..
    doubting I defined the variable in the main index.mxml page
    but this variable is not accessible from the loginwidow.mxml page
    where the popup will function...
    Heip me
    how to store the name if the user login is success..
    thanks
    Chintu...

    Lets say you have a public property in your application like
    public var name:String = "John Smith";
    to access this using an inline item renderer:
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox>
    <mx:TextInput text={outerDocument.name} />
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    To access variables of the applicaton you can use
    Application.application.name (for example) to reference "global"
    variables, so you might also use this technique. With an inline
    item renderer, the outerDocument property will refer to the
    component which contains the renderer.

  • How to access variables declared in main mxml in itemrenderer files

    Hi,
    I have a main mxml which has a cutomRenderer that defines two
    mxml components
    namely raidobutton and textinput.
    Now in this TextInput.as i need to access variable defined in
    main mxml.
    Please suggest a way.
    Thanks,
    Lucky

    Lets say you have a public property in your application like
    public var name:String = "John Smith";
    to access this using an inline item renderer:
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox>
    <mx:TextInput text={outerDocument.name} />
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    To access variables of the applicaton you can use
    Application.application.name (for example) to reference "global"
    variables, so you might also use this technique. With an inline
    item renderer, the outerDocument property will refer to the
    component which contains the renderer.

  • Cannot access Graphics - bad class file

    Hey.
    When I try to compile my source I get an error saying...
    .\Man.java:146: cannot access Graphics
    bad class file: .\Graphics.java
    file does not contain class Graphics
    Please remove the files or make sure it appears in the correct subdirectory.
    It's on a different computer so that's not exactly it, but it's close enough. Compiler was working fine until the other day when i found out that all the source files were zipped up in src.zip, I had to extract Graphics.java so I could open it in emacs, and after I did that it started giving me that error message. There's nothhing wrong with my source, and I didn't move Graphics, it's still in the correct place exactly as it was, and i looked at it, all the right stuff is still inside. I'm quite confused.
    So do I have to reinstall? That would mean a massive download on my 56k and I kinda wanna carry on with my work.

    You should not need to unzip src.zip to use the Graphics class or any class that comes with j2sdk. The compiled classes are in jar files that are installed in certain directories when you install the j2sdk.
    You should only need to have a line "import java.awt.Graphics;" near the start of your source code.
    The error most likely occurred when the compiler found a Graphics.class file but inside the file is java.awt.Graphics class, not a plain Graphics class.

  • Why eclipse gives me warning if I access in inner class a parent  field ?

    I have a class
    class A{
    private Map fValues;
    A(){
    fValues= new HashMap();
    prrotected class B {
    B(){
    fValues.get("String");
    Above class is only for an example to expalin my problem.
    Inner class B wants to access fValues from class A .
    The eclipse gives me a warning
    Access to enclosing method fValues from the type A is emulated by a synthetic accessor method. Increasing its visibility will improve your performance
         I order to get rid of this warning I must make fValues public is this the only solution ?
    miro

    miro_connect wrote:
    I have a class
    class A{
    private Map fValues;
    A(){
    fValues= new HashMap();
    prrotected class B {
    B(){
    fValues.get("String");
    Above class is only for an example to expalin my problem.
    Inner class B wants to access fValues from class A .
    The eclipse gives me a warning
    Access to enclosing method fValues from the type A is emulated by a synthetic accessor method. Increasing its visibility will improve your performance
         I order to get rid of this warning I must make fValues public is this the only solution ?
    miroWhat happens if you remove the modifier? (That is uses default)

  • Can't access variables in specific S7-1200 DB's in LabVIEW project

    Hi all,
    I'm trying to establish a connection between LabVIEW and a Siemens S7-1200 though Ethernet and SIemens OPC Server.
    The physical connection is OK (I can ping S7-1200 with no problem).
    When I needed to access variables from specifics DB's inside S7-1200 ( I want to access variable DB190,X0.4), I called Siemens support and they said I had to modify the variable's definition when using OPC Scout, from "MX0.4" to "DB190,X0.4", and then it was possible to access this variable.
    Same solution (renaming the path) applies to NI OPC Client, I can read and write variables properly.
    My problem is that when I try to add variables in LabVIEW Project, I can't find those variables whose address were modified, so I can't access the correct variable in my program.
    I tried to change the variable path in Multiple Variable Editor, but it doesn't work either.
    Any suggestions on what I can try??

    First: Avoid the ODBC/JDBC Bridge if at all possible.
    It's the worst JDBC driver I've ever seen. It's buggy
    and a great hindrance both to learning and to
    producing usefull code.I agree that there might be problems with M$ Access, but there are problems with all databases, including MySQL (e.g., no referential integrity in free download version). It's capable enough for the query the OP is trying to execute.
    The problem is with his code, not Access or the bridge driver. He'll go through a lot of effort to switch databases and still have this problem. Better to understand what HE'S done wrong and fix it so he'll do it correctly for all databases, including Access.
    You just need to be more careful with your query, I'm sure.
    %

  • Accessing a Java class from C when class is in a package

    I'm accessign a java class from C using JNI: The JVM exists and I can access the class fine:
    jclass cls; //java class
    cls = (*env)->FindClass(env, "MyClass");
    However when I put the class in a package I can't access it
    cls = (*env)->FindClass(env, "mypackage.MyClass");
    Does anyone know How I can access a java class in a package using JNI.
    Thanks
    ..

    Been a while since I've done anything with JNI, But... Did you try this:
    cls = (*env)->FindClass(env, "mypackage/MyClass");

  • How share variables between classes ???

    Hi !
    Basically I have two classes and I would like them to share a variable, I mean, when I modify it on one class the other one is also affected.
    how can I do that ? by using the inheritance principle or is it a simple way so that we don't have one more class??
    thank you a lot for your answer !
    PA

    If you want them to always have the same value, you should have only one variable:public class ClassOne
      private static int theVar = 0;
      public static void setTheVar(int value){theVar = value;}
      public static int getTheVar(){return theVar;}
    public class ClassTwo
      public static int getTheVar(){return ClassOne.getTheVar();}
    }

Maybe you are looking for

  • Dynamic INSERT from associative array

    Ok, this would be an one-liner in python or perl, but as a newbie in PL/SQL, it feels like swimming in molasses. So before going on and reinvent the wheel, is there any builtin or sample code that generates dynamically an insert statement from a hash

  • DB_Release_Unknown -ABAP Dump

    Hi, I was upgraded my DB(oracle) from 9.2 to 10g when i am running DB02 transaction i am getting an ABAP Dump called "DB_Release_Unknown" please help me in solving this dump error.

  • How to deploy a JSP page into my APEX application?

    hi all, i am using a JSP to upload multiple spreadsheets into the db. i want to deploy it on the APEX and use it as part of my APEX application's uploading feature. i already have the JSP file with me. can somebody please tell me how to put that onto

  • Current sold macbook pro's- is the GPU fixed?

    Hi, as you all know there is this pesky problem with the nvidia GPU in the Macbook Pro (vertical lines, detected as X3100 and then dying). Does anyone know if the currently sold Macbook Pros's from recent inventory still have that problem? Is it fixe

  • Can I set a password that can be used to open my ipad?

    I want to have a password that will be required to open my ipad to the desktop.  Can it be done?