Pass button instance name to a function when button is in ScrollPane?

I have a ScrollPane component which holds a movieclip from my
library. I am trying to set up a funtion to read the
movieclip.button instance name when I click a button. On a trace,
all I receive is "spContentHolder."
How can I capture the button instance name when the button
resides inside the scroll pane?
Thanks.

path.scrollpaneinstance.spContentHolder will reference a
movieclip added to your scrollpane IF you used your scrollpane's
contentPath to add a movieclip to the scrollpane. from there,
reference any child buttons/movieclips like you normally
would.

Similar Messages

  • Pass symbol instance name to variable

    Hi all,
    I'm trying to figure out how to pass the instance name (ID) of a clicked object to a variable so I can navigate to a label on the timeline with the same name.
    So far I've tried different variations of:
    sym.getSymbol() //logs as "undefined"
    sym.getSymbolTypeName // logs the symbol name in the library, not the instance
    Any ideas?
    Thanks
    -Dave

    Sweet!
    That worked - Thanks! I ended up combining both your suggestions. on the button symbol i have
    sym.getComposition().getStage().onClick(e.target.id);
    and then after compositionReady I added a function to split out the second name and logged it to test;
    sym.onClick = function(targetId){
              var names = targetId.split("_");
              console.log(names[1]);
    Works perfectly! - Although it would be nice if the EA team could fix that functionality in future releases so e.target.id gives you just the id for the selected symbol. I would think if you can write something like getSymbol("mySymbol") it should be just as easy to get that name without all the extra (Stage...etc)
    Thanks again!
    -David

  • Instance names and loadClip

    I am trying to load a swf containing a draggable border movie
    clip using MovieClipLoader.loadClip(). I have a mc on the stage
    called "application" with an empty mc inside called
    "appContainer2". The swf is loaded using the code:
    var myMCL:MovieClipLoader = new MovieClipLoader();
    var myListener:Object = new Object();
    myMCL.addListener(myListener);
    myMCL.loadClip("coachapp.swf", "application.appContainer2");
    The draggable border has an instance name of "dragBar" in the
    coachapp.swf. The movie clip loads but the code:
    this.application.dragBar.onPress = function():Void{
    application.startDrag();
    is not working. The draggable border is surrounding a form
    which needs to be functional. All this code appears in the first
    frame of the top level. Do instance names not carry over when using
    loadClip, or is there something else I am missing?

    your path to dragBar is incorrect, no matter where that code
    is located.
    if dragBar is on the main timeline in coachapp.swf, you
    should be use the following path from the timeline that contains
    application in your main swf:

  • Instance Name Question

    I have a movieclip that is added to the stage in the authoring environment. I gave it an instance name of myInstance.
    When I trace the instance name, it gives me Instance12.
    Why is that? How can I change the instance name that dropTarget.name returns without removing all my instances from the stage, instantiating them with actionscript, and renaming them then (with 250 instances that have to be in exact pixel locations that would be a huge inconvience bordering on the impossible, especially if I ever have to move even one of them.)
    If the dropTarget is another movieclip assigned to a class, is there any way to use dropTarget to access a parameter from within that class? (i.e., dropTarget.myVariable the same way you might use myObject.myVariable)?
    Does that make sense?
    Thanks!!

    I tried this:
                trace (GeoPuzzle(this.dropTarget).abbrev);
    But I got this error:
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Shape@d25c061 to com.freerangeeggheads.puzzleography.GeoPuzzle.
        at com.freerangeeggheads.puzzleography::GeoPiece/geoPieceEnd()[/Users/Amber/Documents/Apps/P uzzleography/Project/com/freerangeeggheads/puzzleography/GeoPiece.as:51]
    When I trace this.dropTarget.parent.name I get the actual instance name of the movie clip on the stage.
    Is there a tutorial or something that will explain this heirarchy to me? I don't even know what to google, and navigating Adobe's documenation is like trying to nail jello to a tree. :/

  • Using and storing instance names

    I know you can store instance names in an array and call on the array values to reference the instance names in it.
    I was wondering if there is any way I can take an instance name, feed it directly into a function and use the name of the function variable/array/whatever to affect the object instance of whatever I name.
    if it's an array of instance names, what is it actually an array of?
    Also, is there any way to hold and reference an instance name in a single value?
    sidenote:
    this doesnt have much to do with my question, but can arrays be fed directly into the header of a function?

    Look, there is no any ambiguity in what array holds - it is what you make it hold.
    If you are talking about instance names as strings, the following can be done (given objects with instance names are instantiated);
    var myInstanses:Array = ["instance1", "anotherInstance", "myMovie"];
    than you can feed instance name onto a function and do whatever you need to:
    function myFunction(instanceName:String):void{
         this[instanceName].x = 200;
    myFunction(myInstances[1]);
    But if you are talking about instances as instances - not names:
    var myInstanses:Array = [instance1, anotherInstance, myMovie];
    function myFunction(instance:Sprite):void{
         instance.x = 200;
    myFunction(myInstances[1]);

  • ? Derive a clicked button's 'level' and instance  name?

    I am trying to do something that I did quite often in Flash.
    When a button is clicked, I need to understand it's instance name
    and heirarchy as the application would identify it when looping
    through the DisplayList.
    For example, if a button, 'myButton', is clicked on in the
    application ' myApp', I need to get its programatic name as
    referenced by the application with 'myApp0.myButton'.
    In Flash, with AS2, I could have the button tell me its
    programatic name with:
    myButton.onRelease=function(){
    trace(this);
    The result in Flash would be '_level0.myButton';
    How can I get this type of informtion with Flex? Is it
    different with MXML and AS3?
    For reference, I am using a similar function to that below to
    'index' the list of objects in Application.application:
    function traceDisplayList(container:DisplayObjectContainer,
    indentString:String = ""):void {
    var child:DisplayObject;
    for (var i:uint=0; i < container.numChildren; i++) {
    child = container.getChildAt(i);
    trace (indentString, child, child.name);
    if (container.getChildAt(i) is DisplayObjectContainer) {
    traceDisplayList(DisplayObjectContainer(child), indentString
    + " ")
    Any information and examples would be appreciated.
    Thank you.

    Ok, I found a partial solution, but I could still use some
    help with event listeners. The solution I found is:
    Within Flex, on a button click, the application can list the
    click target when an event is called. So, when a user clicks a
    button, in the 'click' action of the button, the following code
    will return the object information I was looking for.
    <mx:Button label="myButton"
    click="trace(event.currentTarget)"/>
    Now I am interested in seeing if I can dynamically "listen"
    for clicks without adding an event command to the buttons. For
    instance, on the button above, I can have the button tell me its
    name, as shown above, or I could listen for the click and derive
    it. For example:
    <mx:Button label="myButton"
    click="trace(event.currentTarget); sayName(event)"/>
    Then I can have AS code listening for that event:
    private function sayName(event:MouseEvent):void {
    trace(event.currentTarget);
    The problem with the listener solution 'sayName', is that it
    requires a button to pass the event to 'sayName()'. I am really
    looking for a solution which listens for ANY button click, checks
    to see if it is a button, or a text link, or any object that might
    act as a button (as opposed to a graphic or movie without 'semantic
    events' with the application performing a resulting action).
    So this is what I have tried:
    In an AS Class, I added the following to the main class
    function to initialize it:
    addEventListener(MouseEvent.CLICK, clickHandler);
    addEventListener(MouseEvent.DOUBLE_CLICK,
    doubleClickHandler);
    Then, within the class I added the following functions:
    //possible event listeners?
    private function clickHandler(event:MouseEvent):void{
    var tempES:String = "type : "+event.type+" objectName :
    "+event.currentTarget;
    trace(tempES);
    private function doubleClickHandler(event:MouseEvent):void{
    var tempES:String = "type : "+event.type+" objectName :
    "+event.currentTarget;
    trace(tempES);
    I get nothing. I suspect that I get no results because the
    Application has the buttons and these listeners are not referencing
    the application properly to listen for button clicks.
    Am I off base? Can anyone help me understand how to listen
    for click activity and get the object information even though the
    listener code is in an imported class?
    Thank you

  • Buttons null; losing stage instance names

    Hello, I apologize if this question has already been asked but as the title states I'm having problems with the instance names of my buttons. I am using Actionscript 3 with Flash CS5. I apologize in advance for being verbose but it'd be best if I explained my problem in detail.
    I have my project set up so that everything occurs in one MovieClip and buttons within the MovieClip are clicked to navigate through the MovieClip. The MovieClip contains several frames which are all unique and contain a variety of textboxes, MovieClips, buttons, classes and other custom classes. All of these components are created directly in Flash Professional by dragging them from the library onto the stage inside of the MovieClip.
    I then name these components using Flash Professional and use these instance names to work with the components. Usually this works without a problem. However, now that I am using a nested MovieClip for my project many problems are occuring. I have it so that when buttons are clicked, the MovieClip goes to a certain frame via the gotoAndStop(x); command. This works fine but I am having problems accessing the buttons that I have named earlier. It gives a null object reference error and when I trace the button it traces as "null".
    Originally I thought that this problem was because the MovieClip had not yet initialized but I had used the ADDED and RENDER event listeners, Timeline scripting, and other methods but the button was still null, leading me to believe that the problem was more than that.
    So I used a click event listener that traced the instance names of the components that I was clicking (trace(e.target.name)). I have a total of 8 buttons on the specific frame of my MovieClip so I clicked on them all. 6/8 of the buttons traced the correct instance name that I had given them whereas the other two buttons traced "instance 169" and "instance 177" instead of the instance name.
    With all this strangeness, I commented out the code for these 2 specific buttons to see if it would work without them. Sure enough it did.
    I believe that my buttons have lost their stage instance names and I do not know how to fix this problem. I have tried deleting the buttons and creating them again but to no avail. It does work, however, if I use the Button component that Flash has but I do not want to do that because I'd like to use my own custom buttons (I know the Button component is customizeable, but I'd like to use my own anyways).
    If anyone could help, please how can I fix this problem? If my .fla or specific code needs to be provided, I can do so.

    Without looking at your code I can't say 100% what is going on. However, I suspect what is happening is that you're doing the following:
    Your button is on stage in frame 1
    You add an event listener to that button
    At some point, you go to a frame where the button does not exist.
    When you come back to frame 1, your listener doesn't work anymore
    Or some variation of above, where an instance was on the stage, is removed, and even though it appears to have been added back you can't reference it anymore.  I've discussed fixes for this issue in depth in this article, but it all boils down to the fact that when the object is removed from the stage the variable that contained the instance the first time will go to null, and then when you go back to the frame with the instance on it, the variable will be populated with an instance which is probably not the same as the first one.
    If the problem is what Ned Murphy speculated, you can easily fix it by setting mouseChildren to false on the buttons.

  • Passing function name into another function?

    Hi
    I have a movieclip prototype thats scales and moves any
    movieclips depending
    on the parameters passed in. I want to be able to pass in a
    function name
    that is executed when the main function has finished. The
    problem is the
    line of code that calls the main function executes the
    function name that I
    m trying to pass in as a parameter. Is there something I m
    missing?
    see my code below:
    "mcMainAnimation.moveFadeTransform(0, mcMainAnimation._y,
    -100,
    mcMainAnimation._xscale, -30, 50,moveToX());"
    MovieClip.prototype.moveFadeTransform = function(t, oldY,
    diffY, oldScale,
    newScale, tTime, funcToCall) {
    this.onEnterFrame = function() {
    t++;
    if (t<=tTime) {
    this._y = easeIn(t, oldY, diffY, tTime);
    this._xscale = easeIn(t, oldScale, newScale, tTime);
    this._yscale = easeIn(t, oldScale, newScale, tTime);
    } else {
    t = 0;
    funcToCall;
    this.onEnterFrame = null;
    moveToX = function () {
    trace("called");
    Thank in advance
    Shaun

    Hi!
    Try to modify code to:
    mcMainAnimation.moveFadeTransform(0, mcMainAnimation._y,
    -100,
    mcMainAnimation._xscale, -30, 50,moveToX);"
    ... so don't use () at end of function. That should do the
    trick.
    Also, you need to add the () to funcToCall, so that instead
    of:
    t = 0;
    funcToCall;
    this.onEnterFrame = null;
    you should have
    t = 0;
    funcToCall();
    this.onEnterFrame = null;
    /Jensen/
    "forums.macromedia.com" <[email protected]>
    wrote in message
    news:e6m428$qa0$[email protected]..
    > Hi
    >
    > I have a movieclip prototype thats scales and moves any
    movieclips
    > depending on the parameters passed in. I want to be able
    to pass in a
    > function name that is executed when the main function
    has finished. The
    > problem is the line of code that calls the main function
    executes the
    > function name that I m trying to pass in as a parameter.
    Is there
    > something I m missing?
    >
    > see my code below:
    >
    > "mcMainAnimation.moveFadeTransform(0,
    mcMainAnimation._y, -100,
    > mcMainAnimation._xscale, -30, 50,moveToX());"
    >
    > MovieClip.prototype.moveFadeTransform = function(t,
    oldY, diffY, oldScale,
    > newScale, tTime, funcToCall) {
    > this.onEnterFrame = function() {
    > t++;
    > if (t<=tTime) {
    > this._y = easeIn(t, oldY, diffY, tTime);
    > this._xscale = easeIn(t, oldScale, newScale, tTime);
    > this._yscale = easeIn(t, oldScale, newScale, tTime);
    > } else {
    > t = 0;
    > funcToCall;
    > this.onEnterFrame = null;
    > }
    > };
    > };
    >
    > moveToX = function () {
    > trace("called");
    > }
    >
    >
    > Thank in advance
    >
    > Shaun
    >

  • Get error when passing a server name to Crystal Report

    I am developing a desktop application using VS 2012 with CRforVS_13_0_9 and CRRuntime_64bit_13_0_10 installed.  The database is SQL Server 2012 Express.  I use SQL OLEDB in Crystal Report to connect the SQL database.  Here is part of the codes.
    Dim crTableLogoninfo As New TableLogOnInfo
    Dim crConnectionInfo As New ConnectionInfo
    Dim crTables As Tables
    Dim crTable As Table
    With crConnectionInfo
    .ServerName = Login.sServer
    .DatabaseName = Login.sDatabase
    .UserID = Login.sDBUserID
    .Password = Login.sDBPassword
    End With
    Try
    crTables = CReport.Database.Tables
    For Each crTable In crTables
    crTableLogoninfo = crTable.LogOnInfo
    crTableLogoninfo.ConnectionInfo = crConnectionInfo
    crTable.ApplyLogOnInfo(crTableLogoninfo)
    Next
    CrystalReportViewer1.ReportSource = Nothing
    CrystalReportViewer1.ReportSource = CReport
    I get an error "Failed to open connection -- Database vendor code 17" when I run a Crystal Reports through my application.  The problem is Crystal Reports does not like the server name which is passed.  The purpose for passing a server name is to connect to different server if needed.  I am not 100% sure the error occurs after VS 2012 or SQL Server 2012 express was updated.
    Any ideas how I can fix this problem?
    Thanks,
    John

    Hi John
    First, you want to check the error code in your database documentation. The error is being passed from the db client through the report engine totally unmodified. Googling the error will also be a good idea.
    And, seeing as you are using SQL Server 2012, make absolutely sure that the SQL Native 11 client is installed.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • "Install button" doesn't function when updating to 10.6.1 or 10.6.2

    The main problem is my "install" button simply doesnt trigger any response, it is highlighted and has the click animation but, again, heeds no effects. Nothing happens.
    I recently installed snow leopard and there were quite a few problems but I have read that most of which can by solved by simply installing the updates. This is where the aforementioned problem is such an obstacle in my plight.
    I have downloaded both DMG (6.1 and 6.2) files, repaired my start up disk and rebooted in safe mode and have tried restarted repeatedly for about 9 hours now. I have searched and havn't found any posts or topics with a problem quite like mine. I simply cannot install the updates I have already downloaded.
    It is notable to mention that I downloaded these from the actual apple website not from my "software update" listing because those buttons dont function when I attempt to download an update either. The menu toggles back and from from the option where I hit "continue" and "agree" to the terms, that is to say, that each button activates the page that preceded it to come back up. Its a never ending cycle.
    Please help.

    this may happen if you are using a custom keyboard layout. delete the file /Users/username/Library/Preferences/ByHost/com.apple.HIToolbox.* and log out/in and try installing updates again.

  • Dynamic text in buttons : instance name goes "instanceX"

    Hi,
    Another weird one (for me at least !)
    I've added a dynamic text to a button and named it, say,
    myTxt.
    If I put this button on stage as a movieclip I can target
    text as
    :_level0.btn1.myTxt
    If I put the button on stage as the button it really is,
    debugger tells
    me text instance is now : _level0.btn1.instance1
    Why ?
    Thanks in advance.
    PJ

    because buttons aren't movieclips and don't have timelines.
    so you can't reference items on, what appears to be a button
    timeline, with normal dot notation.
    the only real mystery is why flash allows you to apply an
    instance name to an object on that button's pseudo timeline.

  • Event Viewer cannot open the event Log or Custom view. Verify that the Event log service is running or query is too long. The instance name passed was not recognized as valid by a WMI data provider(4201).

    "Event Viewer cannot open the event Log or Custom view. Verify that the Event log service is running or query is too long. The instance name passed was not recognized as valid by a WMI data provider(4201)"
    This error keeps cropping up now and again on most of our domain controllers (OS-2008 AND 2008R2)...Usually a restart fixes the issue however the issue repeats and security logs don't generate.
    Any advice on how to fix this issue permanently would be greatly appreciated.

    Please see this: https://social.technet.microsoft.com/Forums/windows/en-US/95987ca3-a1b2-4da6-95b7-d825d06cdac7/error-code-4201-the-instance-name-passed-was-not-recognized-as-valid-by-a-wmi-data-provider?forum=w7itprosecurity
    You can also try rebuilding the WMI repository: http://blogs.technet.com/b/askperf/archive/2009/04/13/wmi-rebuilding-the-wmi-repository.aspx
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • On my ipod touch, when i go on my game it pops up with a message saying "FlurryAppCircle: Attempting to pass blank hook name to getOffer. Please use a non-blank string for hook name" what does it mean?

    on my ipod touch, when i go on my game it pops up with a message saying "FlurryAppCircle: Attempting to pass blank hook name to getOffer. Please use a non-blank string for hook name" what does it mean?

    Try:
    iOS: Troubleshooting applications purchased from the App Store
    Contact developer/go to their support site.

  • Button using changing Instance Names

    I have multiple button using the same button from my library.
    I have given the all instance name and if I put that instance name
    in from of my addEventListener the button works fine. However, I
    have a lot of buttons on the stage so I want to be able to write
    some thing the will get the instance name on roll over and place
    that in front of the event listener. I am trying to avoid writing a
    line of code for each button. Can this be done?

    you should start here:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/
    go to packages->statements, keywords, & directives
    you can't just ask what a for loop is. it shows you haven't
    done any investigation at all as that is a very basic programming
    construct. you need to learn some basics before you ask people what
    to do. if you have trouble with a particular topic or getting
    something to work, that's what this is for, but it's not to teach
    you the language. there's way too much to learn and too many people
    asking. get a good actionscript book and it will take you through
    the basics.
    i recommend:
    O'reilly Essential Actionscript 3
    good luck

  • Trouble referencing instance name from different frame

    Newbie here. All my code is in frame 1 and is working fine except for one onRelease event. In frame 20 (labeled "gameOver") there is a button which has an instance name of btnQuit. I want that button to do something onRelease. The code works fine if I put it inside the button like so: on (release) {......etc. But I would like to have all my code in frame 1 in a timeline called "scripts".
    I think I'm missing something to reference the button's instance name (maybe a "_root", or "this", or some of those things that I don't fully understand).
    Here's the code that works when put in frame 20 inside the button, but not in frame 1 in a different timeline:
    btnQuit.onRelease = function () {
      // Calculate elapsed time
      var now = new Date()
      var elapsedTime = now - startTime; // startTime set beforehand
      var strTime:String = Math.floor(elapsedTime / (1000 * 60 * 60)) + ":" +
       (Math.floor(elapsedTime / (1000 * 60)) % 60) + ":" +
       (Math.floor(elapsedTime / (1000)) % 60);
      // Send data to PHP
      dataOut = new LoadVars();
      if ( finalScore > 89 ) {
        dataOut.passed = '1';
      } else {
        dataOut.passed = '0';
      dataOut.score = finalScore;
      dataOut.time_spent = strTime;
      dataOut.send("lesson.php","_self","POST");

    The button has to be in the presence of the code when the code is executed.  So you either need to have that button in frame 1 or have that code in frame 20.  You could have it in frame 1 and turn it invisible until frame 20 if that is an option.

Maybe you are looking for

  • Macbook pro mid 2012 backing up from disk ulitiy asking for "login" keychain?

    I bought a "WD My passport For Mac 1TB" portable external hard drive since I can't get into my macbook pro mid 2012 10.9 because when I turn it on its just grey screen with apple logo and spinning wheel. I went to future shop to the geek squad and th

  • HT5457 updated to 6. now music won't shuffle how do I fix this?

    How do I get my music (playlist) to shuffle.  I upgraded to 0s6 and now music does not shuffle

  • Grouping Anchored Objects

    I have an anchored graphic image (using Object, Anchored Object, Insert) and need to add a text box under the graphic and a rectangle frame with a stroke on top of the image to highlight a portion of the image. What I would love to do is anchor the g

  • No "touch to return to call" option in Jabber for iPhone

    I noticed that when I'm in a Jabber call and I press the home button on my iPhone, the call stays up audio only but there is no indication on the iPhone that I'm still in a call.  When you are on a regular PSTN call on iphone and you press the home b

  • Relation-Ship between Personal Area & Bussiness Area

    Hello Everone, can any one pls help me out with one of my query . the query is, i want the releation-ship  between Personal Area and Bussiness Area and on which table do i find it ???? waiting for ur Response Rakesh Edited by: Rakesh Barthwal on Jan