OnRelease, loops, level10 v level10.button ???

After looking at some of the previous onRelease/for loop
topics, I'm still stuck. I have 26 buttons for 26 letters in the
alphabet. The buttons are defined on the stage already (they look
like they're drawn in chalk, oh boy!). I'd like to do a loop to set
onRelease for all the buttons. Each button's instance name is a
single alphabetic character, which I thought I could use to
identify which button was pressed ("A", "B", "C"...). So I set up
this loop:
for (var thing in this) {
if (this[thing] instanceof Button) {
// the alphabet button names are one character long
if (this[thing]._name.length == 1) {
this[thing].onRelease = function():Void {
// thought the button name, which is a letter, would be
passed as arg
letterPressed(this._name);
Unfortunately, the "this" in on release is at level10, not at
the button level (it's at _level10, not _level10.A, _level10.B,
etc). It's as if the onRelease was not called in the main timeline,
and no longer knows what button called it. It's the same as if I
directly selected the button in the flash editor, and called
on(release) in the actions panel.
By the way, I did try setting an id into the button within
the loop, but that doesn't help, since "this" doesn't point to the
right thing.
If I overtly set onRelease like this:
A.onRelease = function() { trace(this._name)}
I get "A", which is what I want. So.....how can I set these
in a loop, but have the onRelease behave like it's set in the
timeline (which it is), and not as if it's set down in the button?
It would be really handy if I could use the for loop, and not have
to call 26 separate onReleases. Any help would be appreciated.
Thank you.

Similar Messages

  • There is a infinity loop when the 'Accept' button is hit in the Terms of Use of the Icloud in the Apple TV.

    There is a infinity loop when the 'Accept' button is hit in the Terms of Use of the Icloud in the Apple TV. Does anybody know how to solve it?

    My region is set to Australia (which is correct) Still getting the loop when trying to accept iCloud terms and condition son apple tv.

  • SOLUTION - Re-Index Loops when "Index Now" button is broken

    This message is for anyone having trouble with Soundtrack's loop indexing in the following way:
    PROBLEM:
    ... You want to re-index some loops, or
    ... You want to de-index some loops, or
    ... Some loops are showing up red
    AND...
    ... You cannot re-index from the "Setup..." button in the Search palette (the minus button and/or "Index Now" buttons are grayed out for some unknown reason)
    *HERE IS THE POSSIBLE SOLUTION:*
    ... Delete all files from the following folders:
    Library/Preferences/Soundtrack/
    Library/Audio/Apple Loops Index/
    ... Now restart Soundtrack, and click "Setup...". All the indexed directories should be gone.
    ... You'll have to re-add and re-index your whole library. This may also affect GarageBand and/or Logic, and require re-indexing in them as well.
    *If you're still having trouble...* there may be some more index files floating around your system. Open Spotlight and set "System Files are Included" and "File Name" in the search options and search for "search index". This should show you where any remaining Apple Loop search index files are located, so you can delete them. They will be named stuff like "Search Index E44B5969-5E4A-4E27-A3C2-E5861C5D1FB8.txt".
    Hope this helps anyone else out there. It worked for me with Soundtrack 1.1 when my loops were all messed up.

    Well, to add metadata and transients to sound clips you need to edit them in Apple Loop Utility which is included with Final Cut Studio.
    To add custom loops to your permanent library you need to make a new folder like "My Loops" and put it somewhere permanent like in Library/Audio/Apple Loops and then index it with Soundtrack/GarageBand/Logic. Soundtrack uses the "Setup..." list and GarageBand you can just drag and drop into the loop browser. Not sure about Logic but it should be something similar.
    If you wanted to edit the index files manually from the Finder, they are in some weird format and I don't think it's possible.

  • How to start AND end a loop using a Boolean Button set to "Switch When Released" operation

    I have a Boolean button set to "Switch When Released" operation. When I press this button (now it's in the On state) I want to run a loop that does something continupously (for now, let's say it displays a simulated sine wave) until I press the button again (now the button is in the Off state) in which case, I want to end the loop. I am wiring my button to the loop condition that's set to "Continue if true" and have a "Wait Until Next ms Multiple" of 200 ms (I tried up to 500 ms). When I run the VI and press the button the first time, I see the sine wave displayed. But when I press the button again, nothing happens. It looks like it does not respond to the user interface. What's happening. What am I doing wrong? I'm using an Event Handler design pattern. I've also tried the Producer/Consumer (Events) design pattern. But I don't imagine the particular design pattern should make a difference. I've attached my code. Thanx.
    Fataneh
    Attachments:
    My_Event_Handler.vi ‏107 KB

    A simple solution would be to harness the timeout event, where you would put your data simulation. No need for parallel loops and local variables.
    The event timeout is starts out as  -1 (infinite) but pressing the start/stop button toggles between a 200ms and an infinite timout whenever it is pressed. Since the evet structure always runs, all other events (e.g. stop) are also serviced.
    Please ask if anything is not clear... Good luck!
    Message Edited by altenbach on 07-13-2005 04:20 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    My_Event_HandlerMOD_CA.vi ‏116 KB

  • Reset while loop with time and button?

    I am trying to get the while loop to stop and reset with a button or if time runs out. So when I switch the button it should stop the indicator; when I switch the button back on it should reset the time and start reading data again. Likewise, when time runs out it should stop the indicator and I want to flip the switch to start a new run and reset the time again. I have attached my vi for some clearification. If you have trouble understanding please let me know and Ill try and explain more. Thanks.
    Attachments:
    reseting_time_whlloop.vi ‏70 KB

    Relient wrote:
    I know my program is not efficient at all, Im inexperienced with labview and my company needs it soon so I'm trying to get it out quick. Attached is what I have so far. It is very messy!!  However it is nearly working how we want. The producer/ consumer design is needed because I am implementing this into my other program and each loop  has a different job than the other loops. This is just a mock version as I am trying to figure out the process.
    The stop buttons aren't needed but the button labeled boolean should reset the time and stop the run. When the run is stopped I want to re-enter a 'test time' and hit the button again for a new run. I just need to be able to reset the original time... Is the producer/consumer the best way to connect while loops because it seems messy?
    Again sorry if it is hard to follow and if its not the best way to go about it; I'm doing the best with what I know. Thanks for the help.
    I realize you may need this soon but you will regret it later (or the next person to touch this code) when you need to touch it again. It is overly comnplicated, messy and not very well designed. Doing a bad job quickly is never the right answer. A little extra time spent up front to do it right can save tons more time later on.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Can't set a menu loop point for my buttons to come in

    because my menu loop background video has text that flies in, i need my menu buttons that correspond to that text to come in on a delay. reading my dvdsp3 book, it seems i would need to set a loop point in the menu to trick it into doing this, however i cannot set a loop point on my menu - that option is greyed out and i cannot toggle it.
    the guide i have says looping isn't possible if i add drop zones or text, but i have done neither within dvdsp3.
    any help appreciated
    thanks

    ok i think i know what happened
    i was using moving video as an asset for my buttons
    once i changed that i could set a loop.
    i guess i will edit my moving video into small "buttons" in FCP and then create the real selection buttons in DVDSP3.

  • I have a VI with a while loop controlled by "stop" button. How can I finish the running of this VI in a another VI programmablly.

    I mean I want to control the "start" and "stop"
    of a VI with another VI.
    Thanks

    1... Change your slave VI to stop on the button OR a global boolean variable.
    2... When your slave VI does stop, set the global variable to FALSE (ready for next time).
    3... Set the global to TRUE from the master controlling VI, on button click, or whatever is supposed to stop the slave.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Music loop fade out by button between scenes

    Hi
    I have a infinite music loop and I am trying to have btn_start trigger a fade out on the music along with its original gotoAndPlay.
    I have two scenes, "opening" and "animation". btn_start and the following code are in the "opening" scene.
    the fade out will play along with the first couple seconds of "animation" since the gotoAndPlay connects to frame 1 of "animation"
    Can this be done? Please show me some lights of how to proceed this.
    stop();
    import flash.net.URLRequest;
    import flash.media.Sound;
    var url:URLRequest = new URLRequest("subtle.mp3");
    var snd:Sound = new Sound(url);
    snd.play(0, 17);
    btn_start.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
    gotoAndPlay(1, "animation");
    thanks!!

    you can use:
    stop();
    import flash.net.URLRequest;
    import flash.media.Sound;
    var fadeRate:Number = .01;  // number between 0 and 1.  the closer to 1, the faster the fade
    var url:URLRequest = new URLRequest("subtle.mp3");
    var snd:Sound = new Sound(url);
    var sc:SoundChannel=snd.play(0, 17);
    btn_start.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
    this.addEventListener(Event.ENTER_FRAME,fadesoundF);
    gotoAndPlay(1, "animation");
    function fadesoundF(e:Event):void{
    var st:SoundTransform=sc.soundTransform;
    st.volume-=fadeRate;
    if(st.volume<=0){
    this.removeEventListener(Event.ENTER_FRAME,fadesoundF);
    sc.soundTransform=st;

  • How to get line no of row whsoe button is pushed in step loop display

    Hi experts.
    In step loop i have a button too with the other fields.which is being displayed on the left side of every row.now i just want that to get the no of that row of which the button is pushed.
    i am using GET_CURSOR_LINE but it fails i.e when a cursor is in third row and i press the button of 2nd row, in this way it gives me the line no 3 but it should be the 2.
    Note: I am using step loops not the table control in dynamic programing.
    it is a great challenge for all experts.

    hi experts hi.
    what happend.
    does any body know nothing
    plz just tell that iz it possible.
    or any help...any any help
    experts where r u all?

  • How do I create a start/stop button for each separate while loop within my program, when each of them does a different task?

    I have a multimeter VI with separate while loops to accomplish the different tasks of reading  voltage, current, etc. Each while loop has a stop button, but I need a button that will have to be pressed in order for the while loop to even start. I tried putting another while loop around the present one, but it still has to run once before it will stop. I want the user to have to press the button before it runs, because they interfere with each other.
    I am just learning so patience and your kind assistance is greatly appreciated!
    ElectroKate

    iZACHdx wrote:
    Hello,
    I'm not entirely clear with everything you have going on and what you want your final functionality to be, but you can use sequence structures to prevent a loop from starting until the user presses a button like this:
    -Zach
    I have to ask, why is an NI employee using examples using sequence frames? The same thing could be accomplished using data flow by simply wiring the value of the first stop button out of teh first while loop and connecting it to the second loop. This would then use data flow to control the sequence. Why show new users bad programming methods?
    As to the original question I would concur with altenbach on using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • DVD button loop point

    I know this question is on here alot and I've already read some different things.
    I have a project where the DVD menu has and intro and at about 16 secs. the buttons fade in. I have figured out how to make the button delay by setting the loop point. The problem is now my client wants the whole intro of the DVD menu to loop and have the buttons fade in at 16 secs. Is there anyway to keep the video looping back to the start and have the buttons still come in at 16 secs? i appreciate the help in advance.
    thanks.

    So visually, the menu starts, at 16 seconds the buttons appear and they stay on screen whilst the menu appears to loop from the beginning?
    What I would do is make a whole bunch of clips into a single clip using FCP and placing them consecutively on the timeline, then export that to use as the menu background. Visually, this will appear to start over and over, but in actual fact it is playing through just once. Make it five minutes long, if you want so that no-one will rightly sit through it all.
    Now add your loop point at 16 seconds as before. The buttons will fade in as you want, and then stay on screen as the background footage continues to play, looking as though it is looping. At the very end of your footage there will be a slight pause and the menu will then actually loop to the loop point, missing hte first 15 seconds off. Since this is so long into the menu I doubt very much whether anyone would notice. I would tell the client that this is the most efficient way of achieving the look (which it is) and let them decide if they want something different.

  • How to execute the functionality of button at a time of pressing if function is in continuous loop?

    Hello,
    I am facing one basic problem that how can I execute the button which I have used in my vi at a time of pressing means in my vi I have used 4 button 1. Start 2. OK 3. Save and 4. Stop button
    when user press start button then continuous loop will be executed and after pressing OK it will stop that loop and waiting for next instruction from user whether he want to do reading operation again or he want to save or he want to stop.
    The thing is when I press start button then while loop is execute then its not possible to press stop button or save button, user need to wait until OK button is pressed.
    Will you please guide me how can I do so that when ever user press any button that button is executed at time.
    Thank you very much once again.
    Attachments:
    voltageforcecapacitance without instrument.vi ‏40 KB

    Hi Ankit,
    There are some issue in your code mention below please have a look and correct these will work fine for your requirement.
    1. Save button Boolean value pass to the lower wheel conditional loop means if you press save your bottom loop will stop working this is not the code requirement you have to continue loop and tigger start event in last using value tigger event property to tigger again start event.
           This step will reset your loop and start from zero.
    2. According to me I think both loop should stop only in stop condition so you can remove stop function from upper loop and pass the button value in both loop directly to wheel loop condition terminal.
           Upper loop direct and lower both loop local variable.
    3. Why you want to stop your upper loop on any error condition, you should Handel the errors and keep running the code.
    4. What is the use of queue no case related with dequeue in bottom loop.
    5. Wheel loop in a event is not  good practice so you can use your queue structure here to run continuous lower code.
    I hope these changes can improve your code.
    Thanks and Regards
    Himanshu Goyal | LabVIEW Engineer- Power System Automation
    Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
    It Only gets BETTER!!!

  • Looping Video - No Buttons

    In a motion menu when I loop the video to play the last few seconds I loose the buttons up until the looping point when they come on the screen.  How do I loop video but have the buttons on the menu from the start?
    Thanks.

    Maybe this becomes something I need to do in AE, but here's what I'm trying to do:
    I've created video (about 50 seconds).  The final 10 seconds are a blurred frame (still) - my hope was to have the menus on from the start of the motion menu and loop the video w/ the final few seconds for the bed.  I saw it was done in a Lynda.com tutorial, but the bottons were animated in AE...that being said in the lesson I saw the looping video had the buttons on the entire time, so your comment makes sense.  I will check out the section you suggest as well.
    Thanks.

  • No loop in swf array?

    Hey everyone.  So, I have this flash movie I've been working on for awhile.  Everything's going great thanks to a lot of help I've received in these forums.   I have my file set to load an array of swfs.  Now, though, I'm wondering how to keep it from looping.  At the end of the last swf, I want the movie to go to the last swf and then just stop.  Here is my code:
        var listener:Object = new Object();
        var mcl:MovieClipLoader = new MovieClipLoader();
        mcl.addListener(listener);
           // When the swf loads, set it up to constantly check its current frame
        // against the total frames, and if those match, the swf is done playing.
        // If that's the case, then load the next one.
        listener.onLoadInit = function(targ:MovieClip):Void {
           theTargetClip_mc.onEnterFrame = function():Void {
              if (this._currentframe == this._totalframes) {
                 loadNext();
                 delete this.onEnterFrame;
    //Previous and Next Swf Buttons
    function loadNext():Void {
        currentSwf++;
        if (currentSwf >= swfs.length) currentSwf = 0;
        loadSWF(currentSwf);
    function loadSWF(nextSWFToLoad){
       mcl.loadClip(swfs[nextSWFToLoad],theTargetClip_mc);
    loadSWF(currentSwf);
    function loadPrevious():Void{
       currentSwf--;
       if(currentSwf==-1) currentSwf = swfs.length-1;
       loadSWF(currentSwf);
    previous_btn.onRelease = loadPrevious;
    next_btn.onRelease = loadNext;
    //End Previous and Next Swf Buttons
    //Play Button
    play_btn.onRelease = function() {
        theTargetClip_mc.play();
    //Pause Button
    pause_btn.onRelease = function() {
        theTargetClip_mc.stop();

    Cuwen_26 wrote:
    Does anybody know how to add that kind of code to the code I already have?  Help would be very much appreciated!!  I'm really curious to see how this would be done.
    NOTE:  take note of the SWF titles I have in the added Array declaration line . . . . (var swfs:Array=new Array("etc,etc,etc") below in the code)
    CODE:
    var listener:Object = new Object();
    //change the titles in the array to whatever your content swfs are called
    //in your directory.  Store the swfs in the same directory
    //as your FLA
    var swfs:Array= new Array("swf_01.swf","swf_02.swf");
    var container:MovieClip = createEmptyMovieClip("container",getNextHighestDepth());
        var mcl:MovieClipLoader = new MovieClipLoader();
        mcl.addListener(listener);
           // When the swf loads, set it up to constantly check its current frame
        // against the total frames, and if those match, the swf is done playing.
        // If that's the case, then load the next one.
        listener.onLoadInit = function(targ:MovieClip):Void {
                trace("loaded listener");
    theTargetClip_mc.onEnterFrame = function():Void {
              if (this._currentframe == this._totalframes) {
                 //loadNext();
                 delete this.onEnterFrame;
    //Previous and Next Swf Buttons
    var currentSwf:Number=0;
    function loadNext():Void {
        currentSwf++;
        if (currentSwf >= swfs.length){
              //currentSwf = 0;
        loadSWF(currentSwf);
    function loadSWF(nextSWFToLoad){
       mcl.loadClip(swfs[nextSWFToLoad],theTargetClip_mc);
    //loadSWF(currentSwf);
    function loadPrevious():Void{
       currentSwf--;
       trace(currentSwf+" currentSwf");
       if(currentSwf==1) {
            currentSwf = swfs.length-1-1;
       trace(currentSwf+" currentSwf");
       loadSWF(currentSwf);
    previous_btn.onRelease = loadPrevious;
    next_btn.onRelease = loadNext;
    //End Previous and Next Swf Buttons
    //Play Button
    play_btn.onRelease = function() {
        loadSWF(currentSwf);
    //Pause Button
    pause_btn.onRelease = function() {
         mcl.unloadClip(theTargetClip_mc);

  • Buttons, Html 1086: Syntax error: expecting semicolon before 9.

    I am building a super simple website in flash. The main set of buttons for navigation work fine. But when I add the Save, Print, Email and Facebook link buttons I get a looped video with no buttons and these errors:
    TempInit 5    1086: Syntax error: expecting semicolon before 9.
    TempInit 6    1086: Syntax error: expecting semicolon before 8.
    TempInit 9    1086: Syntax error: expecting semicolon before 7.
    This is the actionscript:
    stop();
    Home_But.addEventListener(MouseEvent.CLICK, goHome);
    function goHome (event:MouseEvent):void{
                        gotoAndStop(1);}
    Menu_But.addEventListener(MouseEvent.CLICK, goMenu);
    function goMenu (event:MouseEvent):void{
                        gotoAndStop(2);}
    Bio_But.addEventListener(MouseEvent.CLICK, goBio);
    function goBio (event:MouseEvent):void{
                        gotoAndStop(3);}
    Contact_But.addEventListener(MouseEvent.CLICK, goContact);
    function goContact (event:MouseEvent):void{
                        gotoAndStop(4);}
    Symbol5.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol6.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol9.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol8.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol7.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Any ideas?  Does my problem stem from the layout of my timeline and the extra buttons falling on random frames?

    Based on the errors, I'm guessing that your movie is expecting AS3. So throw away all of this:
    Symbol5.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol6.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol9.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol8.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Symbol7.onRelease = function() {
    getURL('http://www.facebook.com/hungryhippyalpena/');
    Now, does your movie work when you do that? Do you get any other errors?

Maybe you are looking for

  • Backup to my has suddenly fails

    Timemachine has been running successfully for a couple weeks. Suddenly it stopped working. Target is a qnap TS-239 pro II  with version 4.0.3 of the firmware on it, supposedly working as a timemachine target for mavericks. Well it was, untill now. Fi

  • How to install Photoshop CS5 on my macbook?

    I upgraded CS5 from CS4 on my desktop and now I need to install it on my Macbook. Tried using my CS5 serial code and it doesn't work. Is there a different serial number for Mac and Windows? What do I do?

  • XML Unbounded values into one field - Message Mapping

    Dear All, I am trying to convert an unbounded multifield XML structure to a 0.1 field so that the maltiple values are mapped into a single fields in semi-colon seperated fasion. The source: <MT_dates>    <date>05-10-2011</date>    <date>10-11-2011</d

  • How can I change my Bookmarks Sidebar to transparent - can't find the proper code for CSS file

    I have recently changed my #nav-bar and #PersonalToolbar to transparent thanks to suggestions I found online. But I cannot seem to get my Bookmarks Toolbar to do the same. I tried #BookmarksSidebar with no luck. Any suggestions?

  • Standard price in MM

    Hi, we have set standard price of 10 rupees at material master accounting view, if we are giving a value at PO of 12 rupees , what happened ? if we are giving a value at PO of 8 rupees, what happened ? for both above regards