MovieClip not adding from my class

If I have the following on the timeline in my FLV, it works and attaches my movie from the library to the stage. If I do the same from my class, it does not. What could be the issue?
var myMC:ToolTipMc = new ToolTipMc();
addChild(myMC);
Thanks a lot for any help!

Brian914,
You have added the ToolTipMc to the display list of you class but is your class added to the display list of the Stage or Document root. Check and see if your class is a display object like MovieClip and that it is added to the stage. bellow is an example.
package {
     import flash.display.*;
     public class MyToolTip extends MovieClip{
          public function MyToolTip():void{
               //code for your tool tip
package {
     import flash.display.*;
     import MyToolTip;
     public class MyToolTipHolder extends MovieClip{
          public var tTip:MyToolTip;
          public function MyToolTipHolder():void{
            tTip = new MyToolTip();
               addChild(tTip);
Now if you are trying to put the tooltip on the screen you wil need to first add the MyToolTipHolder to the displaylist then it will add MyToolTip to its display list and it will show up. If you want to add the ToolTipHolder to any other display Object like flv, then add the myFLV.addChild(toolTipHolder);
Hope This Helps
Edithson Abelard
Passion 47

Similar Messages

  • Why are protected fields not-accessible from sub-classed inner class?

    I ran across a situation at work where we have to sub-class an inner class from a third-party package. So, it looks something like this...
    package SomePackage;
    public class Outer {
       protected int x;
       public class Inner {
    package OtherPackage;
    public class NewOuter extends Outer {
       public class NewInner extends Outer.Inner {
    }Now the NewInner class needs to access protected variables in the Outer class, just like the Inner class does. But because NewOut/NewInner are in a different package I get the following error message.
    Variable x in class SomePackage.Outer not accessible from inner class NewOuter. NewInner.You can still access those protected variables from the NewOuter class though. So, I can write accessor methods in NewOuter for NewInner to use, but I am wondering why this is. I know that if NewOuter/NewInner are in the same package as Outer/Inner then everything works fine, but does not when they are in different packages.
    I have to use JDK1.1.8 for the project so I don't know if there would be a difference in JDK1.2+, but I would think that nothing has changed. Anyway, if you know why Java disallows access as I have detailed please let me know.

    Although I don't have the 1.1.8 JDK installed on my system, I was able to compile the following code with the 1.3.1_01 JDK and run it within a Java 1.1.4 environment (the JVM in the MSIE 5.5 browser). As long as you don't access any of the APIs that were introduced with 1.2+ or later, the classes generated by the JDK 1.2+ javac are compatible with the 1.1.4+ JVM.
    //// D:\testing\SomePackage\Outer.java ////package SomePackage ;
    public class Outer {
        protected int x ;
        public Outer(int xx) {
            x = xx ;
        public class Inner {
    }//// D:\testing\OtherPackage\NewOuter.java ////package OtherPackage;
    import SomePackage.* ;
    public class NewOuter extends Outer {
        public NewOuter(int xx) {
            super(xx) ;
        public class NewInner extends Outer.Inner {
            public int getIt() {
                return x ;
    }//// D:\testings\Test.java ////import OtherPackage.* ;
    import java.awt.* ;
    import java.applet.* ;
    public class Test extends Applet {
        public void init () {
            initComponents ();
        private void initComponents() {
            add(new Label("x = ")) ;
            int myx = new NewOuter(3288).new NewInner().getIt() ;
            TextField xfld = new TextField() ;
            xfld.setEditable(false) ;
            xfld.setText(Integer.toString(myx)) ;
            add(xfld) ;
    }//// d:\testing\build.cmd ////set classpath=.;D:\testing
    cd \testing\SomePackage
    javac Outer.java
    cd ..\OtherPackage
    javac NewOuter.java
    cd ..
    javac Test.java//// d:\testing\Test.html ////<HTML><HEAD></HEAD><BODY>
    <APPLET CODE="Test.class" CODEBASE="." WIDTH=200 HEIGHT=100></APPLET>
    </BODY></HTML>

  • Method not accessible from other classes

    Hi,
    I ve defined a class and would like to create an instance of it from another class. That works fine, I am also able to access class variables. However the class method "calcul" which is defined as following, is not accessible from other classes:
    class Server {
    static String name;
    public static void calcul (String inputS) {
    int length = inputS.length();
    for (int i = 0 ; i < length; i++) {
    System.out.println(newServer.name.charAt(i)); }
    If I create an instant of the class in the same class, the method is then available for the object.
    I am using JBuilder, so I can see, which methods and variables are available for an object. Thanks for your help

    calcul is a static method, that means you do not need an instance of server to run this method. This method is also public, but your class Server is not, your Server class is package protected. So only classes within the same package has Server can use its method. How to use the calcul method?// somewhere in the same package as the Server class
    Server.calcul( "toto" );

  • Adding Java Fact Classes not erroring, but not adding the facts/classes

    I'm attempting to build Rule dictionaries modeled after maven modules of the project I'm working on. First I created a dictionary "common" with common classes added as Java facts. Second I created a dictionary "domain". In the "domain" dictionary I linked the "common" dictionary and added some domain specific classes as java facts. Finally I created a "product" dictionary. The product dictionary links the "domain" dictionary. When I look at the facts in the "product" dictionary I see all the facts from "common" and "domain" linked in. When I attempt to add more facts to the "product" dictionary I can find the classes in the classpath without a problem. However when I select the classes I wanted added as java facts and click "OK" in JDevelopers 'Create Java Fact' Dialog none of the facts are added. I cannot find any error or explanation for why they were not added. I believe I have all class dependencies of these java facts already added in the "common" and "domain" dictionaries I have linked in. Any help in how to resolve this would be appreciated - or even some general guidelines on how to build and maintain dictionaries.
    Thanks,
    Mike

    Hello, I seem to have the same problem as you. Have you found a solution to this?
    See my thread here: Oracle Rules: Adding Java Facts - not showing up in list.

  • Adding a JPanel from one class to another Class (which extends JFrame)

    Hi everyone,
    So hopefully I go about this right, and I can figure out what I'm doing wrong here. As an exercise, I'm trying to write a Tic-Tac-Toe (TTT) game. However, in the end it will be adaptable for different variations of TTT, so it's broken up some. I have a TTTGame.java, and TTTSquareFrame.java, and some others that aren't relavent.
    So, TTTGame:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import joshPack.jUtil.*;
    public class TTTGame extends JFrame
         private Integer sides = 3;
         private TTTSquareFrame mainSquare;
         private TTTGame newGame;
         private Container contents;
         private JPanel mainSquarePanel, addPanel;
         public static void main(String [] args)
              TTTGame newGame = new TTTGame();
              newGame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public TTTGame()
              super("Tic-Tac-Toe");
              contents = getContentPane();
              contents.setLayout(new FlowLayout());
              addPanel = startSimple();
              if(!addPanel.isValid())
                   System.out.println("Something's wrong");
              contents.add(addPanel);
              setSize(300, 300);
              setVisible(true);
         public JPanel startSimple()
              mainSquare = new TTTSquareFrame(sides);
              mainSquarePanel = mainSquare.createPanel(sides);
              return mainSquarePanel;
    }and TTTSquareFrame:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import joshPack.jUtil.Misc;
    public class TTTSquareFrame
         private JPanel squarePanel;
         private JButton [] squares;
         private int square, index;
         public TTTSquareFrame()
              System.out.println("Use a constructor that passes an integer specifying the size of the square please.");
              System.exit(0);
         public TTTSquareFrame(int size)
         public JPanel createPanel(int size)
              square = (int)Math.pow(size, 2);
              squarePanel = new JPanel();
              squarePanel.setLayout(new GridLayout(3,3));
              squares = new JButton[square];
              System.out.println(MIN_SIZE.toString());
              for(int i = 0; i < square; i++)
                   squares[i] = new JButton();
                   squares.setRolloverEnabled(false);
                   squares[i].addActionListener(bh);
                   //squares[i].setMinimumSize(MIN_SIZE);
                   squares[i].setVisible(true);
                   squarePanel.add(squares[i]);
              squarePanel.setSize(100, 100);
              squarePanel.setVisible(true);
              return squarePanel;
    }I've successfully added panels to JFrame within the same class, and this is the first time I'm modularizing the code this way. The issue is that the frame comes up blank, and I get the message "Something's wrong" and it says the addPanel is invalid. Originally, the panel creation was in the constructor for TTTSquareFrame, and I just added the mainSquare (from TTTGame class) to the content pane, when that didn't work, I tried going about it this way. Not exactly sure why I wouldn't be able to add the panel from another class, any help is greatly appreciated.
    I did try and cut out code that wasn't needed, if it's still too much let me know and I can try and whittle it down more. Thanks.

    Yea, sorry 'bout that, I just cut out the parts of the files that weren't relevant but forgot to compile it just to make sure I hadn't left any remnants of what I had removed. For whatever it's worth, I have no idea what changed, but something did and it is working now. Thanks for your help, maybe next time I'll post an actual question that doesn't somehow magically solve itself.
    EDIT: Actually, sorry, I've got the panel working now, but it's tiny. I've set the minimum size, and I've set the size of the panel, so...why won't it respond to that? It almost looks like it's being compressed into the top of the panel, but I'm not sure why.
    I've compressed the code into:
    TTTGame.java:
    import java.awt.*;
    import javax.swing.*;
    public class TTTGame extends JFrame
         private Integer sides = 3;
         private TTTSquareFrame mainSquare;
         private TTTGame newGame;
         private Container contents;
         private JPanel mainSquarePanel, addPanel;
         public static void main(String [] args)
              TTTGame newGame = new TTTGame();
              newGame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public TTTGame()
              super("Tic-Tac-Toe");
              contents = getContentPane();
              contents.setLayout(new FlowLayout());
              mainSquare = new TTTSquareFrame(sides.intValue());
              contents.add(mainSquare);
              setSize(400, 400);
              setVisible(true);
    }TTTSquareFrame.java
    import java.awt.*;
    import javax.swing.*;
    public class TTTSquareFrame extends JPanel
         private JButton [] squares;
         private int square, index;
         private final Dimension testSize = new Dimension(50, 50);
         public TTTSquareFrame(int size)
              super();
              square = (int)Math.pow(size, 2);
              super.setLayout(new GridLayout(size, size));
              squares = new JButton[square];
              for(int i = 0; i < square; i++)
                   squares[i] = new JButton();
                   squares.setMinimumSize(testSize);
                   squares[i].setVisible(true);
                   super.add(squares[i]);
              setSize(200, 200);
              setVisible(true);
    I've made sure the buttons are smaller than the size of the panel, and the panel is smaller than the frame, so...
    Message was edited by:
    macman104

  • Maven problem: class file not added in excecutable after compilation

    Hi,
    I ran into the following issue.
    I created a program, capable of reading an identity card from an electronic card reader. I use maven for dependency management and compilation.
    The libraries used for reading the card reader are not from any maven repository. So I cheated a little bit and added the jar file to the repository myself
    and created a pom file for it too in the repository. I respected the structure groupId - artifactId - version . It is something like
              <dependency>
                   <groupId>be.belgium.eid</groupId>
                   <artifactId>beid35JavaWrapper-win</artifactId>
                   <version>3.5</version>
                   <type>jar</type>
              </dependency>
    The jar file and a pom file are then to be found on that location. When running the program in my development environment, everything runs fine.
    But when I create an executable for this program, the class files for these libs are not added to the created executable.
    questions:
    1/ Do I also need to create the .sha1 file for this. If so: how?
    2/ What are these .sha1 files
    3/ Has anyone written a similar program, but with eid libs from maven? Which ones?
    thanks for any help
    Edited by: user8276126 on Apr 2, 2011 9:07 AM

    try clearing cache and restarting tomcat. If you post the code that you are using to call the methods it will help to find the issue.

  • I recently removed an outlook account and now all of my calendar events are missing. The majority of them were added from my iphone 4s. How do I retrieve the events? Backing up with iCloud did not help, as I assumed it would.

    I recently removed an outlook account and now all of my calendar events are missing. The majority of them were added from my iphone 4s. How do I retrieve the events? Backing up with iCloud did not help, as I assumed it would.

    Outlook is a mail client for PC's (and Macs). It is not a type of account. Do you mean an "Exchange Account"?
    If so, then re-add it. The calendar events live on the Exchange Server. The only way to get them back is to re-add the account to the phone. The contents of Exchange and IMAP accounts are not part of the 'backup' as they already exist elsewhere.

  • Accessing the ServletContext from a class that is not a Servlet?

    Is there any way of accessing the ServletContext from a class that is not a
              Servlet? The class is being used as part of a Web Application.
              Thanks.
              

    http://www.mozilla.org/mirrors.html
    Mozilla has download mirrors around the globe. If it is on the list, it is trustworthy.

  • HT1386 purchased new songs from itunes and when I clicked on the Sync button those new songs are not added to my ipod nano. Have any idea how to resolve this problem?

    purchased new songs from itunes and when I clicked on the Sync button those new songs are not added to my ipod nano. Have any idea how to resolve this problem?

    Do you have the right boxes checked to sync the music to your iPod?
    iTunes: Syncing media content to iOS devices and iPod
    Do they play in iTunes on the computer?
    Have you successfully synced music form this iTunes library/computer before?

  • My iCloud is set up and seems to work. However, a newly added contact does not sync from the Macbook to the iphone and iPad. What am I doing wrong?

    My iCloud is set up and seems to work. However, a newly added contact does not sync from the Macbook to the iphone and iPad. What am I doing wrong? Thanks, txstan

    Apparantly it is, On My Mac contacts don't appear in iCloud, anywhere.
    Put all your contacts on all of your devices in iCloud (assuming that's where you want them to be)
    Go to www.icloud.com, login and see what you actually have in the account.

  • My iPhone has not downloaded from the iCloud properly but I have added more stuff since can I back up

    My iPhone has not downloaded from the iCloud properly but I have added more stuff since can I back up

    Regarding the first question, the following gives details on what should be done with a phone being transferred to someone else: http://support.apple.com/kb/ht5661

  • Nulling a movieclip made from a class - does it make it trashable?

    Hi
    I instantiate a class that makes some movieclips within it, and from the class that instatiated it, I add some event listeners to the moveiclips...
    (simplified)
    var myClip:MCClass = new MCClass();
    myClip.mc1.addEventListener(MouseEvent.CLICK, doSomething);
    If at some stage I state myClip = null, does that make the event listeners eligible to be garbage collected, or do I need to removeEventListener them prior to myClip = null?
    Cheers!

    You have to both remove MyClip from the stage and also make it null to make the object that has the functions that are being used as event listeners available for garbage collection.
    For example:
    public class Obj1 {
         protected var _obj2:Obj2;
         public function get obj2():Obj2 {
              return _obj2;
         public function set obj2(value:Obj2):void {
              if (value != _obj2) {
                   //should do this so the event listeners don't fire after obj2 nulled in larger context
                   if (_obj2) {
                        _obj2.child.removeEventListener('someEvent', listener);
                   _obj2 = value;
                   if (_obj2) {
                        _obj2.child.addEventListener('someEvent', listener);
         protected function listener(e:Event):void {
              //do something
    public class MainClass {    
         protected var _obj1:Obj1;
         protected var _obj2:Obj2;
         protected function init():void {    
              _obj2 = new Obj2();
              addChild(_obj2);
              _obj1 = new Obj1();
              _obj1.obj2 = _obj2;
         protected function tearDown():void {
              removeChild(_obj2);
              _obj2 = null;
              //if you don't null _obj1.obj2, the listener will keep firing until it is garbage collected
              //but obj1 will eventually get garbage collected
              _obj1=null;

  • Using Methods not Defined in a class that you are calling them from

    For one of my assignment I have had to create a class with methods and then create another class to test the methods.
    I keep getting the error message "cannot resolve symbol"
    And the error points to the line where I am calling the class.
    I have put the classes in a package and imported them.
    Here is the method I am calling.
    public boolean validDate(int day, int month, int year)
    if(leapYear(year))
    daysInMonth = 29;
    else
    getNumberOfDaysInMonth(month);
    return true;
    This is how I am calling it from the test class
    if(validDate(day1,month1,year1))
    testnewDate.java:38 cannot resolve symbol
    symbol : method validDate(int,int,int)
    location:class newdate.testnewDate
    if(validDate(day1,month1,year1))
    ^
    If anyone is able to help I can give you my java source files if I haven't given enough information.

    You can't call another class's method directly from your class. You need to get an object of that class and should call the method using that object.
    If you have written public boolean validDate(int day, int month, int year) method in class DateValidator, then from your test class, you have to call that like this,
    DateValidator dv = new DateValidator();
    if(dv.validDate(day1,month1,year1)) {
    // Take actions
    Hope it is clear.
    Sudha

  • Loading property files from a class and not a servlet...

    Hi, I was wondering if anyone has a good solution for loading property files from a class instead of a servlet. I would like to load the property file similarly to how it is done from HttpServlet.
    Here is the large picture. I have a tag library that calls a class which needs to access a database. The class needs to know what DB to access so it needs to look at some property file. The problem is that I don't want to hardcode the properties or the path of where the property file exists. I hope this all makes sense.
    Thanks.
    -PV

    I use the getResource method in the java.lang.Class class. Read about this method in the api.
    Anyways this is roughly how it's : you must put your properties file in the classpath. Then in your class :
    Properties prop = new Properties();
    URL url = this.getClass().getResource("/config/db.properties");
    prop.load(url.openStream());In this case, you must put the "config" (where you've written your db.properties file) directory's parent in the classpath.

  • How do I transfer all tunes(only some appear in the imovie 11 itunes library) in my itunes library into the new iMovie itunes library? How do I restore all the music (not all added from imovie 9) play in my videos transferred from imovie 9 into iMovie 11?

    How do I recover the many imovie 9 projects that did not transfer from imovie 9 into imovie 11? How do I make all of my  itunes library accessible to the itunes library in imovie 11. How do I recover those music audio tracks lost in the transfer from  imovie 9 projects  into imovie 11? How do I add music from my itunes library into imovie 11 projects. Some do and others cannot. 

    for purchases from the iTunes store do this:
    connect your device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
    for everything else check out this post by Zevoneer.

Maybe you are looking for

  • No audio playback

    I'm getting an error upon itunes launch 'detected a problem with your audio configuration and audio playback will not work' and it isn't.  Upgraded itunes and problem persists.  Any other hints?

  • Update Accounts Receivable in Business Partner

    Hi. I'm trying update the the following field in the business partner form: Business Partner - Business Partner Master Data - tab Accounting - field "Accounts Receivable" How can i update this field? I  also try this: BP.AccountRecivablePayables.Acco

  • Reload web-inf/web.xml file without restarting tomcat

    Please help me if any one have a solution . I am doing development in jsp, servlet. I am using tomcat5 as a webserver. i want to reload web-inf/web.xml file without restarting tomcat.

  • Oracle HTTP server, Oracle 9iAS server, Oracle APPS 11i

    Hi, expert: I was reading the Oracle Applicaitons Concepts (11i). There three tiers in Apps. In the middle tier there are: Web Server, Forms Server, Concurrent Processing Server, Reports Server and Admin Server. But when I look our company's EBS arch

  • Time Capsule Access?

    Is there anyway to restrict or limit individual Mac/PC access to the Internet, both wired and wireless, through the Airport Utility using the latest generation Time Capsule?