Disable, enable and reset buttons

I have an array of buttons. I need to be able to disable the selected the button and allow the reset

Ex: 5 buttons on stage when click btn1, btn2 and disbale btn1 > activate btn5.

I ve joined the main code.

Any help much appreciated...

Thank you very much.

//Import Classes
import com.greensock.TweenLite;
import com.greensock.plugins.*;
import com.greensock.*;
import com.greensock.easing.*;

import flash.utils.*;
import flash.events.*;
import flash.net.URLLoader;
import flash.display.*;

var _length;
var XML_URL:String = "Grocery.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener(Event.COMPLETE, LoadXML);

function LoadXML(e:Event):void
{
     var xmlData = new XML(e.target.data);
     _length = xmlData.children().length();

     for (var i:Number = 0; i < _length; i++)
     {
          var titleData = xmlData.children()[i].attribute("Title");

          var rectangle:MovieClip = new Test();//Test is a movieclip in library
          
          rectangle.name = "rec" + i;//renaming to rec0,rec1...
          rectangle.y = i * 41;
          rectangle.id_txt.text = i;
          rectangle.ivar = i;
          rectangle.title_txt.text = titleData;
          
          //Listeners
          rectangle.title_btn.addEventListener(MouseEvent.CLICK, onClick);
          rectangle.title_btn.addEventListener(MouseEvent.ROLL_OVER,onOver);
          rectangle.title_btn.addEventListener(MouseEvent.ROLL_OUT,onOut);
          rectangle.title_btn.buttonMode = true;
          
          //Add Child inside container mc on stage
          titleCont_mc.addChild(rectangle);
     }
}
function onClick(e:MouseEvent):void
{
     var mcParent:MovieClip = e.currentTarget.parent;
}

function onOver(e:MouseEvent):void
{
     var mc:MovieClip = e.currentTarget.parent.titleBG;//titleBG is a background for each attached MC
     TweenLite.to(mc,.3,{scaleX:1.2});//Change scaleX on over
}

function onOut(e:MouseEvent):void
{
     var mc:MovieClip = e.currentTarget.parent.titleBG;
     TweenLite.to(mc,.3,{scaleX:1});
}

 

Your error I think is trying to use the name property as you do.  The name is not what it was in AS2, this is simply a property, a string, and to target an object by its name, you must use the getChildByName() method.

It will be easier if you create a table and entrust your buttons as you create them.  Declare the array outside your loadXML function so that it will be available to all functions and entrust the objects in your loop in the service...

var rectangle: MovieClip = new Test(); / /

inclinometer [i] = rectangle;

Then, you can use the code that I showed to target your buttons.

Tags: Adobe Animate

