Main method hangs setting static variable

I have a very annoying intermittent problem. Once in a while (roughly 1 out of 30 times), my app hangs in the main method when assigning a value to a static variable.
public static void main(String[] args) {
//read args
//do some very trivial stuff (never hangs here)
someOtherNonStaticClass.aStaticInt = 100;//once in a while it hangs here???
}I have tried setting "-Dsun.java2d.noddraw=true" but this hasnt helped. I have tried using JRE 1.4.1 and 1.4.2 and they both have this problem. Some machines seem to be worse than others but this may just be chance.
When the app hangs, it appears in task manager as a javaw.exe process, but the app itself doesnt appear.
Does anyone have any ideas or suggestions for me to try? Its pretty annoying not have a stack trace to work with.

I have tried setting "-Dsun.java2d.noddraw=true" butWhy should it?
this hasnt helped. I have tried using JRE 1.4.1 and
1.4.2 and they both have this problem. Some machines
seem to be worse than others but this may just be
chance.
When the app hangs, it appears in task manager as a
javaw.exe process, but the app itself doesnt appear.That's normal. All Java apps would appear as javaw.exe. Because the JVM has the process.
Does anyone have any ideas or suggestions for me to
try? Yes. Stop accessing fields of another class. It's bad design to begin with, and it looks to me like you're breaking something someplace else by setting that value to 100 right then.

