Define the actions of the buttons inside a loop for

Hi, me again ^^
This round is:

I got a set of buttons and a text field where they load the content.

I try to take a zillion functions and keep the neat code so I guessed I'd try set the actions to the buttons in the loop too. First of all, I had a few problems to the I counter inside the function onRelease (in fact I don't think I've ever had how do). But I tried this and it worked:
Stop();
var comprarXML = new XML();
comprarXML.ignoreWhite = true;
comprarXML.load('flash/comprar.xml');
comprarXML.onLoad = checkLoading;
function checkLoading (success) {}
rootNode = comprarXML.firstChild;
ButtonReleaseAndContent ();
}
function ButtonReleaseAndContent () {}
for (i = 0; I < 12; i ++) {/ / my buttons are not dynamically generated, which is why the County.}
btTemp = eval ('content.test.bt' + i);
btTemp.txt.htmlText = rootNode.childNodes [i + 1].firstChild.firstChild.nodeValue;
btTemp.temp = rootNode.childNodes [i + 1] Sublst.ChildNodes(1).ChildNodes(0) [1].firstChild.nodeValue;
btTemp.onRelease = function () {}
this.temp = content.test.test.htmlText;  the problematic line
}
}
}
On line where I put the text, I had one if "uh Yes, I may be refer to in the mc button, because the generated code goes in! So, I tried the this.temp, guessing it would be equal to the level of the key. A few seconds later I noticed that my SEO for the text field was not coming in the button, but the root. So I have no idea why this works. Anyone know what I did?

If btTemp is a movieclip to assign dynamic properties (such as temp).  You can then retrieve this property when the button is released.

Tags: Adobe Animate