Similar Questions

  • I don't know the username/password for the configuration web page and reset button is not reset.

    Hello guys, as I said I don't know the user and the password in the web settings page of the basis of my WRT120N (Linksys router model) and I almost tried everything with my reset button, and it does not seem to reset my router. Please, if you guys know something I could do to fix my router, that would be great. Thanks for the help!

    Be fixed by myself some moderator let this thread closed.

  • Move the 'Apply' and 'Reset' buttons

    Hi guys

    I'm obiee 11.1.1.8.1 and I am struggling to find the solution or invites to go down buttons apply and Reset on the dashboard.

    Help, please

    In 11.1.1.7, I would do like this:

    Look at the HTML code of the page to identify the structure and CSS setting the buttons on the right.

    This is easy: there is a class does exactly cela.

    Add a block of text in the page just before the guests that contains this code:

    
    

    (check the box 'contains the HTML markup')

    Fact!

    If you always want your button centered or left-aligned you can also edit the file views.css to your custom (new: personalized!) style/skin and this is the new default position of the buttons (on each page using the style/skin).

  • Send and reset buttons does not work on the contact form

    Hey, I use Flash CS3 and ActionScript 2. I created a simple contact page, inside a clip (because I got fading), I put the script in the main timeline, so not inside the animation, but the buttons send and reset may not respond. I checked the instance names and spellings are correct, here is the script I use:

    contact_tween.send_button.onPress = function() {}

    If (name eq ' ' or subject eq "" or message eq ' ' or by e-mail at eq "") {}

    Stop();

    } else {}

    loadVariablesNum ("form.php", 0, "POST");

    gotoAndPlay (211);

    }

    };

    contact_tween.reset_button.onPress = function() {}

    name ="";

    subject ="";

    message ="";

    email ="";

    };

    so, what I am doing wrong? any help appreciated, thanks.

    PS. contact_tween is the name of the movie I created to fade the page contact and exit.

    If you want to hire me to solve your problems, send email via my website (www.kglad.com).  free help continue the validation of this forum.

  • Disabled "Accept and send" button

    I try to apply to Adobe Runtimes / reader Distribution License Agreement but the button "Accept and send" is disabled on https://www.adobe.com/cfusion/mmform/index.cfm?name=distribution_form. I tried everthing I could but unable to move forward. Help, please. Thank you.

    Have you tried different browsers?  You can also check the Java version you have installed is up-to-date.

  • Ghostery disables front and rear buttons in version 10

    The forward and back arrows are grayed out and do not work when Ghostery is enabled. If I start in safe mode, without Ghostery, forward and back function arrows properly.

    Thanks for your information. I had rebooted my computer, run virus check, etc., but had yet to start in safe mode. I used Ghostery, the problem occurs once again. Finally I erased from history, and that seems to have solved the problem.

    Thanks again for your response.

  • Submit and reset in oracle reports Viewer buttons

    Hello...

    When I generate a report of form 10g it displays parameter previewer...

    It shows submit and reset button at the top and then list the other parameters values...


    My client wants now to the "submit" button and the reset after the parameter list button not in the top.

    As I am new to oracle 10g - can someone help me...

    Please direct me to the forum if it is discussed earlier...

    Thanks in advance...

    Hello

    The HTML displaying the Submit and Reset buttons is defined in the "front of the Value property of the form":

    http://www.Oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_rpesc_before_form_value.htm

    You can move the HTML to the property "after the Value of the shape property.

    http://www.Oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_rpesc_after_form_value.htm

    to display these buttons at the bottom of the form parameter page...

    Concerning

  • Proposals feature: possibility to add the button to enable/disable JavaScript and Flash easily? The lack of horizontal navigation.

    It is very useful and safe to disable JavaScript and Flash is not needed. But sometimes they must be used.

    It's too frustrating toggle JS menu, and No-Script add-on is not very practical. It would be better if it had the button toggle to enable or disable JavaScript. Also necessary for Flash. You could implement this simple feature for the next update.

    Also: Ealier, it was possible to navigate horizontally rss-buttons and tabs of arrows. Later, this feature has been removed. Could get it back you.

    This module includes a button to toggle JavaScript market / stop.

    https://addons.Mozilla.org/en-us/Firefox/addon/QuickJava/

  • Enable and disable the buttons depends on the connection of the user?

    How to enable and disable the buttons depends on the connection of the user?

    In fact I have a few buttons as remove, add, save, exit, it etc., zero page...

    depends on the user , I have to turn on and off specific keys.


    Thanks and respect,
    SKUD.

    Hi Skud,

    In fact Jeff's response are correct and handles the problem. I want to mention another way,

    Change the desired button > navigate to Conditions > Pick (exists SQL query returns at least one row) > Expression 1, enter code similar to the following:

    Select TOP (: app_user) where double UPPER(:app_user) in ('FATEH","MARY")

    Best wishes
    Fateh

  • How to enable and disable a button depending on the value of a field

    Hello experts,

    I enable and disable a button depending on the value of a field.

    I did the following:

    in a trigger of on_new_form_instrance I put the following
    begin
         
    go_block('OE_HEADER');
    execute_query;
    IF :oe_header.status = 'BOOKED' THEN        
          SET_ITEM_PROPERTY('CONTROL.ACTION',ENABLED,PROPERTY_FALSE);
    else
         SET_ITEM_PROPERTY('CONTROL.ACTION',ENABLED,PROPERTY_TRUE);
    end if;
    
    
    end;
    the problem is that it works but does not change when my header_status value is changed.

    You have to put the same code in when-validate-item trigger of: oe_header.status...

    and I think that this code should be trigger after query

    IF: oe_header.status = 'RESERVED' THEN
    SET_ITEM_PROPERTY('CONTROL.) ACTION', ENABLED, PROPERTY_FALSE);
    on the other
    SET_ITEM_PROPERTY('CONTROL.) ACTION', ENABLED, PROPERTY_TRUE);
    end if;

  • I was told that Web Developer had buttons that enabled me to disable JavaScript and CSS (Cascading Style Sheets), but I do not see these keys on Firefox version 10. How can I access these two functions? So how can I activate JavaScript later? Thank you.

    I need the way to points that allows to disable JavaScript (and then to turn it on) and allows to turn off CSS.

    These access points do not appear on the Web Developer (v.10)

    Thank you.

    Are you sure that whoever told you that was not referring to the add-on Web Developer?

    https://addons.Mozilla.org/en-us/Firefox/addon/Web-Developer/?src=SS

    It has features allowing disabling of Javascript and style sheets.

  • When I press Alt - T tools foor, then go into options and advanced there is no reset button to fix my toolbar problem... help!

    Try resetting your Internet Explorer settings by following the instructions below.

       Click the Internet Explorer Tools menu, or press Alt-T on your keyboard.
       Select Internet Options.
       On the Advanced tab, click Reset.
       Select the "Delete personal settings" checkbox.
       Click Reset.
       If you still don't see the Toolbar, try the steps above again to re-enable add-ons and the Toolbar.
    

    But there is no reset button! Help:)

    Clear the cache and cookies from Web sites that cause problems.

    "Clear the Cache":

    • Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox/tools > Options > privacy > Cookies: "show the Cookies".
  • JDEV 12.2.1 Panel reset button and AllowMultipleValues choicelist query

    -We have a choicelist on an attribute that is included in a view criteria and in the Councils of the user interface, "supports multiple values" checkbox is enabled for this attribute.

    This criterion of display is dragged as a search query. the reset button on the Panel of the application does not seem to clear the values for this attribute.

    Is this a bug? We have migrated our 11.1.2.3 app and it worked there.

    I found the problem. The question of criteria for the view which has been marked as "supports multiple values" also had a variable link attached to it in the view criteria. This was not the case in the new application of 12 c, I created.

    I removed the variable binding attached to him and he began to work. Compensation, reset button is now selected items.

  • I have my 5 factory reset iPhone, now I can't set up my iPhone because it must be enabled, and I don't have a sim card. Can someone help me please?

    I have my 5 factory reset iPhone, now I can't set up my iPhone because it must be enabled, and I don't have a sim card to make. Is there a way I can install and use my iPhone without needing to be activated? Can someone help me please?

    To skip the activation of sim card, you can use iTunes if you have a CDMA iPhone. However, if you have a GSM model you will need to insert a sim card to activate your iPhone (it can even be used/inactive). Here is an article that will help you determine if your iPhone is GSM or CDMA: http://osxdaily.com/2012/11/15/determine-iphone-gsm-or-cdma/

  • iPhone5s, about 3 years. My phone was in place. Whole phone freezes up and I have reset ("home" button and lock button)

    I have an iPhone5s for about 3 years now. My phone has been in place for some time now. My phone just hangs and I have to reset ("home" button and lock button) and when I unlock it after ALL my messages have disappeared or erasing their own messages and I get not notified when someone texts me. Help?

    Reset.

    Restoration.

    Restore as new.

    Standard troubleshooting steps. Have you tried one of them?

Maybe you are looking for

  • New Mac Pro does not connect via WiFi to my ATT router.

    I have a brand new Mac Pro garbage but I'm unable to get it to connect to my ATT wireless router. My phone, the laptop and the TV do it but not my main computer. Oddly enough, I AM able to connect via WiFi for the Mac Pro to my laptop. Any suggestion

  • NI4130 current EMS range

    I use a 4130 PXI SMU to test a 3V battery transmitter RF. The unit goes through a sequence that requires up to 20mA current then goes into standby mode that should attract current in the low range AU in operation. The problem I have is downranging th

  • Photosmart D5160 keeps restarting

    All of a sudden my printer keeps restaring if the USB cable is disconnected and then reconnected. I tried to reinstall the software and which appeared to install correctly, however approximately every 5 minutes this problem occurs. I have this error

  • How can I disable the mousepad on my 810 turn?

    I wish I could do market easily, but will tackle the problem in the BIOS, if necessary

  • What is the problem with Remote Assistance?

    I was able to use assistance remotely via Live Messenger for several years to help other people.  These days, the request will not be sent other peoples at the mine, or vice versa. Most of these comps that I am trying to take control of, I did so doz