More elegant conditional statement?

Hello

Is there a more elegant way than a conditional to do the following?

I have a removable clip.  It contains a ComboBox and a color picker.

I mean Flash - if the user is using the combobox control or the color picker, do not allow dragging.

I did it for the comboBox - in my grabMe function, I've implemented a conditional that tells Flash, if, after having caught the mouse is not within the comboBox control, and then allow dragging.

If (evt.currentTarget.mouseX < 165 | evt.currentTarget.mouseX > 209)

My next plan was to add the coordinates of the color picker x in the equation, but I was wondering if there is a more elegant way to do it?

See you soon

Shaun

You can probably stop the mouseevents detected by the combobox and colorpicker controls from spreading into their listener functions.

Tags: Adobe Animate

Similar Questions

  • Conditional statements

    Hello!

    I want to display different content in the sidebar of a page 2 column template.

    I would like to create a template to use for a group of pages. According to the name of the page, I want to view the contents of specific pages in the sidebar.

    I thought that I would need to use conditional statements, but I don't know how to write this.

    The content of the different sidebar would be placed in content holders.

    Please help me understand this.

    Very much appreciated.

    Marian

    Easy with liquids conditional, but probably easier instructions with just named pages and content holders. Here's a solution:

    Create your sidebar provides with names like 'Sidebar-talk', "Sidebar-Home", etc..  The portion after the "-" must be the name of the page where the content will appear.

    Insert in your model, where will be the content of the sidebar:

           {module_contentholder,name="Sidebar-{module_pagename}"}
    
  • conditional statement in the system emails (invoice)

    I am trying to add a conditional statement in the invoice so I can add a link to download something, if there is a value in the custom 1 field. Is there anyway that I can use liquid or to conditional statement in any of the emails (invoice in particular) system to achieve? Thank you very much.

    Liquid is not supported in the e-mails like that at the moment.

  • Procedure of the ODI - Bind Variables in the conditional statements

    In an ODI procedure, is it possible to add a conditional statement around bind variable?  For example, if I use OdiOutFile as the command on the target and Oracle as the command on the Source, I can use bind variables to fill the data in this table (we are in fact using OdiInvokeWebService and passing a XML structure very complex, but it's easier for testing):

    OdiOutFile-FILE = C: / TEST. TXT

    < person >

    < first > #FIRSTNAME < / first >

    < Middle > #MIDDLENAME < / Middle >

    < last > #LASTNAME < / last >

    < / person >

    It is a way to add a conditional statement using one of these bind variables?  For example, if I wanted to test #MIDDLENAME null and null value, produced this portion of XML, such as:

    OdiOutFile-FILE = C: / TEST. TXT

    < person >

    < first > #FIRSTNAME < / first >

    < % if (#MIDDLENAME! = null) {% >}

    < Middle > #MIDDLENAME < / Middle >

    < %} % >

    < last > #LASTNAME < / last >

    < / person >

    This type of scriptlet syntax seems to work fine, as long as the binding variable is not in the mix (if I put "true is true" or "true == false" in the case, it shows or does not show this line in the XML file, as expected).  I use ODI 11.1.1.7.0

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

    Post edited by: KevinPratt

    Thanks for the reply!  As suggested, in what follows, I changed the command and it works as you want

    OdiOutFile-FILE = C: / TEST. TXT-APPEND

    < person >

    < first > #FIRSTNAME < / first >

    < @ if (!) (("#MIDDLENAME".equals(""))) {@ >}

    < Middle > #MIDDLENAME < / Middle >

    {< @} @ >

    < last > #LASTNAME < / last >

    < / person >

    Using the syntax <@ ...="" @="">serve your purpose. Also, I think you might want to include the variable binding in the quotation to avoid syntax errors.

  • Try to make this more elegant

    I'm doing better and more elegant script below.  I created reports where I use only 1 object type (only VM related events), but now I am using VM, ESXi and other info, and I don't know if this is the way to do it.

    $vms = get - VM
    $ESXihosts = get-VMHost
    $totalESXiHost = .count ($ESXihosts)
    $totalVMs = .count ($vms)
    $totalVMsOff = ($vms | where {$_.powerstate - eq "PoweredOff"}) .count
    $snapsTotal = ($vms |) Get - Snapshot) .count
    $Report = "" | Select ESXiHosts, VMs, 'Snapshots Total'
    $Report.esxiHosts = $totalESXiHost
    $Report.VMs = ' $totalVMs (the $totalVMsoff of these $totalVMs are turned off).
    $Report. "' Total of snapshots" = $snapsTotal
    Write $Report. FL
    "The virtual machines created in the last 14 days"
    Get-VIEvent - maxsamples 10000 - Start (Get-Date). AddDays(-14) | where {$_.} GetType(). Name - eq "VmCreatedEvent" - or $_. GetType(). Name - eq "VmBeingClonedEvent" - and $_. GetType(). Name - eq "VmBeingDeployedEvent"} | Sort descending Createduserid | Select Createduserid, username, FullformattedMessage | FL
    "VMs abducted during the last 14 days"
    Get-VIEvent - maxsamples 10000 - Start (Get-Date). AddDays(-14) | where {$_.} GetType(). Name - eq "VmRemovedEvent"} | Sort descending Createduserid | Select Createduserid, username, FullformattedMessage | FL

    The output is what I want, but I just think it can be improved considerably.  Thanks in advance for any help.

    The biggest improvement is probably eliminate the 2 calls of Get-VIEvent with 1 call.

    This

    "VMs created over the past 14 days" Get-VIEvent -maxsamples 10000 -Start (Get-Date).AddDays(-14) | where { $_.Gettype().Name -eq "VmCreatedEvent" -or $_.Gettype().Name -eq "VmBeingClonedEvent" -or $_.Gettype().Name -eq "VmBeingDeployedEvent" } | Sort CreatedTime -Descending | Select CreatedTime, UserName, FullformattedMessage | fl "VMs removed over the past 14 days" Get-VIEvent -maxsamples 10000 -Start (Get-Date).AddDays(-14) | where { $_.Gettype().Name -eq "VmRemovedEvent" } | Sort CreatedTime -Descending | Select CreatedTime, UserName, FullformattedMessage | fl
    

    can be done like this

    $events = Get-VIEvent -maxsamples 10000 -Start (Get-Date).AddDays(-14)
    "VMs created over the past 14 days" $events | where { $_.Gettype().Name -eq "VmCreatedEvent" -or $_.Gettype().Name -eq "VmBeingClonedEvent" -or $_.Gettype().Name -eq "VmBeingDeployedEvent" } | Sort CreatedTime -Descending | Select CreatedTime, UserName, FullformattedMessage | fl "VMs removed over the past 14 days" $events | where { $_.Gettype().Name -eq "VmRemovedEvent" } | Sort CreatedTime -Descending | Select CreatedTime, UserName, FullformattedMessage | fl
    
  • Under regions and conditional statements

    Greetings. Having a problem with conditional statements and subregions. With the help of apex 4.2

    I have a region (mutations) that has several items and a few buttons (button A, button B, etc.). I need to display conditionally button A. I have a sub region (People), which is a report of people deployed. I need a button to display the area of deployments, if there is no people in the report (People_ID is null) then the button will not appear. I tried to use a conditional, but I am not having any luck. Help, please. Thanks in advance.

    NewApexCoder wrote:
    I just tried to use a conditional button

    Condition Type: Point value / expression column 1 is NULL
    Expression 1: PEOPLE_ID

    This doesn't seem to work for me.

    No, it does not. (The inclusion of 'column' in this type of condition is inadequately documented. A "column" name only are referenced by such a condition, after presentation of a form in a table.)

    Use a Exists (SQL query returns at least one row) condition, based on the query in the subregion to report.

  • More elegant means of positioning divs

    Newbie alert! First post alert!

    Context: I'm not a programmer Professional (in the medical field), but have a lot of experience with HTML, Pascal, C++, and Assembly.

    Because I don't want to be laughed at, I would like to do more CSS and get away from tables.

    . Editorial {most of the things in CSS I understand quickly – simply move the basics of programming in a different context.

    But the positioning is a major issue. I played for days on a simple configuration and most of them look like Picasso. }

    I want to make a simple page as a 'model' that can be used throughout a huge site.

    TopLEFTbox - small box for a logo

    TopBAR - horizontal rectangle for a title

    LeftBAR - a vertical rectangle for the navigation

    Subcontainer - a big box in which will go a lot of different pages

    I had to go back to "absolute positioning". It works very well, looks like I want it to, but if I had to bet, there are ways a more elegant that the pros would do this.

    You can direct me in the right direction? (I will never ask you to coding - if help you it is fantastic, but I would never ask to do my work for others).

    Here's the code - simple and direct, boring:

    <! doctype html >
    < html >
    < head >
    < meta charset = "utf-8" >
    < title > new Login Page < /title >
    "" < link href = "... / NewLogin.html" type = "text/css" >

    < style >

    Body {background-color: #EFEFEF ;}}

    . Container {max-width: 1260;}
    min-width: 780;
    background-color: #E4E4E4;
    Auto margin: 0;
    overflow: hidden;
    Width: 90% ;}

    .topleftbox {position: absolute;}
    top: 0;
    Left: 0;
    Width: 50px;
    height: 50px;
    background-color: #F9FABE;
    text-align: center ;}

    .Topbar {position: absolute;}
    Top: 0px;
    right:-51px;
    height: 50px;
    Width: 100%;
    background-color: #F9FABE;
    text-align: center ;}

    .leftbar {position: absolute;}
    top: 51px;
    left: 0px;
    height: 100%;
    Width: 50px;
    background-color: #F9FABE;
    text-align: center;
    padding-bottom: 0px;
    overflow: hidden ;}

    . Subcontainer {position: absolute;}
    top: 51px;
    left: 51px;
    height: 100%;
    Width: 100%;
    text-align: center;
    background-color: #6FF ;}

    < / style >
    < / head >

    < body >

    < div class = "container" > <! - large containers - >

    < div class = "topleftbox" > < p > E < /p > < / div >
    < div class = 'bar' > < p > top < /p > < / div >
    < div class = "leftbar" > < p > left < /p > < / div >
    < div class = "subcontainer" > < p > < p > Sub < / div >

    < / div > <! - large containers - >

    < / body >
    < / html >

    Hi Tim,.

    only briefly mentioned, you will find a good range of beautifully written patterns:

    http://ALT-Web.com/Free-CSS-templates.shtml

    Hans-Günter

  • Conditional statement to improve the functions of navigation bar

    Question of AS2:

    I have created a navigation bar of four buttons with the normal state in box 1 and place the cursor in the frame of 10, 20, 30 and 40, States.

    Hover States are made by adding a mask on each button to reveal a layer of color differetly on frame 10, 20, 30 and 40

    I have scripted buttons like this:

    on (rollover) {gotoAndPlay (10);}

    }

    (deployment) {gotoAndStop (1);}

    }

    (press) {gotoAndPlay (1);}

    }

    on (release) {gotoAndPlay (9)}

    }

    On the four frameworks there is also an action that says:

    Stop();

    to import flash.external.ExternalInterface;

    {btn1.onRelease = Function ()}

    ExternalInterface.call("saveglobalscore",score) ("f1");

    }

    It all works well. The button triggers a javascript function on the page.

    Request:

    Can I do the buttons stay in addition to their States when a button is clicked, so it serves as a clear marker that the viewer of the page selected and seeks to?

    Page loading on the release, but as soon as the pointer leaves the button, the command deployment on-site the playhead to frame 1 (with the normal state)

    (1) is the following:

    Put a conditional statement to say frame 1:

    If the read head came to frame 10 then go to section 10 and stop.

    If the read head came to frame 20, then go to section 20 and stop.

    If the read head came to frame 30 then go to frame 30 and stop.

    If the read head came to frame 40 then go to the frame of 40 and stop.

    Another thing: stay on the frame 1.

    ?

    (2) or is there another solution that I have not thought?

    Often, it would be useful to be able to follow where the read head just left for example with scroll on the side and other advanced layouts.

    Is this possible and if so, how?

    Thank you in advance.

    ggaarde

    var mcA:Array = [mc1, mc2, mc3,...];

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

    .Ivar mcA [i] = i;

    mcA [i] .buttonMode = true;

    mcA [i] .addEventListener (MouseEvent.MOUSE_OVER, overF);

    mcA [i] .addEventListener (MouseEvent.MOUSE_OUT, outF);

    mcA [i] .addEventListener (MouseEvent.CLICK, clickF);

    }

    function overF(e:MouseEvent):void {}

    MovieClip (e.currentTarget) .gotoAndStop ("over");

    }

    function outF(e:MouseEvent):void {}

    {if (MovieClip (e.currentTarget) .lastClicked)}

    MovieClip (e.currentTarget) .gotoAndStop ("clicked");

    } else {}

    MovieClip (e.currentTarget) .gotoAndStop ("up");

    }

    }

    function clickF(e:MouseEvent):void {}
    for (var i: int = 0; i<>

    {if (mcA [i]. Clicked)}

    mcA [i] .gotoAndStop ("up");

    }

    }

    MovieClip (e.currentTarget) .gotoAndStop ("clicked");

    do something else. has clicked the button movieclip MovieClip (e.currentTarget) .ivar th

    }

  • Conditional statements in IE6 error?

    http://MCEC.my/

    I have added a conditional statement that only target IE6 to render css and javascript.

    all other browsers, IE7 and before use will support the general set of css and js...

    However when I saw in IE 6 and IE7 I pulled out the rendering of the conditional statement:

    ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Malaysia - China Entrepreneur Conference 2012 < /title >

    <!-[if! IE6] >->

    < link href = "include/reset.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "include/style.css" rel = "stylesheet" type = "text/css" / > "

    < link rel = "stylesheet" href = "include/room-slider - styles.css" type = "text/css" / >

    "< script type =" text/javascript"src="include/jquery-1.7.2.min.js "> < / script >

    "< script type =" text/javascript"src="include/coin-slider.min.js "> < / script >

    < script type = "text/javascript" src = "include/bw - menu.js" > < / script >

    <!-<! [end if] >->

    <!-[if gte IE7] >

    < link href = "include/reset.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "include/style.css" rel = "stylesheet" type = "text/css" / > "

    < link rel = "stylesheet" href = "include/room-slider - styles.css" type = "text/css" / >

    "< script type =" text/javascript"src="include/jquery-1.7.2.min.js "> < / script >

    "< script type =" text/javascript"src="include/coin-slider.min.js "> < / script >

    < script type = "text/javascript" src = "include/bw - menu.js" > < / script >

    <! [end if] >->

    <!-[if lte IE6] >

    < link href = "include/reset.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "include/style.css" rel = "stylesheet" type = "text/css" / > "

    < link rel = "stylesheet" href = "include/room-slider - styles.css" type = "text/css" / >

    "< script type =" text/javascript"src="include/jquery-1.7.2.min.js "> < / script >

    "< script type =" text/javascript"src="include/coin-slider.min.js "> < / script >

    < script type = "text/javascript" src = "include/bw - menu.js" > < / script >

    < link href = "include/ie6PNGFix.css" rel = "stylesheet" type = "text/css" / > "

    <! [end if] >->

    < / head >

    ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

    23-04-2012 14-32-40.jpg

    Where have I gone wrong? Thanks for the help

    All comments of IE around your css/js alternatives links are a little distorted... try it below:

  • Conditional statement advanced interaction checking if a variable is odd/even?

    Hello

    I was wondering if it is possible to have a conditional statement that checks if a variable is even or odd? I am using Captivate 5.

    Here's what I would do, and I know that I could do the same thing with the two sepaparate buttons, but I am curious to know if it is possible to do it with a button only.

    What I'm trying to do, is to give learners the ability to display some documents as a resource on their screen while they are listening for an example of an interaction with the customer. During this interaction some forms have to be filled, and I want learners to be able to display a before and after of the completed form, if they would like to see it.

    The easy way to build that according to me is to have a single button that would make the visible resource and the other button that hides the resource. I tried it and it works like a charm using standard measures.

    Since there are several resources that I want to put available for learners, with two buttons for each resource can clutter the slide a little, so I thought I'd try if I could create the same function using a button with a tip action.

    Whenever the learner clicks on the button for a resource, the variable associated with the resource is increased by 1. I would then have a conditional statement, saying: If the variable is odd-> see the resource, if the variable is same-> hide the resource.

    I can't find the option in the advanced actions to compare if a variable is even or odd. I can only find how to compare to a literal or another variable.

    Hello

    May I suggest another approach instead of odd/even?

    I would build a conditional action with 2 decisions. In the first decision, it of really a standard action (use IF 1 = 1, while it is still running), use this statement:

    Expression v_one = 1 - v_one

    v_one is the variable user for this button. It will always pass the value of this variable between 1 and 0. If the variable has no value assigned when set, first time user clicks it will get a value of 1, the second time the value 0.

    Second decision will be your cheque to condition:

    IF v_one = 1

    THEN hide resources

    ELSE to see the resource

    I hope you get the idea?

    Lilybiri

  • Start or stop the conditional statement

    I have an animation that plays from the beginning to the end. I would like to add a conditional statement that

    IF the animation is to play and click the ANIMATION BUTTON, it stops and goes back to the framework.

    OTHERWISE (if the animation is on frame one (did not play) it starts to play the end.)

    My script goes like this-

    animation_btn.addEventListener (MouseEvent.CLICK, startplaying);

    function startplaying (event: MouseEvent); {} void

    Play();

    Animation.Play ();

    }

    the animation is the name of the animation time line.

    Your help is very appreciated.

    assuming that the movieclip you wish to order is the animation:

    animation_btn.addEventListener (MouseEvent.CLICK, startplaying);

    function startplaying (event: MouseEvent); {} void

    {if(animation.currentFrame==1)}

    Animation.Play ();

    } else {}

    animation.gotoAndStop (1);

    }

    }

  • I want to hide a DIV element using the IE conditional statement. Is this possible?

    Hi all

    IE has trouble reading my video, I just want to insert a conditional statement saying Internet Explorer to hide the video. Is this possible and if so, how? Thank you very much in advance for any help.

    Here is the URL (http://austinlindsay.com/iplayers.html) and the code of the div if it's any help (I know it is a little rough, sorry!):

    < div id = "iplayers_demonstration" > iPlayers video demonstration
    < object classid = "' clsid:02BF25D5 - 8 c 17 - 4B 23 - BC80 - D3488ABDDC6B" codebase =" " http://www.Apple.com/qtactivex/qtplugin.cab "height ="431"width ="791"scale ="aspect"> "
    < param name = "src" value = "video/iplayers_demonstration.mp4" >
    < param name = 'type' value = "video/quicktime" height = "431" width = "791" scale = "aspect" >
    < embed src = "video/iplayers_demonstration.mp4" height = "432" width = "738" scale = "aspect" autoplay = "false" type = "video/quicktime" pluginspage =" " http://www.Apple.com/QuickTime/Download/ "> "
    < / object >
    < / div >

    If it is not possible, my only solution is to solve the following problem, so if anyone has any suggestions, please let me know. Thank you very much

    Problem:

    I joined several video on my site and their rescheduled so that they fit inside my container. It works fine in Firefox, Safari, and IE8, I'm told. But there is a serious problems with IE7, where videos that play are cropped. This is probably caused by when I have rescaled the video, and for some reason, IE not resized the real images, just the viewing area. It is also, does not recognize "autoplay ="false"because that videos play automatically when the page is loaded.

    But it does not appear when you test it in IE. No idea why?

    Because you have told IE to stay away!

    Because you want to override what is in your style sheet, it should come theof the embedded document after links to CSS and external style sheets.

  • Stop an flv using a conditional statement

    How you will prevent an FLV using a conditional statement where the condition is if the FLV file is playing?

    I'm using AS 3.0. My best shot has this:

    If (demo.flv == game) {}
    Demo.FLV.Stop ();
    }

    I'm sure that the party "is game" is not going, but I can't find the right code that checks to see if the video is currently playing.

    My flv component has an instance name of "demo". The command 'demo.flv.stop (); works great as a non conditional, but the flv file is not always play with my set-up of navigation when you fall on the frame with the code, so I need a conditional.

    Thank you!

    The help docs for AS3 Flash to discuss in the section of the FLVPlayback component class.  This is a Boolean property, so you should probably just to use...

    {if (Demo.Playing)}
    Demo.Stop ();
    }

Maybe you are looking for