How can i test the boolean state of button action?

Hello,
in as2.0, how can i test the boolean value if a button was
pressed or not?
I have a simple function im trying to work with like this...
button_btn.onRelease = function (success:Boolean) {
if (success) {
trace("we pressed the button - value is true");
else {
trace("value is false");
working with booleans in this way is new to me - any pointers
will do - thanks!

Well, I'm not really that familiar with using video in flash,
but from what I understand of what you are going for, these are my
suggestions:
If the code within your button has scope of the variable you
are testing for:
_global.myInfoObject;
button_btn.onRelease = function(){
if( myInfoObject.code == (value your are testing for) ) {
trace("value is correct);
} else {
trace ("value incorrect");
if you aren't in scope you can always maybe forward the
onRelease function to some handler that is in scope:
var myInfoObject;
var release = function(){
//to do code here;
button_btn.onRelease = release;
I hope some of these ideas help a little.
You can always send your .fla to my email at
[email protected] and I'll take a look at it.

Similar Messages

  • How can i use the boolean AND here?

    Hi,
    how can i use the boolean expression AND in order to include it in the expression below so as that 2 condition must be true in order to get the respective data from the database?
    java.sql.ResultSet res = statement.executeQuery("SELECT * FROM station9 " + "WHERE P =" + power);
    regards

    java.sql.ResultSet res = statement.executeQuery("SELECT * FROM station9 " + "WHERE P =" + power + " AND FLAVOUR = " + raspberry);

  • How can I set the United States as my country when opening PSE 10?

    How can I set the United States as my country when opening PSE 10 so I don't have to scroll down every time?

    Why do you have to scroll down every time? You should only see the country window the very first time you launch PSE after installing it.

  • HT202213 Why would my Apple TV suddenly stop recognizing my library.  Nothing has changed.  How can I test the Apple TV.  I have the latest updates.

    Why would my Apple TV suddenly stop recognizing my library.  Nothing has changed.  How can I test the Apple TV.  I have the latest updates.

    Could have to do with home sharing. Try turining off and then back on home sharing on your AppleTV.

  • How can we test the camera megapixel?

    Hi All,
    I need to know how can we test the camera megapixel?
    For instance: If i have a 2MP camera how would i test it is 2MP, is there any measurement device or standards for mega pixel?

    1600 x 1200 is 2mp not 1.3. Your friends phone must also be 2mp or the picture was taken on another phone.
    It's easy to work out yourself.
    1600 multiplied by 1200 = 1,9200,000 pixels more commonly known in the industry as 2mp.
    1.3mp is 1280 x 960 (1,228,800 pixels).
    More megapixels does not always equal better quality. The lens and software are also a big quality factor. I have seen many 1.3mp phones that take better pictures than a 2mp phone because they have a better lens.
    Message Edited by psychomania on 18-Jul-2008 10:26 AM

  • How can I test the log in state from in side the Operator Interface code.

    From inside LabVIEW Full OI, I want to test if the operator logged in after the IApplicationMgr Start.
    Right after the IApplicationMgr ‘Start’ I have a loop that tests the IApplicationMgr ‘LoginLogoutRunning’ state and waits until the LoginLogout call back is done.
    I want to exit if the program if operator canceled the login and did not log in.
    I have tried “GetEngine” ref. From there get the “CurrentUser” ref but seems not to contain any information about the Current User.
    How can I test from my Operator Interface code logged in state of the application?
    Thanks
    Jim D.

    Try Engine.CurrentUserHasPrivilege
    For the string parameter 'privilegeName' enter Priv_UserLoggedIn or the string value "*".
    "Priv_UserLoggedIn–(Value: "*") Use this value with the Engine.CurrentUserHasPrivilege method to determine whether a user is logged in."
    Option 2: You could also setup a callback on application manager for UserChanged Event.  If the User is null then the login was canceled.  (see a copy of the help further down)
    From the teststand help for Engine.CurrentUserHasPrivilege method below...
    CurrentUserHasPrivilege Method
    Syntax
    Engine.CurrentUserHasPrivilege ( privilegeName)
    Return Value
    Boolean
    True if the current user has the privilege.
    Purpose
    Confirms whether the current user or any user group that the user is a member of has a specific privilege.
    Remarks
    Returns True when the privilege property is True, when the privilege property of any group that contains the privilege is True, or when privilege checking is disabled, StationOptions.EnableUserPrivilegeChecking is False. If privilege checking is disabled but StationOptions.RequireUserLogin is True, this function returns True only if there is a user currently logged on.
    Parameters
    privilegeName As String
    [In] Specifies the name of the privilege to check. You can specify the name of any privilege property. You can specify the full privilege path in the user privileges property tree, for example, Debug.RunSelectedSteps, or you can specify the base privilege name, RunSelectedSteps. If you specify only the base privilege name and more than one instance of the base privilege name exists, then the method returns the value of the first base privilege it finds with that name. Refer to UserPrivileges for more information.
    Teststand callback for UserChanged Event...
    UserChanged Event
    Syntax
    ControlName_UserChanged ( user)
    Applies To
    ApplicationMgr
    Purpose
    Occurs when the current user logged in changes.
    Remarks
    Use this event to update the parts of your user interface that depend on user permissions when the current user logged in changes.
    Parameters
    user As User
    [In] Current user. If this parameter is NULL, there is no user logged in.

  • How can you test the video card?

    I just got a cinema display and I am having trouble calibrating it.
    I just notice that when I open up bridge CS4 it takes awhile for it to refresh. When I go to film strip view and click on a picture it will not diplay it.
    Then I change views and there is a line down the middle of the display where it gets update but the left side does not.
    Any thoughts on what it could be?
    Video card of is it the monitor?
    How can I test it?

    The only ways I can think of to test the card are XBench and the Apple Hardware Tests (insert Install DVD and restart while holding down 'd')

  • How can I test the HBA driver?

    Hi. I'm a graduate student majoring in Computer Science.
    I'm interested in writing driver drivers, especially SCSI driver driver. I modified HBA driver and compiled. but I don't know how to test it
    To my thinking because HBA driver is automatically loaded when boot, I can't replace it with my driver. Is it right?
    How can I test it ? Is kenel compiled with new driver???
    Thank you in advance.

    HBA driver is a loadable module and it is HBA-specific, i.e. it is written for a particular type of the controller hardware. It is not clear, if you have modified a driver for you boot device controller of some other HBA. Do not replace your original driver used for booting - you may not boot you system! You may add to your system the HBA for which your new driver is written and then debug it on a live system.
    You will find a lot of information about driver development and debugging in the on-line manual "Writing Device Drivers" posted on http://soldc.sun.com/developer/support/driver/IO_kit/PCI.html web page.

  • How can I test the effect of fill factor?

    I noticed that the fill factor in my data base script is set to 80 and I believe i could optimize the performance by setting it to 100. After setting it to 100, how can I test whether it has made a positive effect or not? Currently my database have about
    50 tables and thousands of records. Please advice.
    mayooran99

    You have to monitor the page splits/sec counter. If this counter increases considerably after you change the Fill Factor (FF) from 80 to 100, then it might be a indicator that you FF setting is too high. You can monitor the page splits counter in Perfmon
    but a caveat is that this counter is accumulative of all page splits across all DBs on a particular SQL Server. If the clustered index is on an ever increasing numeric field (like identity field), the page splits do happen at the end as the data gets added
    – this is not necessarily bad, but the Perfmon counter (Page splits/sec) includes the counts for even this type of page splitting too, which should be ignored. 
    Check your daily index fragmentation rate - this can be done by storing the index fragmentation levels in a custom table and comparing it with values after you increase FF to 100
    However, for heavily inserted/updated tables try changing FF value to 90 first (there is no point in changing FF to 100 for heavily  inserted/updated tables as they are bound to incur page splits)
    In general, changing the FF from 80 to 100 may improve the read performance of your queries as more data fits into a single page. 
    There is no blanket % that will be appropriate/optimal for all tables. It all depends on the data and the frequency of the key column that is being updated. So, the only correct answer is TEST, TEST, TEST...
    Satish Kartan www.sqlfood.com

  • How can I test the throughput speed of the router?

    How do I test the data speed of my Airport Extreme base? I want to test the functioning my airport extreme base. I experience frequent slowdowns and stoppages that don't occur when i access the cable modem directly.

    To test data throughput of your AirPort (or any router) you would need to test both the WAN-to-LAN and LAN-to-WAN interfaces. A typical way to do this would be to use a utility like ixChariot.
    For example, SmallNetBuilder has already done this with several different versions of the 802.11n AirPort Extreme Base Station (AEBSn). You may want to check them out to get an idea of what the AEBSn is capable of.
    Another approach that is commonly used but not as accurate is to use "end-to-end" throughput testing utilities that are readable available from the Internet, like Speedtest.net.
    Regardless of which technique you use, it is important to test throughput at each of your network segments to help pinpoint where the bottlenecks are. For example, if you do HD video streaming on your local network, you would want to test the throughput between the HD video source and the playback device.

  • How Can I Get The Cpu State With Java?

    are there any method to use??
    what's more,I also wanna to know how can I get
    the current ram that the System is using
    and the threads the System are running?
    Will you please share your knowledge here or
    write to tell me at [email protected]?
    Thanks!!

    if you know how to do this in c++, you can write native methods and use them in java.
    native methods forum:
    http://forum.java.sun.com/forum.jsp?forum=52
    tobias

  • How can I test for a special character in action script ?

    I have XML which I use within Flex. One off the values passed in is a special character (the infinity symbol). This displays great within the datagrid, but I want to do some other action script rendering based on this. How can I test this in an if statement.
    XML snippit
    <data>&#8734;</data>
    var infin:String = data[column.dataField];
    if (infin == "&#8734;") // This is the bit I can’t work out
                    // Do Something here

    Hi schaerm,
    you have to dig deeper.
    An idea is this one:
    The red marked word is containing the unit - in a coded way. Somewhere in the LV help you can find the description of this coding (I remember a chapter on memory representations of all LV datatypes...). (There surely is an easier or better way - but the example is done quic&dirty.)
    You can also format the number into a string and analyze the unit here...
    Message Edited by GerdW on 02-07-2010 07:21 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I get the container of a button after the button is clicked?

    I have two components:
    public class A extends JPanel implements ActionListener {
        public A() {
        public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
            // here need to know the instance of B to execute it's process()
            // but I can only know the button jb in B via the following code:
            JButton myjb = (JButton)(e.getSource());
    public class B extends JPanel {
        public ContainerInfoInput(ActionListener al) {
            JButton jb = new JButton("OK");
            jb.setActionCommand("B.ok");
            jb.addActionListener(al);
        public process() {
    public class Main {
        A a = new A();
        B b = new B(a);
    }How can I get the instance of B in which the button is clicked?
    Thank you

    I think it's a defect of the listener mechanism. Under the present circumstance, I must do it like the following:
    I must use another class M as a bridge:
    class A {
        public A() { }   
        public processA (String info ){}
    class B{
        public B(ActionListener al) {       
            JButton jb = new JButton("OK");       
            jb.setActionCommand("B.ok");      
            jb.addActionListener(al);  
       public String processB () {    }
    class M implements ActionListener  {
        public M() {
            A a = new A();
            B b = new B(this);
        public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
            if(command.equals("B.ok")) {
                String information =b.processB();
                a.processA(information);
    }Why not just use A to listen B and obtain instance of B through the ActionEvent?
    Anyone know a solution about it?

  • How can i set the space between two button?

    Hello,
    I have
    <mx:HBox>
    <mx:Button label="one" />
    <mx:Button label="two" />
    </mx:HBox>
    how can i set the distance between this two compotents?
    Thanks

    quote:
    Originally posted by:
    robinbouc77
    Hi,
    you can use horizontalGap property on HBox to change the
    space between your buttons. I think the default value is 6. You can
    also use <mx:Spacer/>, but changing the gap on HBox is
    probably the cleanest way ;)
    C U
    perfect!!! works fine

  • How can I open the 'time date browse button'?

    Hello!
    How can I open the 'time date browse dialog' from the time stamp control in my block diagram? I tryed it with the property node but couldn't find this item to open the 'time/date browse dialog'!
    Thanks in advance for your help

    There is no way to programitically bring up the dialog window for the timestamp control. I recommend building your own dialog window VI that will work by opening when you want the user to set the time and when it closes, it can programatically update the timestamp control. It will not be as pretty but it will be just as functional.

Maybe you are looking for

  • Status of an Order document

    what are the different status available for an order document. what is the table field that refers to?

  • Standard SRM reports excluding SAP BI in the landscape.

    Dear Experts, Kindly give the standard SRM reports available other than SAP BI. My system landscape doesw not have SAP BI. We are working in SRM 7.0 classic scenario and we dont have BI. Is there are any standard reports available for SRM7.0. Thanks

  • Uploading DBF file

    Dear friends,    I'm trying to upload DBF file.    I can easily convert DBF to CSV in excel and upload the CSV file by standard FM. But client wants to upload directly from DBF, no conversion in between.    I resoted to following techniques:-    1. T

  • Find out if sim-locked by EMEI/Serial Number?

    Can I find out whether an iPhone 4 is simlocked by knowing just the EMEI or serial number of the device? Don't wanna "start" the new phone without being sure. thx

  • Syncing iphone to a new mac computer

    my old computer was discarded before i could deauthorize my iphone from it so my new mac wont allow me to sync my songs from my iphone 4...what do i do now??