Controlling MovieClip properties from a Class that it's linked to

Hi all,
I have a Moveclip with a Dynamic text field instance name of
"optionName". The movie clip is linked to my custom Class "Toggle".
Is there a way for me to access "optionName" from my class?
Basically I am getting this error:
Thanks.

Thanks, much appreciated.

Similar Messages

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

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

  • Control browser properties from a java application while launching a browse

    How to control the properties of a browser when it is launched from a java application?
    I am using the command " Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+url); " to launch the browser. The syntax of "exec" command is "public Process exec(String command,String[] envp) throws IOException". I would like to know whether we can give the arguments in this command to control the browser properties.
    If you know any other option by which we can open a URL in a controlled browser, please share it.
    Thanks in advance :).
    Surekha_Venugopal

    Hi All,
    I have found a solution to control browser parameters from Java applications.
    1. Create an intermediate HTML file at runtime which contains Javascript to launch a browser. Pass the parameters like the URL and browser control parameters to the Javascript of this HTML file.
    2. Open this HTML file and invoke the javascript while loading the file. Javascript will launch the required URL in a controlled browser.
    3. Close the intermediate HTML file.
    Limitation:
    1. There will be a flickering of windows.
    2. Applets will have permission issues with the above solution. For applets a better solution is JSobject. No need of an intermediate file here.
    Hope this will be useful for someone. :-)
    Cheers,
    Surekha_Venugopal

  • Why can't I create new object from a class that is in my big class?

    I mean:
    class A
    B x = new B;
    class B
    and how can I solve it if I still want to create an object from B class.
    Thank you very much :)

    public class ItWorksNow  {
      public ItWorksNow() {
      public static void main ( String[] argv )  throws Exception {
        ItWorksNow.DaInnaClass id = new ItWorksNow().new DaInnaClass();
      public class DaInnaClass {
    }

  • Overloading constructor of a child that inherits from a class that inherits from Windows.Forms

    The title might be a bit confusing so here is the layout.
    - classHForm inherits System.Windows.Forms.Form
    - frmDoStuff inherits classHForm  (written by someone else and used in several applications)
      - does not have a constructor specifically defined, so I added the following thinking it would override the parent
    Sub Public New()
    End Sub
    Sub Public New(byval data as string)
    'do stuff
    End Sub
    In my code, I want to instantiate frmDoStuff, but I need to overload it's constructor and populate fields within this form. The problem I'm running into is that when I run this, it is using the constructor from classHForm and ignores any constructor in frmDoStuff.
    I guess you can't override the parent constructor? Is that why it won't work?
    I didn't want to overload the classHForm constructor, but I will if that's the way to go.
    my code:
    dim frm as new frmDoStuff(myString)
    Note: I would love to show actual code, but not allowed. Against company rules.

    Your code is similar. The value I pass into frmDoStuff is supposed to set a value for a textfield.
    Public Class frmDoStuff
    Inherits classHForm
    Public Sub New(ByVal s As String, ByVal gridData() as String)
    txtMyTextField.text = s LoadGrid(gridData)
    End Sub
    I also have a datagridview I need to populate in frmDoStuff and thought I would have another string or string array as a second parameter to the constructor and then call a routine from the constructor to populate the datagrid.
    of course, when I run it this way, the code is not being reached. I'll build an example as COR suggested and maybe someone will see where I'm going wrong.
    [UPDATE]
    I created a simple example and it worked. So, now I need to try to understand what is different in the actual code.
    Here is my example:
    Parent Class inherits form
    Imports System.Windows.Forms
    Public Class classMyForm
    Inherits System.Windows.Forms.Form
    Sub New()
    ' This call is required by the designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    End Sub
    End Class
    Public Class frmDoStuff
    Inherits classMyForm
    Public Sub New()
    ' This call is required by the designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    End Sub
    Public Sub New(ByVal sStuff As String)
    MyBase.New()
    InitializeComponent()
    'Populate the textbox
    TextBox1.Text = sStuff
    End Sub
    End Class
    Public Class frmMyForm
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim frm As New frmDoStuff(TextBox1.Text)
    frm.Show()
    End Sub
    End Class
    Just to recap. The actual parent was created a few years ago and the child form that I'm calling, "frmDoStuff" was created a couple years back and is used in several applications. I need to use it in my application, but I need to populate a couple
    controls when the form is loaded. As you can see in this example, I successfully overloaded the constructor to populate the textbox in frmDoStuff.
    In my real life situation, my overloaded constructor seems to be getting ignored when i step through the code. I'll go back and do some more testing.

  • MovieClip references from a class

    I have a files that has movie clips and nested movie clips on the stage. I am now writing a class and want to give the MCs event handlers and other properties.
    When I do something like the following:
    myMC_mc.MyOtherMC_mc.mouseEnabled = false;
    I get the error:
    1120: Access of undefined property myMC_mc.
    I added this to the top of my class and it seems to take away the error, but I thought this was not needed in AS3 anymore.
    private var myMC_mc:MovieClip;
    private var myMC_mc.MyOtherMC_mc:MovieClip;
    What do I have to do to not get the error? How is this done right?
    Thanks a lot for any help!

    you can't access/reference objects until they exist.
    if your class is the document class and myMC_mc doesn't exist on frame 1 of the main timeline, you'll have a problem.

  • Can I invoke a class that extends JAppl from another class extends JAppl

    Can I invoke a class that extends JApplet from another class that extends JApplet. I need to invoke an applet then select an action which opens another applet. Thanks in advance.

    Nobody is able to solve this problem, i cant even
    think this things. i have hope so plz try and get
    result and help.Did you understand what Sharad has said???
    Yep, you can forward to specific error page from servlet when even error occured in JSP. In order to achieve you have to open jsp file from servlet say example by using reqdisp.forward.
    handle exception in the part where you are forwarding. And forward to the specific error page inside catch block.

  • Transform a class that implements JPanel into a bean.

    I'd to create a bean, from a class that implements JPanel, that in fact is a custom component.
    How can I create a bean?
    I have absolutely no idea about beans.
    What can make beans for me?
    I know a lot about the theory of ejb, is this what I need?
    I'm quite confused, please make me see the light!!!!!
    Thanks.

    Hi Daniel!
    To answer your question short as possible:
    Java -Beans are reusable code - components,
    similar to VB Active -X components,
    which you can use when developing your own
    applications.
    Beans can have a graphic user interface, so you
    can use builder tools like JBuilder or Beanbox
    to show them graphically in a designer.
    You can modify them about their properties,
    mostly shown in a special property window of a
    builder tool.
    It's really not very hard to create your own beans,
    the only thing you have to do is to pack all the
    classes which make the bean into a jar file.
    Then you can import the bean with the builder
    and it will be shown.
    The jar manifest file needs to look like for example:
    Manifest-Version: 1.0
    Name: BeanClock.class
    Java-Bean: True
    All the properties are implemented by public property-get
    and property-set methods, in order to show them in the property window.
    Java is doing that by introspection.
    Hope, this makes it a little bit clearer for you!

  • Importing Flash Pro library symbols from Starling class

    Very new to Starling. I have succesfully created a project and seen some great performance when scrolling the pages in the online comicbook I'm making.
    However, I need to place interactive, invisible hotspots on top of my comicbook pages. Placing these hotspots via code would be quite cumbersome - it would be much better to design these interactive layers in Flash Pro so I can drag/drop their exact placement. The structure I want is:
    NORMAL STAGE LAYER -> Interactive hotspots
    on top of
    STAGE3D LAYER -> Comicbook pages
    I'm aware that the hotspot layers won't run on the GPU, only the pages underneath. But I'd like to try it out anyway.
    However, once I've created the hotspot layers in Flash Pro and given them linkage names, I can't figure out how to import them onto the comicbook pages. This is obviously because they are flash.display.movieclips and the Starling class that tries to import them expects Starling movieclips.
    Is there any workaround for this? Either a way to be able to refer to both types of movieclips from the same class (preferably) - or a way to create two classes that add the pages and the hotspots respectively. Code examples would be great.

    Have you perhaps considered using this:
    starling.core.Starling  - Native Overlay
    Not that I'd do that myself. I know we all want our cake and eat it too but I really think you should work within the framework and re-create the hotspots using Starling sprites and add listeners to them. You can read the original flash hitareas x/y position as well as height and width. If it's just rectangles, that's all you need to know to generate the hit area in Starling. Even if it's not just rectangles you can draw the Flash hitarea object (assuming it's a flash symbol) into a Starling object as you're most likely doing with the comic book pages themselves. You just need to apply listeners.

  • How to access form objects from different class?

    Hello, I am new to java and i started with netbeans 6 beta,
    when i create java form application from template i get 2 classes one ends with APP and one with VIEW,
    i put for example jTextField1 with the form designer to the form and i can manipulate it's contents easily from within it's class (let's say it is MyAppView).
    Question>
    How can i access jTextField1 value from different class that i created in the same project?
    please help. and sorry for such newbie question.
    Thanks Mike

    hmm now it says
    non static variable jTree1 can not be referenced from static context
    My code in ClasWithFormObjects is
    public static void setTreeModel (DefaultMutableTreeNode treemodel){
    jTree1.setModel(new DefaultTreeModel(treemodel));
    and in Class2 it is
    ClasWithFormObjects.setTreeModel(model);

  • How to design universe with tables from two databases using a db link?

    I am building a universe (v3.1) that has tables from two different oracle db instances.  My dba created synonyms for me and there is a database link in place.  I don't know how to get this working in Designer.  I can see the views under my ID when I browse to insert a table, but there is no structure.  I think I have to create a new strategy.  I attempted to do that, but the directions aren't very clear to me, and it isn't working.  Any help or advice would be greatly appreciated.  Thanks!!

    i've been working with DB links much before, but this was since long time ago before i join the Business Intelligence field
    from my understanding that you Have link from DB1 to DB2
    and from your user in DB1 you can access tables and view from DB2
    if you are using your user to create a universe im not sure if you can use tables from DB2 or not
    and you dont see the tables of the link in the Universe
    but you can try to create a drived table selecting from any tables from DB2
    for example
    select id,name from user.table2@mylink
    check this way and give me your feedback
    good luck

  • Loading a movieClip from a class

    Hello all,
    I'm attempting to write an AS 2.0 class using Flash through
    which I can load and control multiple movie clips in the library
    and from external files. I've attempted multiple different ways,
    don't quite seem to be able to get the images to show up on the
    screen. After some time searching, I've been unable to find a good
    example online. Please excuse my inexperience with AS classes.
    I'd like to write a class that extends MovieClip and is used
    to control multiple 'sub' movieClips, all from methods inside the
    instantiated class.
    From .fla file, I call instantiate my class as follows:
    var theScene:sphere3D = new sphere3D();
    In the constructor of my class file, I'm attempting to attach
    or load a movie. I simply want to get it to show up on the screen,
    when I test the .fla movie. I've tried using attachMovie and
    loadMovie with not luck.
    dynamic class sphere3D extends MovieClip {
    function sphere3D() {
    this.attachMovie("shadow","shadow",1); // shadow being a
    movie clip in the .fla library with linkage
    shadow._x = 100;
    shadow._y = 100;
    this.createEmptyMovieClip ("shadow2", 100);
    shadow2._x = 100;
    shadow2._y = 100;
    shadow2.loadMovie("images/cube.png");
    What am I doing wrong? Suggestions for stuff to test would be
    welcome.
    Thank you,
    dana.

    Ah, thank you, that make sense now. The solution you
    suggested worked great.
    I did also find two other solutions, for anyone else who
    might read this. One is to essentially create an empty movieclip on
    your timeline. From the linkage window for the empty movieclip, I
    made sure I set the Class field to the name of the class I'd
    written, something I didn't do previously. This attaches all the
    class actionscript to the empty movieclip, and even automatically
    runs the constructor when the empty movieclip is placed on the
    timeline. It also automatically provides a 'reference' to the main
    timeline when I refer to this.attachMovie() from inside the class.
    So it worked, but isn't as elegant as doing everything from the
    actionscript (unless you are building a component).
    The last reference I came across is the
    Object.registerClass() method used to attach as class to an object,
    similar to using the Linkage method above. But I haven't
    successfully tried it yet.
    Thanks again for the help kglad,
    dana.
    Dana Sheikholeslami
    Art Institute of California

  • AS3.0: How to extend a class that extends MovieClip

    When I try to set the base class of a library symbol to a
    class that doesn't DIRECTLY extend MovieClip, but instead extends
    another class that DOES extend MovieClip, it's disallowed, saying,
    "The class 'Whatever' must subclass 'flash.display.MovieClip' since
    it is linked..."
    Is this just a validation bug in the property windows, only
    checking one class deep into the inheritance hierarchy? Because the
    specified class does extend MovieClip, just two levels in instead
    of one. Is there a fix for this? Or must library symbols always
    directly extend MovieClip? If so, why?

    Which classes from flash.display have you imported. Just
    because a class extends another doesn't mean that it inherits all
    of its properties. Saying a class extends sprite doesn't give you
    access to all of it's properties, members and display unless you
    first import flash.display.* or flash.display.Sprite. If you aren't
    already importing flash.display.*, try importing
    flash.display.MovieClip and see what happens...

  • How can I to control any element of my GUI from another class?

    How can I to control any element of my GUI from another class?

    For that, you need the external class to have the reference to your element.. If your idea is to change basic properties like width, height etc.. then you can have the constructor of the external class to take the object of the parent of your class as the parameter and modify ..
    However, if the properties to be altered/accessed are custom to your element, then you will have to have the class accept an object of your class as the parameter. No other option..
    What exactly is your requirement?

Maybe you are looking for

  • How to rename the column field names

    hello guys, i am retrieving my field names from the database and i view it thru HTML. When i view it,the column names are those which are given while creating tables. Ex.. fname,lname,phno, i want it as First Name,Last Name,Phone Number etc ...<% try

  • 5th generation Ipod Touch won't charge past 20%?

    I bought my 32 gb 5th generation Ipod Touch not more than 2 weeks ago at my local Walmart. Everything was working perfectly until today. All day, my ipod would charge until 20%.. run on this charge for approximately 10 minutes, and then die again. It

  • FAO BalusC  Question about your JSF tutorial

    I have the tutorial working fine now, it was a problem with the caching in my browser I think. My question is how now do I get your example to work with myFaces? What steps must I follow now in order to get the app to work with myFaces? Do I need to

  • How do I get iTunes to open in iMovie?

    How do I get iTunes to open in iMovie?  It says that the contents of my library will show up "here", but it doesn't.

  • Getting current row or cursor

    Hi all, I'm using FM 'REUSE_ALV_GRID_DISPLAY' in my program. However, I'm having problem getting the current row or the cursor position in my ALV. If possible, I do not wish to use OO method in doing this. Is there any other way?