Similar Messages

  • Best practices for setting environment based static variables?

    I have a set of static string variables that hold the url location of modules in a project. These locations change depending on whether I'm building for development, staging or production.
    What's the best way to set static variables in this way?

    I don't know if this is best practice, but here's the solution I've come up with.
    The root domain is accessible within the swf via a node on a loaded xml file. So I created a simple method that sets a url variable based on that domain node.
    The domain-based url variable is then used within the static string variables that define the location of the modules.
    Simplified like so:
    var domain:String = xml.node.value;
    static var bucketLocation:String = getLocation()
    static var moduleLocation:String = bucketLocation + "modulename.swf";
    function getLocation():String
         var loc:String
         switch (domain) {
              case stagingUrl:
                  loc = "pathToAmazonStagingBucket";
                   break;
              case productionUrl:
                   loc = "pathToAmazonProductionBucket";
                   break;

  • How to run executable Java app from command line: No Main( ) method

    This is the opposite question from what most users ask. I have the Java source code and a running Java executable version of the program in a windows environment. I don't want to run it in the normal way by double-clicking on it or using the executable. I need to be able to run the same application from the command line. If I can do this, I can then compile and run the code on my Mac, too, which is what I am ultimately trying to accomplish.
    Normally, this would be easy. I would look for a Main method, normally public static void main (String[] args ) or some variation. I cannot find a main() anything, anywhere when searching the files. There must be some windows executable that links to the Java classes. It's very clever, no doubt, but that's not helping me.
    I am trying to run what I can determine as the Main class, with a standard command line call, but that is not working either.
    It is a Java graphics program, so mostly Swing container stuff.
    I am not finding a manifest.txt file, telling me where a main method is, nor anything about the Main Class. There is no readme file for the program.
    Any insight that would point me in the right direction? What should I be looking for?
    Thanks in advance, Bloozman

    It's possible there's a clever Windows executable that runs the class. But if it's a plain old Java class then there's a good chance there's a constructor. Look for that; it's possible you may be able to start by writing another Java class that creates an instance of your mystery class.
    When you have that done, try running it. It's possible that just creating an instance might be sufficient to run it. Swing programs are sometimes written like that. If not, then start looking for methods with names like "run" or "go" or "start" that your little controller program can call.

  • Can users call main method??

    class MainDemo{
    public static void main(String args[]){
    System.out.println("First main method");
    MainDemo.main("hello");
    }Hi all,
    Why is the above code not compiling??

    By adding few lines right after the System.out.println("First main method");.
    class MainDemo
         public static void main(String args[])
              System.out.println("First main method");
              System.out.println("No.of args : " + args.length);
              if (args.length > 0)
                   System.out.println("Passed in : " + args[0]);
              System.out.println();
        static
             String args[] = {"hello"};
             MainDemo.main(args);
    }And the output gives :-
    First main method
    No.of args : 1
    Passed in : hello
    First main method
    No.of args : 0
    Press any key to continue...
    Why is it JVM executes the main() method in the static block instead of the calling the main() method (without argument) directly ?
    Edited by: TKH on Nov 14, 2007 1:08 AM

  • Set Presentation variable using external Javascript?

    I want to create a user defined filter using custom java-script drop-down and wish to set a presentation variable on the dashboard. I have looked into various JS files to find the method for setting a presentation variable but have failed badly. If there is a way to set this variable please do help me out.
    thanks in advance
    ~V
    Edited by: user4555163 on Mar 9, 2011 5:42 PM

    Provide js-library you found and method for setting pres. variables and your custom js code.

  • Does main method have to be static? Is there a way to go around it?

    I am trying to write a class that will recursively walk through directory listing of a given ftp adress and store it in a text file in this format:
    <path> , DIR // if directory
    <path> , file // if file
    Since I am not yet experienced to do my own socket programming(tried and did not work out) I used Secure iNet Factory's library. And since I will be running multiple instances of this class I concluded that my fields and methods should not be static. Here is the class I wrote:
    import com.jscape.inet.ftp.Ftp;
    import com.jscape.inet.ftp.FtpException;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.net.URL;
    import java.util.Enumeration;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    public class test {
         private String path = "/";
         private String name;
         private String adres;
         // create new Ftp instance and connect.
         public test(String Name, String Adres) throws IOException {
              name = Name;
              adres = Adres;
              System.out.println("Test class: " + name);
              try {
                   Ftp ftp = new Ftp(adres,"anonymous","anonymous");
                   ftp.connect();
                   Enumeration e = ftp.getDirListing();
                   iterate(path, ftp);
                   ftp.disconnect();
              catch (FtpException ex) {
                   Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
         void iterate(String aStartingDir, Ftp ftp) throws FtpException, IOException {
              //Set the path.
              path = path + aStartingDir + "/";
              // Change directory.
              ftp.setDir(aStartingDir);
              // Iterate through directory list.
              Enumeration e = ftp.getDirListing();
              while(e.hasMoreElements()){
                   Object f = e.nextElement();
                   // Recursive call if item is directory.
                   if(f.toString().startsWith("drwxrwxrwx") &&
                        // Ignore "." and ".."
                        !f.toString().substring(55).trim().equalsIgnoreCase(".") &&
                        !f.toString().substring(55).trim().equalsIgnoreCase("..")) {
                        // Write to index file.
                        URL dirUrl = FtpCheck.class.getResource("./index/"); // get the directory.
                        URL fileUrl = new URL(dirUrl, name + ".txt"); // construct the file path.
                        String filePath = fileUrl.getPath().replaceAll("%20", " "); // fix spaces.
                        BufferedWriter file = new BufferedWriter(new FileWriter(filePath,true));
                        file.write((path + f.toString().substring(55).trim()).substring(3)
                             + ",DIR\n");
                        file.close();
                        iterate(f.toString().substring(55).trim(),ftp);
                   // Skip entries "." and ".."
                   else if (f.toString().substring(55).trim().equalsIgnoreCase(".") ||
                             f.toString().substring(55).trim().equalsIgnoreCase("..")) {
                             continue;
                   // Add files to the index.
                   else {
                        URL dirUrl = FtpCheck.class.getResource("./index/"); // get the directory.
                        URL fileUrl = new URL(dirUrl, "index.txt"); // construct the file path.
                        String filePath = fileUrl.getPath().replaceAll("%20", " "); // fix spaces.
                        BufferedWriter file = new BufferedWriter(new FileWriter(filePath,true));
                        file.write((path + f.toString().substring(55).trim()).substring(3)
                             + ",file\n");
                        file.close();
              // End of listing reached, go one directory up.
              ftp.setDirUp();
              // And remove the last directory name from path.
              path = path.substring(0,path.lastIndexOf("/"));
              path = path.substring(0,path.lastIndexOf("/")) + "/";
    }which compiles fine.
    Here is the class that invokes it:
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author Sentinel
    public class NewClass {
         public NewClass() {
         public static void main(String args[]) throws MalformedURLException, FileNotFoundException, IOException {
              index t = new index("El Naga","elnaga.sytes.net");
              t.start();
              index t1 = new index("Afacan","afacan.myftp.org");
              t1.start();
         public class index extends Thread {
              String name;
              String adres;
            public index(String Name,String Adres) {
                name = Name;
                adres = Adres;
            @Override
            public void run() {
                try {
                    test checker = new test(name,adres);
                catch (IOException ex) {
                     Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
    }when I hit run build fails:
    init:
    deps-jar:
    Compiling 1 source file to C:\Documents and Settings\Sentinel\My Documents\NetBeansProjects\ftpCheck\build\classes
    C:\Documents and Settings\Sentinel\My Documents\NetBeansProjects\ftpCheck\src\NewClass.java:19: non-static variable this cannot be referenced from a static context
                    index t = new index("El Naga","elnaga.sytes.net");
                              ^
    C:\Documents and Settings\Sentinel\My Documents\NetBeansProjects\ftpCheck\src\NewClass.java:20: non-static variable this cannot be referenced from a static context
                    index t1 = new index("Afacan","afacan.myftp.org");
                               ^
    2 errors
    BUILD FAILED (total time: 0 seconds)I (now)know that main method has to be static. I'm stuck and in need of help to overcome this obstacle. Is there a way to do this?

    a stab in the dark, but what if you make index a non-internal class. make it a stand-alone class in it's own file. Either that or make it a static inner class (almost the same thing).
    Your problem is that an inner class needs an instance of the outer class to start on, and you're not doing this. Another solution would be to do this kludge:
    index t = new NewClass().new index("El Naga","elnaga.sytes.net");  // I think this is how to call itBut again better is to make index a stand-alone class.
    Edited by: Encephalopathic on Oct 28, 2008 8:06 AM

  • Static main methods and run()

    I am having trouble with main methods, and how to structure code, im not 100% sure on what static methods are, and im not sure how to use it when calling other methods etc cos its static and stuff - i read that i should put stuff in the constructor - but im not sure how this will work with a run()
    I have written a program to draw some objects (just an oval at a certain position)
    anyway here is the main method:
    public static void main(String[] args) {
            // TODO code application logic here
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    Main game = new Main();
                    game.createAndShowGUI();
                    //Create some graphics objects at the desired position!
                    GOA[0] = new GraphicsObject(300,200);         *
                    GOA[1] = new GraphicsObject(350,200);         *
                    game.frame.updateGraphics(GOA);            *
        }I am getting "non-static variable GOA cannot be referenced from a static context" at * i cant just make everything static, how should this be structured? where should the run() be?
    Thanks for any help

    Ok, i might as well include the whole thing - its not too big , and i would like to see if any of it is right really.
    ackage joefootball2;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferStrategy;
    public class Main {
        GameWindow frame;
        //Create the graphics object array to pass to the painting stuff
        GraphicsObject[] GOA;
        private void createAndShowGUI() {
            //Create and set up the window.
            frame = new GameWindow();
            frame.DrawWindow();
        public static void main(String[] args) {
            // TODO code application logic here
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    Main game = new Main();
                    game.createAndShowGUI();
                    //Create some graphics objects!
                    GOA[0] = new GraphicsObject(300,200);
                    GOA[1] = new GraphicsObject(350,200);
                    game.frame.updateGraphics(GOA);
    class GameWindow extends JFrame
        DrawPanel canvas;
        public void updateGraphics(GraphicsObject[] GOA)
            canvas.updateObjects(GOA);
        public void DrawWindow()
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            canvas = new DrawPanel();
            canvas.setDoubleBuffered(true);
            this.getContentPane().add(canvas);
            this.setVisible(true);
            this.setSize(800, 600);
            this.setResizable(false);
    class DrawPanel extends JPanel
        //Create the graphics object array to draw
        GraphicsObject[] GOA;
        public void updateObjects(GraphicsObject[] givenGOA)
            GOA=givenGOA;
        public void paint(Graphics g)
            for (int i=0 ; i<GOA.length ; i++)
                g.drawOval(GOA.x-5, GOA[i].x-5, 10, 10);
    class GraphicsObject
    //for now, just make the graphics object a point to draw a circle
    int x; int y;
    }thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When is the inteface variable in an EJB mains method initiated?

    hI,
    the code bellow is part of a simple EE 6 example from Yuri Vasilievs book Beginning Database-Driven...
    Can somone tell me when the variable customerSession bellow will be initiated in the CustomerSessionClient class bellow.
    When I run theCustomerSessionClient (main methode) in my netbeans environment the customerSession is allways null?
    Bellow first the inteface class and then the CustomerSessionClient class
    package ejbjpa.client;
    import javax.ejb.Remote;
    * @author xxx
    @Remote
    public interface CustomerSession {
    public String getCustomerAddress(Integer customer_no);
    import ejbjpa.ejb.CustomerSession;
    import javax.ejb.EJB;
    * @author xxx
    public class CustomerSessionClient {
    @EJB
    private static CustomerSession customerSession;
    public static void main(String[] args){
    System.out.println("Billing address of the customer whose id is: "+customerSession.getCustomerAddress(1));
    Brg
    Javanalle
    Edited by: 873848 on Jul 20, 2011 8:56 PM

    Can somone tell me when the variable customerSession below will be initiated in the CustomerSessionClient class below.It will never be initialized.
    When I run theCustomerSessionClient (main method) in my netbeans environment the customerSession is always null?I agree.
    That's just a command-line client. It doesn't execute in an EJB container, so the @EJB annotation never takes effect.

  • Setting static IP with computer variables with ConfigMgr 2012 R2 + MDT 2013?

    Hi!
    So im trying to set static IP with computer variables in ConfigMgr 2012 R2 with MDT integration. Does not seem to work as expected, after installation it has DHCP enabled.
    This is my config:
    ZTINicConfig.log
    <![LOG[Property ForceCapture is now = ]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[Microsoft Deployment Toolkit version: 6.2.5019.0]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[The task sequencer log is located at X:\WINDOWS\TEMP\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log.]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[ZTINicConfig Script Entered.]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[ PHASE = ]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[ Deployment Method = SCCM]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[ Deployment Type = NEWCOMPUTER]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[Capture Network Settings from local machine and write to Environment.]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[Query networking adapters...]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[Networking Adapters found! Count = 1]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[Property OSDAdapterCount is now = 0]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    <![LOG[ZTINicConfig processing completed successfully.]LOG]!><time="14:18:29.000+000" date="03-19-2015" component="ZTINicConfig" context="" type="1" thread="" file="ZTINicConfig">
    And I can't find any of the variables specified in ZTIGather.log. Do they only work with pure MDT or in CS.ini ?
    Any Ideas ?
    Thanks!

    Many methods to achieve the same. I've done something similar once with a small PowerShell script like this:
    http://www.petervanderwoude.nl/post/setting-a-static-ip-address-during-a-deployment-via-powershell-and-configmgr-2012/
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • How to import files with static variables into a block with methods?

    i have a problem. is it possible to import files with static variables into tags like
    <%!
    //here i want to import a file named settings.inc
    //whitch is used to set jdbc constants like url,driver,...
    private void method() {
    private void method2() {
    %>
    <%@include file="xy"%>//dosn�t work above
    //only in <%%>tag

    This should be done using either the Properties class or ResourceBundle. Ex.
    <%
    ResourceBundle resBun = ResourceBundle.getBundle(String resource);
    String username = resBun.getString("username");
    String password = resBun.getString("password");
    // etc
    %>

  • Pb to get a static variable value from an main program...

    Hi my lifegards !
    I am not a king of java and I thing I need explication about the way to get static values from an other class throw a method...
    here is my objects :
    CapturesBuffer(class extends canvas)
    static int nbCapts...
    public getNbCapts() return nbCaptsSendCapture (servlet)
    "captures = new CapturesBuffer();" in init()
    captures.getNbCapts(); return the good number of capturesSendToPD (program with static void main())
    "captures = new CapturesBuffer();" in constructor
    new SendToPD() in main(String args[])
    captures.getNbCapts(); return a bad value (the initial value)I hope it's anderstandable..:-)
    I have try to instance SendToPD object in the servlet (not to use the main method) and it is working !
    For me it's coming from main method. Am I wrong ?
    And more useful, what is the solution (I hope and I am sure there is one...)
    Thanx a lot and I wish u and happy year with all forms of java
    Guillaume.

    I didn�t understand very weel your aims neither why it is Thread extended .. but, anyway, here comes my guess:
    //package cicv.hatefulworld.server;
    public class DataPict implements Runnable
         private volatile Thread activeInstance = null;
         public void start()
              activeInstance = new Thread(this);
              activeInstance.start();
         public void stop()
              activeInstance = null;
         public void run()
              CapturesBuffer captures = new CapturesBuffer();
              Thread thisInstance = Thread.currentThread();
              try
                   while (activeInstance == thisInstance)
                        int nb = captures.getNbCapt();
                        System.out.println("number of captures: " + nb);
                        thisInstance.sleep(1000); // waiting 1 second
              catch (InterruptedException threadError)
                   System.out.println("Thread error:");
                   threadError.printStackTrace();
              catch(Exception generalError)
                   System.out.println("General error:");
                   generalError.printStackTrace();
              finally
                   captures = null;
                   thisInstance = null;
         public static void main(String[] args)
              (new DataPict()).start();
    class CapturesBuffer
         private int numberOfCaptures = 0;
         public int getNbCapt()
              // I don�t know exactlly what this method is designed for..
              // then I just coded a counter ...
              return numberOfCaptures++;
    }just compile it and run:
    javac *.java
    java DataPict

  • Does not contain a static 'Main' method suitable for an entry point_

    Hello
    I want to to do a project with Entiity Framework . I add a project to my solution for my domain class and it's name is 'LinkModel.DomainClasses'.  when I prees F5 there is an error like bellow.
    Could You help me to solve this? thanks alot
    ..\Documents\Training\LinkCodeFirstLast\LinkCodeFirst\LinkCodeFirst\LinkModel.DomainClasses\obj\Debug\LinkModel.DomainClasses.exe'
    does not contain a static 'Main' method suitable for an entry point

    Hi bkshn,
    This error is caused by the missing "Main" method in your project. it is the entry point of your project.
    If you want to create a EF project, you could follow the way in the aricle below.
    https://msdn.microsoft.com/en-us/data/ee712907#codefirst
    The Main method is like below.
    class Program
    static void Main(string[] args)
    using (var db = new BloggingContext())
    // Create and save a new Blog
    Console.Write("Enter a name for a new Blog: ");
    var name = Console.ReadLine();
    var blog = new Blog { Name = name };
    db.Blogs.Add(blog);
    db.SaveChanges();
    // Display all Blogs from the database
    var query = from b in db.Blogs
    orderby b.Name
    select b;
    Console.WriteLine("All blogs in the database:");
    foreach (var item in query)
    Console.WriteLine(item.Name);
    Console.WriteLine("Press any key to exit...");
    Console.ReadKey();
    And you could start to learn the EF from the following MSDN blogs.
    https://msdn.microsoft.com/en-us/data/ee712907
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Projectname.exe' does not contain a static 'Main' method suitable for an entry point .

    Hi,
    I'm developing a blog reader for windows 8 store app. It was perfectly worked before. But because of some miss behave my coding i get below error. No other errors there.
    Error    1    Program 'c:\Users\.........\Desktop\Blog_Reader\Blog_Reader\obj\Release\intermediatexaml\Blog_Reader.exe' does not contain a static 'Main' method suitable for an entry point    C:\Users\..........\Desktop\Blog_Reader\Blog_Reader\CSC  
     Blog_Reader
    Please help me to figure this.
    Thank You!

    Go to your App.Xaml and R-Click Go to Properties
    Check whether the Build Action is ApplicationDefinition
    If not change it to ApplicationDefinition. Clean the code (solution ) and Deploy..
    Chears....

  • Solution for Windows Store app "projectname.exe" does not contain a static 'Main' method suitable for an entry point . Error.

    Hi,
    I'm developed a blog reader for windows 8 store app. It was perfectly worked before. But suddenly it started to miss behave and I got an
    error. No other errors were there other than that.
    Error 
    Program c:\Users\.........\Desktop\Blog_Reader\Blog_Reader\obj\Release\intermediatexaml\Blog_Reader.exe' does not contain a static 'Main'
    method suitable for an entry point. 
    C:\Users\..........\Desktop\Blog_Reader\Blog_Reader\CSC    Blog_Reader
    But I found the solution while I fixing it.
    Solution for that is like below.
    Go to your App.Xaml and Right-Click thenGo to Properties
    Check whether the Build Action is
    ApplicationDefinition
    If not change it to ApplicationDefinition.
    Clean the code (solution) and Deploy
    Now the error is fiexed.

    Hi Robana, 
    Good sharing on the Technet. 
    This will definitely benefit other who may encounter the same issue as yours.
    Thanks for your sharing again. 
    Kate Li
    TechNet Community Support

  • How do I set a variable on the main timeline from within a symbol?

    Just getting started with Animate and coming to it from Flash, as may be apparent from my question. How do you set a variable to the main timeline from within a symbol?
    I have 24 pairs of clickable elements, each in their own symbols, and all 24 of those symbols sit inside another symbol. I want all 24 to be able to set the same global variable when clicked. I can't find that this question is addressed anywhere, which makes me think I may be stuck in a Flash mindset and approaching the task in the wrong way. (There are however MANY discussions of how to address objects at different levels in the hierarchy. That's well covered.)
    Relatedly, how do you access a function on the main timeline from within a symbol?
    Adobe should consider putting together a support page (or pages) just for folks migrating form Flash. In the materials I've encountered so far there seems to be a studied effort to refrain from mentioning Flash in any way. I imagine there are a lot of people out there like me who have a deep background in Flash coding, but are just getting started with Animate. We don't need help with most of the basic concepts, but we may still have some pretty basic questions about how to accomplish some things in Animate because our Flash knowledge is getting in the way.

    Hi Bill,
    There are plenty of threads on here about scope, but here's one way to create a global variable:
    // code on Stage.compositionReady
    sym.myGlobalVar = 1;
    Then, anywhere in your project, you can check/set that var like so:
    sym.getComposition().getStage().myGlobalVar = 2;
    And here's one way to create a global function:
    // code on Stage.compositionReady
    sym.myGlobalFunction = function(){
              console.log('myGlobalFunction');
    Then, anywhere in your project, you can call that function like so:
    sym.getComposition().getStage().myGlobalFunction();

Maybe you are looking for

  • How do I convert my purchaced iTunes TV shows to MP4?

    I purchased a series on iTunes. I Want to put them on my external hard drive which only supports mp4. How can I convet them on my PC?

  • Msi tv@anywhere help !!!

    I bought your new tv card I downloaded the new drivers and patches And I did really got high quality tv picture and did some MPEG4 Real-time encoding of TV programs. Nice. But I can not do anything else. And I mean nothing. No other program I tried c

  • Web dynpro java application throws ArrayIndexBoundException

    Hi Experts, We had a java web dynpro application in production server and was running well. There were some changes made in the RFC and reimported the web dynpro model. After we pushed the new ear in production, it throws an ArrayIndexBoundException.

  • Ora-02331 error - while trying to force logging

    Hi friends, i am trying to configure the physical standby database and i am following this documentation http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm. when i am trying to do the force logging i am getting the following

  • Very Basic Question - Resizing Image

    Cannot believe I am having to ask such a basic question, but in order to scan and send documents to a particular database, there are two requirements: 1) 200 dpi, and 2) Greyscale The greyscale I found quickly enough by going to image adjustments ---