Passing a reference MovieClip of Parenthood to button event?

I try to refer to a movieclip which was adopted through the first class (Builder/instance, tried both) but failed to get an instance of key event to recognize. Because the button based around an event, I'm not sure of how to reference. I've stripped a lot of the code, but has left the classiquee function as button events are related to a structure of dynamic loop, the main reasons why I can't move the buttons to a different class.

The example looks like this:

package {}

import flash.display. *;
import flash.text. *;
import flash.utils. *;
import flash.events. *;
import flash.net.URLLoader;
import flash.net.URLRequest;
import com.greensock;
com.greensock.easing import. *;
com.greensock.plugins import. *;

Thumbnails/public class extends {Gallery

public void Thumbnails()
{
trace ("LOCATION: thumbnails");
}

public void initThumbs (root_mc:MovieClip, site_mc:MovieClip)
{

trace ("THIS, PARENT:" + this, parent, site_mc);     WORK

}

private function _onDataReady (evt: Event): void
{

function overThumb(evt:MouseEvent):void {}
TweenLite.to (site_mc.gallery_mc.title_mc.txtTitle_mc,.5, {alpha: 100});
TweenLite.to (site_mc.gallery_mc.title_mc.txtRollover_mc,.25, {alpha: 0});
}
function outThumb(evt:MouseEvent):void {}
TweenLite.to (site_mc.gallery_mc.title_mc.txtRollover_mc,.5, {alpha: 100});

/ / Only trace site_mc
TweenLite.to (site_mc.gallery_mc.title_mc.txtTitle_mc,.25, {alpha: 0});
}
function upThumb(evt:MouseEvent):void {}

} / / END OF upThumb()

} / / END of onReadyData

} / / END OF class
} / / END OF packet

I'm trying to figure out how to get the reference site_mc to the key event so it can trigger others clips nested inside (gallery_mc, etc.). If it's AS2 it would be a piece of cake, but now I have all these invisible walls for the passage of variable.

If someone can tell me where my logic is wrong with that, so I can connect the dots, I would love.

you don't need to redefine something nested clips.  you just need to get a reference to site_mc outside your Builder.  When a parameter (such as site_mc) is passed to a function (constuctor, another method of the class or only a function defined on a movieclip timeline simple vanilla), the parameter is only available in this function for this particular function call.  If you want available elsewhere, you must define a variable that is available elsewhere.

Tags: Adobe Animate

