Adding a variable an instance name

i have a variable that is my flash movie is retreiving (well,
hopefully....i'm having troubles with the
loadVariables)....anyweezer, the variable is named "id". i would
like to add the value of this variable to then end of a text string
and then use it as reference to an instance name.
for example, i have movie clip with an instance name of
TTMO110333. if the ID variable had a value of 110333, how could i
use that in actionscript to allow me to refer to the latter part of
the instance name with the variable?
something to the effect of....
on(rollOver) {
this."TTMO"+id._visible = true;
}

thanks for your help, but neither solution is working for me.
i think it may be because i'm using this in a function for a movie
clip, to make it act as a button. i am also having problems getting
getURL() to open a blank page inside a function for a movie clip
like this as well. is there something i need to do differently if
i'm trying to apply this to a movie clip? here's my AS....
this.loadVariables("linkCCdisplay.php","POST"); //this gets 3
variables: url1, title1, and id1
TTbutton1.onRelease = function() {
TTbutton1.getURL(url1, _blank);
}; //the "blank in this doesn't work, it goes to the url,
just not in a new window
TTMO110333._visible = false; //this refers to a movie clip
that is on the same stage with an instance name of TTMO110333
myInterval = setInterval (TTMO,15);
function TTMO () {
TTMO110333._x -= (TTMO110333._x - _xmouse)/10;
TTMO110333._y -= (TTMO110333._y - _ymouse)/10-2;
TTbutton1.onRollOver = function() {
this["TTMO"+id1]._visible = true;
} //this refers to a movie clip with an instance name of
TTbutton1, i would like to make the clip visible only while the
mouse is over the movie clip i'm trying to get to act as a button
any ideas on how to solve these problems? thanks again for
your time.

Similar Messages

  • How can we use variables for instance name?

    I'm using 9 textbox in my stage. Names are similar, only difference is the last character. (s1_0, s1_1, s1_2, ...). I'm trying to use these textbox in a loop. But I couldn't find the right typing... s1_[i], s1_(i) or s1_{i} gives error.
      s1_0.text=0
      s1_1.text=0
      s1_2.text=0
      s1_3.text=0
      s1_4.text=0
      s1_5.text=0
      s1_6.text=0
      s1_7.text=0
    how can make the shortest typing for this issue?

    yes, its working, thank you very much...
    I tried array operator but the word "this"..
    what does it means ? when I delete this word, it gives error. how does flash know that it is a instance name?

  • Preventing file extensions being added to variable text (File Name)-

    …when one imports one INDD file (v5 or 6) into another. We have the variable text specifications set to exclude file extensions. The .indd does not publish in the originating document.
    We use INDD import and the text variable "File Name" quite a lot.
    TIA-
    -Todd

    I think he's saying that when you open an ID doc, the filename variabe inside can be set to report just the name, but when you import that same doc into another ID doc, the filename variable shows the ".indd" extension.
    EDIT: Yes, that is (stupidly) how it seems to work. No idea how to fix it though. Suspect Adobe has to issue an update.

  • Appending variable to instance name

    Hi,
    I have a very basic question. I am trying to get all the button instances to become invisible on the screen. They are named img1 to img30. I thought of using a while loop to quickly run through them. The code within img1 button is:
    var i:Number = 2;
    while(i<=30) {
    img2._alpha = 0;
    i++;
    The problem is how do I append the i after img, to replace the 2? so that the code runs through img 2 to img 30. I know the answer might be simple, but I really could use some help here.
    Thanks

    Try:
    var i:Number = 2;
    while(i<=30) {
    _root["img"+i]._alpha = 0;
    i++;

  • 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

  • Using a variable in an instance name

    Hey all,
    Simple question:
    I'm trying to use a variable to call on different instance names:
    var picCaller:uint=2;
    material_mc.addChild(pic_""+picCaller+"");
    The code in red is the issue in question.  In this example, I'm trying to add a child called "pic_2", with the number two called from the variable "picCaller"
    Any assistance is greatly appreciated.
    Thanks!

    Just for context, here is what I'm trying to do:
    I have jpegs in my library and I want to add them to the stage when they're needed, so just to add one image, here is the code I have:
    var pic_1=new pic1(0,0);
    var image_1:Bitmap=new Bitmap(pic_1);
    material_mc.addChild(image_1);
    I want to put the above into a loop so that I dont have to repeat those three lines for every image in my library like so:
    var pic_1=new pic1(0,0);
    var image_1:Bitmap=new Bitmap(pic_1);
    var pic_2=new pic2(0,0);
    var image_2:Bitmap=new Bitmap(pic_2);
    var pic_3=new pic3(0,0);
    var image_3:Bitmap=new Bitmap(pic_3);
    var pic_4=new pic4(0,0);
    var image_4:Bitmap=new Bitmap(pic_4);
    var pic_5=new pic5(0,0);
    var image_5:Bitmap=new Bitmap(pic_5);
    var pic_6=new pic6(0,0);
    var image_6:Bitmap=new Bitmap(pic_6);
    var pic_7=new pic7(0,0);
    var image_7:Bitmap=new Bitmap(pic_7);
    the variable "picNum" is the total amount of images that in the library, each one exported as "pic1", "pic2", "pic3" respectively.
    var picNum:uint=7;
    var picCaller:uint=1;
    var  picMC:MovieClip = new MovieClip();
    picMC=this["pic_"+picCaller];
    for (var  i:int = 1; i <= picNum; i=i+1)
         var "pic_"+i = new image_i(0,   0);
         var image:Bitmap = new Bitmap("pic_"+i);
    Thanks so much for your help.

  • Reference a movieclip by a variable containing its instance name?

    There are some movie clip instances on the stage (not
    dynamically created at run time). Now, I want to do this:
    use a variable to hold a instance name at runtime. then use
    this variable to reference the movie clip it points to.
    Problem: suppose this variable is named "mc_ref". it fails to
    use "_root.mc_ref" to refer to the movie clip by the name that
    mc_ref contains. it seems in this case flash takes "mc_ref" as
    instance name and thus looks for any child by that name. since
    mc_ref itself is not a name, this will not work.
    is there something like MovieClipbyInstanceName function for
    this? Any thoughts? Thanks!

    you're confused. the variable's name and the movieclip's name
    should not be the same.
    the following are correct ways to reference movieclips in
    flash:

  • Referring to instance names with variables

    I have the following problem. I have two movie clips with the
    instance
    names inst01 and inst02.
    I have the code :
    _root.inst01._alpha += 10;
    Now sometimes I would like it to be for "inst01" and others
    "inst02".
    Is there a way that I can just say set a variable like :
    currentinst = "inst01"
    or
    currentinst = "inst02"
    And then write the code as:
    _root.currentinst._alpha += 10;
    Would this work, how would Flash know whether "currentinst"
    was an
    instance name or a variable name?
    THANK!
    Tim

    Thanks!
    I had actually just figured it out, I have to use the array
    brackets,
    thanks so much!
    In article <ess33h$d73$[email protected]>, "David
    Stiller"
    <[email protected]> wrote:
    > Tim,
    >
    > > Is there a way that I can just say set a variable
    like :
    > >
    > > currentinst = "inst01"
    > > or
    > > currentinst = "inst02"
    >
    > There is.
    >
    > > And then write the code as:
    > > _root.currentinst._alpha += 10;
    >
    > The problem with that, as is, is that the variable
    currentint currently
    > refers to a string, and the String class has no such
    property as _alpha.
    > You need to "translate" that string into an actual
    object reference, and
    > there are two ways I know of to do that, both described
    here.
    >
    >
    http://www.quip.net/blog/2006/flash/actionscript-20/reference-objects-dynamically
    >
    >
    > David Stiller
    > Adobe Community Expert
    > Dev blog,
    http://www.quip.net/blog/
    > "Luck is the residue of good design."

  • Simple math and a variable in an mc instance name

    i have several movie clips with instance names in the format
    of screened1, screened2, screened3, and so on. i am trying to
    reference a movie clip as shown below, but it's not working. what
    am i doing wrong? how do i fix it?
    this.screened[numOfItems-8].transform.matrix = F1toP0;
    the transform, matrix and all of that works fine. but when i
    add the information between [ ] to make reference to the movie clip
    instance name, no go. numOfItems is a number, and when run trace on
    it.... it does return a value in the output.

    right on. my favorite flash genius. thanks again!

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

  • Adding dynamic variables

    I remember reading somewhere how you can add variables building on the fly but can't find any references. What I have is a MovieClip in my library. I will use it to create several Menu Items.
    This is what I have written:
    LessonButton = new mcLessonBtn();
    LessonButton.name = "menuLesson"+i;
    this.addChild(LessonButton);
    Thanks

    I would guess that you are creating as many of them as you expect but you are only seeing the last because they sit atop one another.  Try adding something like the third line I show in the loop below and you should see them all.
    There are probably a few ways to approach this, so here's one.  Declaring the var outside the function isn't going to help you get a handle on anything outside the loop except the last one created, so using the "name" property can work.  But in AS3, the name is just that, a property, it is not the instance name so you cannot target it that way... using the bracket notation won't work as you tried.  You need to use the getChildByName() method to be able to target an instance using its name property.
    But when you create each LessonButton in that loop, you don't need any indirect reference because the one just created is directly accessible by that variable name (see the last line in the loop).
    for(var i=0; i<LessonTitles.length; i++)
         var LessonButton:mcLessonBtn = new mcLessonBtn();
         LessonButton.name = "menuLesson"+i;
         LessonButton.x = i*100; // do this to see all you create (just to see them all)
         this.addChild(LessonButton);
         LessonButton.Lesson_txt.text = LessonTitles[i];
    Another approach to this could be to store the instances in an array.  That way you can access them directly that way. Just as an example, the second loop is just as well done in the first...
    var lessonBtns:Array = new Array();
    for(var i=0; i<LessonTitles.length; i++)
         lessonBtns[i] = new mcLessonBtn();
         this.addChild(lessonBtns[i]);
    // and to manipulate them later on...
    for(var k=0; k<LessonTitles.length; k++)
         lessonBtns[k].x = k*100;
         lessonBtns[k].Lesson_txt.text = LessonTitles[k];

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

  • Unknown variable or property name 'ReportFilePath'. Error accessing item 'Runstate.Root.Locals.ReportFilePath'. in TestStand

    Hi all.
    I was using Teststand 4.2 up to last week and upgraded to TS 2013. In 4.2 I was using the following to get the location of the teststand report:
    Runstate.Root.Locals.ReportFilePath
    but with TS 2013 this no longer works.. is the following error:
    Unknown variable or property name 'ReportFilePath'.
    Error accessing item 'Runstate.Root.Locals.ReportFilePath'. in TestStand - Get Property Value (String).vi->
    I've tried the following now with no success:
    RunState.Root.Report.Location
    So my question is how can I get the location (path) of the report file during test programmatically please?
    Please find enclosed a screenshot of the report config:
    Solved!
    Go to Solution.
    Attachments:
    TS_ReportConfig.png ‏42 KB

    Shashidhar,
    Thanks for your help! With your tips, I finally got it to work. For anyone else trying to modify report names based on user input after the sequential process model sets the file name path I will re tell what I did:
    Edit the Ni_RerportGenerator.seq plugin found in C:\Program Files (x86)\National Instruments\TestStand 2014\Components\Models\ModelPlugins\
    You go into this file and add the step higlighted in Blue at that same location. Please see the expression I typed in the expression box. Setting Parameters.ReportOptions.NewFileNameForEachUUTStatus to true forces re-evaluation of the report name at the end of the sequentialmodel.seq.
    Then you add a FileGlobal in the sequenatialmodel.seq. I called my FileGlobal ReportFileName
    Then I added an expression in my test sequence that modified the the new FileGlobal I created:
    Finally I updated the report options (Go to Cofigure>Report Options > Report File Pathname and under File/Directory Options select "Specify Report File Path by Expression" and I entered my expression. It appears that you can disregard the evaluated report file path error (box below) because your pathname won't be generated until run-time.
    This worked well for me hopefully it will for others. 
    Thanks,
    Marco

  • Service name or instance name is not specified

    Hi,
    I am adding third node in oracle 11gr2 on rhel.i have successfully configureg grid and oracle but while adding an instance using dbca i am getting an error "service name or instance name is not specified".I have already expot ORACLE_SID=dev but still getting an error,can anybody suggest me on the same...

    [grid@rac2 bin]$ env
    HOSTNAME=rac2.raczone.com
    SHELL=/bin/bash
    TERM=xterm
    HISTSIZE=1000
    KDE_NO_IPV6=1
    QTDIR=/usr/lib/qt-3.3
    OLDPWD=/raczone/grid_home/network/admin
    QTINC=/usr/lib/qt-3.3/include
    USER=grid
    LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
    KDEDIR=/usr
    MAIL=/var/spool/mail/grid
    PATH=/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/grid/bin
    INPUTRC=/etc/inputrc
    PWD=/raczone/grid_home/bin
    LANG=en_US.UTF-8
    KDE_IS_PRELINKED=1
    SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
    SHLVL=1
    HOME=/home/grid
    LOGNAME=grid
    QTLIB=/usr/lib/qt-3.3/lib
    CVS_RSH=ssh
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    DISPLAY=:0.0
    G_BROKEN_FILENAMES=1
    _=/bin/env
    [grid@rac2 bin]$

  • Which file decide instance name in RAC 10g ?

    Which file decide instance name in RAC 10g ?
    How does RAC know which instance should start from which machine?
    Thanks.

    The spfile is NOT the correct answer, actually.
    1. The instance name for any Oracle instance, whether in a RAC or not, is derived from the value for the ORACLE_SID parameter which is in force at the time the startup command is issued. If you were to:
    export ORACLE_SID=SALES
    sqlplus / as sysdba
    startup...you would just have created an instance called SALES.
    2. The spfile (or init.ora if you're not using an spfile) contains a parameter called INSTANCE_NAME. That defaults to whatever ORACLE_SID is set to as an environment variable when the instance is started, hence point 1 above. But you can force an instance to acquire a non-SID name by deliberately setting it to something different. That's unusual to do, though, except in a RAC context where you want to subvert the default load balancing mechanism.
    2b. The spfile (or init.ora) also contains a parameter called DB_NAME -but that is the name of the database, not the name of the instance, and is therefore irrelevant for the purposes of working out how instances get their names,
    3. Neither of the above answers has got anything to do with RAC knowing what instance runs on which machine. That is the job of the Oracle Cluster Registry file (OCR), for which you have to provide about 100MB of space on a shared hard drive during the RAC installation itself.
    You populate that file by running DBCA to create your RAC instances (and DBCA then automatically updates the OCR to record the fact that it created instance X1 on Node A and X2 on Node B, and therefore that's what will happen in the future unless you change things).
    Or you can update the OCR yourself by using the SRVCTL utility. You'd do something like: srvctl add instance -d DB1 -i X3 -n C (add an instance called X3 to run on Node C as part of database DB1).
    A little more details about the OCR is available in Section 13 of this article, for example: http://www.dizwell.com/prod/node/26?page=0%2C5

Maybe you are looking for

  • What is the easy way to create a crossword with InDesign CS5 for a interactive pdf?

    I mean I want to create a pdf magazine and i like to include a crossword. I read somewhere that one way is create a crossword with an external software and include it in the ID project but I don't know any crossword software and if I add in my ID pro

  • HT4550 Is it possible to sync Reading List using iTunes?

    I don't have iCloud as I'm running Snow Leopard. My bookmarks are currently being synced via iTunes but I'm not sure if I can do the same with Reading List.

  • How to write json body for multiple list items to write in a list.

    Hi, I am trying to create list items using REST API, and I am reading the data from Sales force and writing it to the list. For wring sigle item its working fine, but if i am trying to insert multiple data to the list using rest API I am getting bad

  • Extension For CF MX7

    I just got Studio 8 and downloaded without any problems. I have been doing the "ColdFusion MX 7 Getting Started Experience" However, with the Extranet applications exercise I have had hard time to download the extension ("DWMX2004ExtensionsForCFMX7")

  • Java.lang.NoSuchMethodError: getMessageData

    I got this error while trying to send to Websphere MQ 5.3 from WSAD 5.1. I use a statelesssession bean to send the message. Do you have any ideas? java.lang.NoSuchMethodError: getMessageData at com.ibm.mq.server.MQSESSION._MQPUTMSG2(Native Method) at