Similar Questions

  • Cursor inside a loop FOR?

    Hello

    We will declare or define a cursor inside a loop FOR?

    -Vijay

    Yes, it is possible that the definition take place inside the part of the plsql block code, the syntax looks like:

    for rec in (/*here you define cursor with select query*/) loop
      ...
    end loop;
    

    I think that if you do not use a variable/slider several times, it is advisable to set the cursor with the loop for. If you want to use the cursor over a school then it should be defined in more global place.

  • cannot commit a transaction inside a loop for

    Hello

    cannot commit a transaction inside a loop for

    user9093700 wrote:
    Hello

    cannot commit a transaction inside a loop for

    Yes you can engage inside the LOOP.
    You can sink also you into the eye with a sharp pencil,
    but none of the measures has to be EVER be done.

  • AS3 putting the buttons inside the Movie Clip

    I'm practicing AS3 (after years of AS2) and can't have a button inside of a clip speaks to another clip on the main timeline. Here is the code:

    OneButton.addEventListener (MouseEvent.CLICK, OneButtonClicked);

    function OneButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (1);

    MovieDescription.gotoAndStop ("One");

    }

    TwoButton.addEventListener (MouseEvent.CLICK, TwoButtonClicked);

    function TwoButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (2);

    MovieDescription.gotoAndStop ("Two");

    }

    The code above works, but if I put OneButton and channels within a clip, I know can target the MovieTarget and MovieDescription. The reason that I want to put OneButton and strings inside it's own MC is so I can dim each hit after top by switching the playhead within this MC help. ? Thank you!

    Start from the beginning

    Press f8 and choose movieClip, then draw your button movie untoggled call then create another movie and create your button toggled or grayed button and call it greyedButton.  Go to the main stage add 2 instances of button and 2 greyedButton (just drag the library).  you have 4 instances on stage.  give the name of the instances of appeal and place them one over the other so you can see 2 buttons on the stage.  put the button greyed under the button.

    now with action script

    Button1.addEventListener (MouseEvent.CLICK, OneButtonClicked);

    function OneButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (1);

    MovieDescription.gotoAndStop ("One");

    Button1.visible = false; Here the button greyed will show

    }

    Button2.addEventListener (MouseEvent.CLICK, TwoButtonClicked);

    function TwoButtonClicked(event:MouseEvent):void

    {

    MovieTarget.gotoAndStop (2);

    MovieDescription.gotoAndStop ("Two");

    Button1.Visible = true; Here button1 will return to its orignal State

    Button2.visible = false / / here will show the button greyed

    }

  • With the help of the buttons inside the Scrollpane

    I have the following code to my (not in a scrollpane) buttons, but when I try to add additional channels (addEventListener) to correspond with the buttons in a scrollpane I get these error messages (1120: access of undefined property smith. 1120: access of undefined property thomas.). I tried using the script in a layer actions within the MC inside the scrollpane does not. Is someone can you please tell me what is wrong and (a simple code example) how to correct? Thank you.

    home.addEventListener (MouseEvent.CLICK, clickSection);
    about.addEventListener (MouseEvent.CLICK, clickSection);
    staff.addEventListener (MouseEvent.CLICK, clickSection);
    whyus.addEventListener (MouseEvent.CLICK, clickSection);
    services.addEventListener (MouseEvent.CLICK, clickSection);

    function clickSection(evtObj:MouseEvent) {}
    gotoAndPlay (evtObj.target.name);

    }

    and once again, in answer to your question.  attached is a file that shows exactly what I have been explained - how to add headphones borders on objects in a scrollpane.

  • How empy and replace the buttons inside the Manager of horizontal management.

    Hello! So basically, I have 2 buttons at the top of the screen and a set of buttons inside a HorizontalFieldManager (let's call is Set 1 and 2). Now, when I click on the first button it should appear a Set 1 and then appear Set 2 and remove the Set1 on screen. How can I do this? Thank you!

    -Ryan

    The details in the referenced thread, you should get going.

    Basically, you add and remove fields.

    I suggest that you have a Manager to Set 1 and a Manager for value 2.  Add the two managers to the screen, with nothing in it,

    Make sure that Manager 2 is empty (deleteAll) and add fields associated with the value 1 to the Manager for the value 1, when they should be displayed - i.e. trigger it by pressing button 1.

    Remove the fields in Manager 1 and add the fields associated with the value 2 to the Manager for Set 2, when they should be displayed - i.e. trigger this by pressing button 2.

    I hope this helps.

  • Chronology of the buttons inside the ScrollPane

    Hey Adobe-ers.

    I created a scrollpane that contains different buttons.  Each button is a simple timeline of navigation, but won't function inside the scrollpane.  I just need to each button to "gotoframeandstop".  How can I make these buttons work in a scrollpane?

    Thank you!

    You can assign the code to the buttons on the main timeline so that the main scenario for gotoAndStop() targeting orders is direct (sp is the scrollpane instance name in this example)...

    MovieClip (sp.content).wesley.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_93);

    function fl_ClickToGoToAndStopAtFrame_93(event:MouseEvent):void
    {
    gotoAndStop (17);
    }

    ------------------------

    Or you could try to target the main timeline, hence the code is now...

    wesley.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_93);

    function fl_ClickToGoToAndStopAtFrame_93(event:MouseEvent):void

    {

    MovieClip (root). gotoAndStop (17);

    }

  • How to keep the buttons inside a DataGrid

    Is it possible to have buttons inside a DatGrid?

    For example, I want to Add, Delete, Update buttons inside a DataGrid control.

    Please tell me how to do this?

    For global buttons as you describe, I place them in a container as well as the data grid.

  • Access to the button inside Movieclip/ScrollPane

    Hi all

    I'm trying to understand how to create a button inside a movieclip.  I have a model that has movieclips in movieclips, and when I create a button (while using AS2) the button works if I test the stage, but in the whole flash movie it does not work.  I have also a few buttons inside a ScrollPane who also do not call correctly.

    I use this code for my button:

    facebookbtn.on (release) {}

    getURL ("http://www.facebook.com/", "_blank", "GET");

    }

    ↑ This is placed on the button "facebookbtn". I also tried to use: _root.bgPages.pg1.facebookbtn.on (release), does not.

    For the one inside a ScrollPane I try to call a javascript function:

    {We (Release)}

    to import flash.external.ExternalInterface;

    ExternalInterface.call("saveglobalscore",score) ("GroupDelegate", "dayone1");

    }

    ↑ This does not work, with or without the name of the button before it (release).

    I put the FLA here so that if someone has the time, could help me with this problem quickly. Thank you!

    FLA: download FLA

    Different code depending on how you assign it. what you show seems to be mixing up both ways...

    If you place this code on the button, use:

    on (release) {}

    getURL ("http://www.facebook.com/", "_blank", "GET");

    }

    If you place this code in the script that contains the button, do not forget that you gave this name of the instance to the button (in the properties, not the library panel), and then copy the following code:

    facebookbtn.onRelease = function() {}

    getURL ("http://www.facebook.com/", "_blank", "GET");

    }

  • Need help to connect the buttons inside a movieclip

    Hello

    I have five mcButtons inside a movieclip. I want to, so if the user clicks on the 1 mcButton it won't Stop on frame 2. I want then the other four mcButtons that were not clicked to stop on frame 2. Can't do the second part of this work. my code is below. Any help would be greatly appreciated.

    Thanks in advance

    prev08.Btn1.ID = 0;

    prev08.btn2.id = 1;

    prev08.btn3.id = 2;

    prev08.btn4.id = 3;

    prev08.btn5.id = 4;

    prev08.btn1.addEventListener (MouseEvent.CLICK, getXML08)

    prev08.btn2.addEventListener (MouseEvent.CLICK, getXML08)

    prev08.btn3.addEventListener (MouseEvent.CLICK, getXML08)

    prev08.btn4.addEventListener (MouseEvent.CLICK, getXML08)

    prev08.btn5.addEventListener (MouseEvent.CLICK, getXML08)

    function getXML08(event:MouseEvent):void

    {

    for (var i: int = 0; i < 18; i ++)

    {

    if(i == Event.Target.ID)

    {

    event.target.gotoAndStop (2)

    }

    on the other

    {

    prev08.getChildAt [i] .gotoAndStop (1)

    }

    }

    they all go to the same frame?  that makes no sense.

    If you want to run each in their own framework 1, except just clicked the button that should go to its Framework 2, direct all frame them 1 followed by the evt.currentTarget goes to frame 2:

    function getXML08(e:MouseEvent) {}

    for (var i: int = 1; i<>

    prev08 ["BNT" + i] .gotoAndStop (1);

    }

    MovieClip (e.currentTarget) .gotoAndStop (2);

    }

  • Integer from push the button inside of a counting loop

    Hi all

    I am currently working on a gui training. I am fairly new with labview and would appreciate any comments.

    My main problem is in the lower left corner of the main loop. I hope to spend a whole in one number for each press of the button "Logging_EDACS".

    I have problems with the main loop stuck. I did experiment with the condition of the loop to stop (I realize that the way it is Setup will not work now)

    Again, I think that the main problem is with the loops.

    Any help would be greatly appreciated.

    Thank you very much

    Kevin

    First, you must read some tutorials. That said, I see what your problem is. Whenever your big loop performs an iteration, the smaller its shift register is reset to 0. If you still have 0 + 1 = 1. In fact, you don't even have this 'small' while loop, you just registers to offset a large.

    Run with highest point running and you will be able to see what is happening.

  • OSB: Replace the action inside a loop for

    Hi all

    She seems like a simple question but I'm breaking my head for now quite sometimes.

    I have a recurring element in my diagram. I need to get the value of this repetitive element and convert it to uppercase.

    For example:
    My XML
    <Telephone>
    <Telephone Number>
    <phoneUsage>Contact</phoneUsage>
    <phoneNo>767676</phoneNo>
    </Telephone Number>
     
    <Telephone Number>
    <phoneUsage>Callback</phoneUsage>
    <phoneNo>767676</phoneNo>
    </Telephone Number>
    </Telephone>
    I need to change the value of using phone uppercase (reminder and Contact)

    For this I use a loop For:
    For variable TelephoneNumber in ./Telephone/TelephoneNumber of variable body
    Indexed by variable TelephoneNumberIndex with total count in variable TelephoneNumberCount
     
    Do
    (
    Replace $body/Telephone/TelephoneNumber/phoneUsage in variable body with 
    fn:upper-case($body/Telephone/TelephoneNumber[xs:int(i)]/tro:phoneUsage)
    )
    I do not know how to move the index value in the Xpath expression replace $body, phone, TelephoneNumber, phoneUsage.
    Can you help me please on this? I tried $ phone/body/TelephoneNumber [xs:int (i)] / / phoneUsage, but it generates an error.

    Thanks in advance for your time and support.

    For each [TelephoneNumber] in [. / phone/Tel...] ./Telephone/TelephoneNumber
    [body]
    Indexed by [undefined Variable] with countdown in [undefined Variable]
    Do)

    Replace [content of the node] [. / phoneUsage]. / phoneUsage
    in [TelephoneNumber] with [fn:upper - case ($...)] fn:upper-case($TelephoneNumber/phoneUsage/text())

    )

    Kind regards
    Anuj

  • Forget the button will be available for Waterfox and when?

    I have recently switched to 64 Waterfox, button forget will be available on it and when?

    Hi diamonback68. I do not understand why you want the button to forget.

    I would like to be able to say what that will come out on Waterfox. Because Waterfox doesn't not part of Mozilla, you need to ask the developer for Waterfox when they expect a version with this feature. You can message to the developer by clicking on Hare .

    Hope that answers your question. If you need more information or have any other questions please ask. Also remember that you can always download the latest version of Firefox on mozilla.org. The last being just might surprise you.

  • Structure of the event inside while loop

    I'm still fairly new to Labview and this may seem a simple question.  I'm doing a Subvi to display, edit, and create configuration files.  I use a ListBox to list all sections of a config file and structure of the event to update the values in each section, when they are clicked.  The problem is that the structure of the event seems to be a break the while loop so that the buttons do not work until the event has executed.  What I would like is the while loop to run continuously and the event to run only when I click in the listbox control.  I hope this makes sense.  There is a peak in the diagram below. Thank you

    There are a number of issues with your code that could cause problems:

    1. You must use the FP. Open method to open the front panel of a VI and of the public Service. Close method to close. I don't remember exactly the problem, but starting with the 7 worm nor indicated that these methods were the preferred way to perform these tasks.
    2. Based on what seems to be the code, the event for the control of Presets of wood should be a change the value - not a mouse down event. After changing the type of event, use the event data NewVal to drive the indexer table index entry.
    3. The buttons Ok and cancel them should be handled in their own events to change the value. The value change event Cancel would exit the loop, while passing the output error (which indicates that cancel was pressed) and default values for the other 4 outputs. The change of the value Ok event would leave the loop by passing the values that the operator had concluded the 4 controls on the front panel.
    4. An event of timeout with a very short time (1 msec) would stop loop if an error has occurred, or the output of the gate AND is set to true.
    5. The wait function is not necessary, as is the case outside the loop structure.

    Mike...

  • How to use the select statement in loop for

    Hi all

    My question is can I use a select statement in for loop like as follows.

    for the key in the selection of one_table key.

    When I use this am getting an error as found select invalid I ID

    How to select a statement use in loop for

    Please suggest me.

    Thank you
    Sree

    Hello

    You can use code below

    For key in (select button from table_a)
    loop
    If key.key = 1 then
    -insert statement
    on the other
    -Select statement
    end loop;

    Thank you
    Naveen.

Maybe you are looking for