Similar Questions

  • Passing a reference to queue as a sequence with LabVIew API parameter

    Hello

    I'm running a sequence of Labview with the entryPoint.Run method.

    Now, I want to pass a reference to queue to TS for use as the parameter for a stage of the action (the action must information sent through this queue). I tried to move the queue as a parameter for the valVariant parameter of the object of Subproperty seuqence.

    LabVIEW throughs 1 error when I try to setValVariant.

    The reason why I want to do it is because I want to integrate the execution of the sequence in my draft framework for an actor.

    Is it better to move the refs to the queue as a reference to be able to send data to an application running?

    Thanks in advance

    Michael

    Hi Michael,

    It is not possible to use references of LabVIEW in TestStand queue, since they do not share the same instance of the application. You can pass a reference to queue as an integer (U32 or I32), but you can not use in TestStand.

    I found 2 ways for you to use:

    You can use the Action engines in LabVIEW to encapsulate the queue. There is some information about this option in this thread:

    Solved: queues of LabVIEW and TestStand - Forums of Discussion - National Instruments
    http://forums.NI.com/T5/LabVIEW/LabVIEW-queues-and-TestStand/TD-p/2554231

    However, with this option, you must make sure that the motor Action shift register leaves no memory

    .

    The recommended practice is to create the queue in TestStand using Synchronization Manager and then open this queue in LabVIEW. An example is available for this option:

    Using queues in LabVIEW - National Instruments TestStand
    http://www.NI.com/example/30108/en/

    I hope this information is useful for you!

    Alex

  • Pass a reference to the shared variable

    I use two shared variables in a loop where I write one and read each other.  I need to repeat this loop 5 times, but each loop uses a different pair of shared variables.  These variables are shared between a vi on the computer and a cRio.

    It would be ideal to incorporate this loop into a Subvi where I can pass a reference to the two shared variables in and then read and write in threw these references.  Then I could just call this Subvi 5 times, instead of copying and pasting the loop 5 times.

    Is it possible that I can accomplish this?  I can't find an example that would achieve this.

    Thank you

    If I understand correctly, you can use the mode programmatic access to shared Variables and it would work.

    http://zone.NI.com/reference/en-XX/help/371361H-01/lvconcepts/sv_usingdynvarapi/

    http://zone.NI.com/reference/en-XX/help/371361G-01/lvconcepts/usingdynvarapi/

  • Pass by reference

    Hi all

    I'm developing an application for the tests used in automobiles. I just had a tot that is possible to pass the array by reference. I know that the method of passing by reference by getting the reference to the table and pass the reference to the Subvi. To do this I need to create a display board and reference for the same should be passed to the Sub - VI. But this is nothing but pass the data to the Subvi by value. The only difference is that the table indicator will not be created in primary vi rather a control panel will be in Subvi.

    Is it possible to directly wire data without creating a control wire Subvi and Subvi table, use as a ref table and retrieve the data. You mean, son of data must be connect to the Subvi terminal, but terminal in sub - VI should give the Ref for that data.

    All ideas are welcome.

    Thank you

    Yogesh

    Maybe you are looking for a reference value of data? It can be a 2D array, for example.

  • Passing a reference to a type definition for a Subvi

    I created a type definition that I would use in my application. This definition of particular type is also the control of front panel to my top level VI. I wanted to pass a reference to this control to my sub - VI so that they could dereference as needed and in very rare cases, update the values on the front panel. However, as I created the application I noticed that I was breaking the control reference that I have updated the type definition. This implies that they type changes the reference that I change the type definition.

    How can I do to build the reference I need or there at - it another way to proceed that works as well. Even if I can't make a reference to the control that is bound to the type definition, I'm ready to move to a Variant that can accommodate the reference until I can build the type of data (reference) inside my SubVis.

    Hello

    You must simply pass a reference of generic control to the Sub.vi and then cast to the specific typedef. You will need to place a control dummy of this typdef on your Sub.vis Frontpanel and hide.

    Christian

  • How to make a clickable button which is a movieclip which is another button

    Guys good day.

    Problems with a button that is inside a movieclip and this movieclip is under another button.

    The buttons are more clickable. I have a panel that is to have a button when you rollover the movieclip mounts.

    And I want the buttons located under the movieclip are clickable. When I implemented the movieclip I want to go back to its original menu.

    Diagram:

    Panel.MC

    the inside contains

    Button1

    movieclip1


    inside the movieclip1

    Btn1, btn2, btn3 that does not work...

    If the movieclip containing the buttons a mouse interactive code applied, the buttons are blocked by the interaction with the mouse.

  • I can't pass a reference of function to another function?

    Hello

    Reminder of basic:
    I am trying to create a custom preloader class that uses a table to store a URLRequest objects queue, to load in the order. I have no problem with the queue or get the loader to load the URLRequests in order.

    I can't seem to pass a reference to a function (address think of c) in my preloader class. I want to convey the function reference to serve the event listener for the given URLRequest.

    Signature of the function:
    public function addItemToLoad (item: URLRequest, notify: FUNCTION_REFERENCE)

    Anyone know what the syntax is to pass the address of a function to be called at a later date?

    Think that
    FunctionName
    vs
    Nomfonction()

    Thank you
    Nomadic design

    Thank you

    I missed the caps. I tried the function, but the compiler received errors.

    I've actually taken a step further. I'm now pushing the function references in an array and passing the array in the function.

    public function addItemToLoad (item: URLRequest, notify: Array)

    I realized that I might need to notify several objects of full charge.

    Thanks for your help.

  • passing a value line selection and submit button

    I created a page jsff divided into 2 parts
    Part 1 - contains the table, and on the selection of rows in this table, I want to pass a value to enter text from another jsff page (which is in the second part of the page) and offer a button
    Part 2 of a region
    region contains a page jsff containing an input text and submit button


    So what I want to do is
    on the selection of lines in the above table I want to copy a column value to enter a region below text and also submit a button


    Help, please

    If the two regions share the same control of data you could do so declaratively. check this one... http://andrejusb.blogspot.com/2010_04_01_archive.html

  • unload the movieclip to display rollover buttons...

    Hello :)

    I have a question for you >

    Here's the implementation.

    I have a scene where there are 10 names of artist. Each artist name is a button with a rollover image. The first name of the artist

    has a command uploadMovie in the timeline panel to show an image immediately when the user opens the page.

    _root.attachMovie ("anne_01", "screen", 1);
    _root. Screen._x = 417,9;
    _root. Screen._y = 135,7;

    My question is > how to unload the movieclip when the user scrolls on the nine remaining buttons?

    I know it's a command to unload, but I don't know what the code should be or where I should put it.

    I tried to put a command to unload the other buttons, but I had no luck ~

    Any ideas?

    Thank you in advance!

    Virginia

    to remove this joint use of movieclip:

    _root. Screen.removeMovieClip ();

    (or you could just attach an another movieclip depth 1 to _root)

  • passing a reference structure in a dll (cvi) of EEG, a mistake-17502; System-level exception.

    Creates a container that matches parameter in cvi dll.  I have the container facility by checking the death of struct C using packaging of 8 bytes.  With the help of the adapter of the CVI has created an action.  When the step is executed, I get this error (17502; Except for system-level).

    Have you created a type of data customized to represent the struct (you say that you have created a container)? You specify the field for each variable type structure in the custom data type? You must configure each field to say TestStand what data type to use, for example, a number can be a double, int, short, or char, and TestStand needs to know that in order to create a corresponding structure correctly. Did you create an instance of this type to pass into the dll function? Thanks for posting the definition of structure, you use c if possible, also, please describe exactly how you configured each variable in the definition of type (custom data type), that you have created. If you are able to provide more information, we can try to see if there is a problem with the custom data type configuration.

    You can also take a look at what makes your function, the function code could lead to a breach of access or another exception of system level. You can launch the editor of sequence of CVI process debugging to debug your code module, or change the setting of the ICB card adapter configuration run the code a an external instance of the CVI.

    Hope this helps,

    -Doug

  • Creating and passing the reference to an object in j2me

    Hi, I'm new to Blackberry JDE, I want to know how to create, transmit and receive refernce for an object in Blackberry JDE.

    Exactly as its operation in j2se and Java everywhere else. Each reference to objects in Java is in function, that is to say, saying 'ButtonField f = new ButtonField()', f is a reference to a ButtonField object.

    It's all standard Java.

  • How to pass in addition properties of active nav buttons that I ride on others?

    Hello

    Please visit a site I'm working on:

    http://www.starshelters.co.uk/index.html

    I wish I had that line blue nav bar more dark for the page that you are on the thinner line changes, lighter when you hover over the dens nav - how can I do this? I tried a few things but without success.

    In addition, my container has an expanding box problem and I don't know why.

    Thank you!

    You are a little more zeal with the floats. You have them everywhere & you don't need them.

    Remove float: left of everything, except your navigation and this should work much better.

    What are floats used for?

    Nancy O.

  • Update the reference in the structure of the event

    Hello

    I would really appreciate if someone can help me with the next issue:

    I have a main VI with the structure of the event in the while loop.

    There is a case of a button initiating the Subvi, which extends an engine.

    To stop the loop inside the Sub - VI I pass a strict type reference him out of the main façade of VI.

    The problem is that in the event structure is not updated to reference, i.e. on press the abort button I can't stop the engine.

    The strange thing is that, without the structure of the event (only in time loop) it works. I try to put the button on the outside another loop: it does not depend on it. Without the structure of the event - everything works.

    LabVIEW 2012 32 bit

    Thanks in advance,

    Dirs

    You have the checkbox in the case where the matter set to Lock the front until the end of the case of the event?

    Is the case of the event start quickly, or is it stuck in the Subvi?

    Have you put in custody and recommendations for using events in LabVIEW - LabVIEW 2013 help ?

  • How to do a recursive button event?

    Hello

    First off I'm coding in the Flash animation because it's since doing so AS3, I'm not worrying inheritance at the present time.

    I have a menu of 4 buttons and I try not to be redundant and recursively use the same classes, outside, function clicked for each button by passing its instance via the event handler.

    I had a lot of success in finding the answer except locate a thread on the creation of custom classes... Which would be great, but I don't want to re - create my entire structure now. So I was wondering what might be the best approach.

    Here's the code I worked. If someone could give me an idea of what I could take the direction, I would really appreciate it.

    Thank you:

    function over(evt:MouseEvent):void {}
    evt.target.gotoAndStop (2);
    }
    function out(evt:MouseEvent):void {}
    evt.target.gotoAndStop (1);
    }
    function clicked(evt:MouseEvent):void {}
    evt.target.gotoAndStop (2);
    evt.target.removeEventListener (MouseEvent.ROLL_OUT, out);

    }

    menu_mc.feature1_mc.addEventListener (MouseEvent.ROLL_OVER, over);
    menu_mc.feature1_mc.addEventListener (MouseEvent.ROLL_OUT, out);
    menu_mc.feature1_mc.addEventListener (MouseEvent.MOUSE_UP, clicked);

    menu_mc.feature2_mc.addEventListener (MouseEvent.ROLL_OVER, over);
    menu_mc.feature2_mc.addEventListener (MouseEvent.ROLL_OUT, out);
    menu_mc.feature2_mc.addEventListener (MouseEvent.MOUSE_UP, clicked);

    var lastClicked:MovieClip

    function over(evt:MouseEvent):void {}

    {if(evt.currentTarget!=lastClicked)}
    evt.target.gotoAndStop (2);

    }
    }
    function out(evt:MouseEvent):void {}
    evt.target.gotoAndStop (1);
    }
    function clicked(evt:MouseEvent):void {}

    lastClicked.gotoAndStop (1);

    lastClicked = evt.currentTarget;
    evt.target.gotoAndStop (2);

    }

    menu_mc.feature1_mc.addEventListener (MouseEvent.ROLL_OVER, over);

    menu_mc.feature1_mc.addEventListener (MouseEvent.ROLL_OUT, out);

    menu_mc.feature1_mc.addEventListener (MouseEvent.MOUSE_UP, clicked);
               
    menu_mc.feature2_mc.addEventListener (MouseEvent.ROLL_OVER, over);
    menu_mc.feature2_mc.addEventListener (MouseEvent.ROLL_OUT, out);
    menu_mc.feature2_mc.addEventListener (MouseEvent.MOUSE_UP, clicked);

  • problem with button events

    I have 3 events in a loop each event are air-conditioned with change of the value of a button, so we have 3 buttons in totall, now, when I press each button, each event works fine, but when I press them again once I expect to run again but it isn't so it runs only once , this should an event to just run only once? and the while illtierate only 1 time when 3 buttons value change (when all events are run)

    As well as the validation of your code, don't forget - if you try to use the Boolean controls locked in the Structures of the event, you must place the control inside the structure itself to ensure that it works correctly. Do not do this often can result in behavior that you're talking about.

    For more information on the Structures of the event:

    http://zone.NI.com/reference/en-XX/help/371361J-01/lvhowto/caveatsrecmndtnsevnts/

Maybe you are looking for