Set a Variable for a timer with a cursor

... In a previous post, I got a big hint of kglad.

I had thought to be closer to the final solution, but I need a little more distance (certainly the last) of my script.

It covers how to have a variable for a timer.

I need to get the variable from a cursor.

I tried the script below, look to MyVar (line 5, 9, 16), but it does not work,

The timer is always 1000.

1 import fl.controls.Slider;

2 import fl.events.SliderEvent;

3 import fl.controls.Label;

var MyVar = 1000 4;

5 aSlider.addEventListener (SliderEvent.CHANGE, changeHandler);

___SLIDER

function 6 changeHandler(event: SliderEvent): void {}

7 MyText.text = event.value;

8 track (event.value);

9 MyVar = (event.value);

10}

11 //__________________________________________

12 var myNum: number;

13 var mySound: Sound = new Click1();

14 var mySound2: Sound = new Click2();

15

16 var fl_TimerInstance: Timer = new Timer (MyVar, 8);

17 fl_TimerInstance.addEventListener (TimerEvent.TIMER, fl_TimerHandler);

18

Button.addEventListener (MouseEvent.CLICK, ButtonCount) 19.

20 ButtonCount(event: MouseEvent) function: void {}

21 fl_TimerInstance.reset ();

22 fl_TimerInstance.start ();

23

24 //trace ("trascorsi secondi:" + fl_SecondsElapsed);

25 //fl_SecondsElapsed++;

26}

27 fl_TimerHandler(event: TimerEvent) function: void {}

28 if (event.currentTarget.currentCount % 2 == 1) {}

29 myNum = Math.ceil (Math.random () * 8);

30 record (myNum);

31 / / mySound.play ();

32} else {}

33 / / mySound2.play ();

34 trace (myNum);

35}

36}

use:

1 import fl.controls.Slider;

2 import fl.events.SliderEvent;

3 import fl.controls.Label;

var MyVar = 1000 4;

5 aSlider.addEventListener (SliderEvent.CHANGE, changeHandler);

___SLIDER

function 6 changeHandler(event: SliderEvent): void {}

7 MyText.text = event.value;

8 track (event.value);

9 MyVar = (event.value);

fl_TimerInstance.delay = MyVar;

10}

11 //__________________________________________

12 var myNum: number;

13 var mySound: Sound = new Click1();

14 var mySound2: Sound = new Click2();

15

16 var fl_TimerInstance: Timer = new Timer (myVar, 8);

17 fl_TimerInstance.addEventListener (TimerEvent.TIMER, fl_TimerHandler);

18

Button.addEventListener (MouseEvent.CLICK, ButtonCount) 19.

20 ButtonCount(event: MouseEvent) function: void {}

21 fl_TimerInstance.reset ();

22 fl_TimerInstance.start ();

23

24 //trace ("trascorsi secondi:" + fl_SecondsElapsed);

25 //fl_SecondsElapsed++;

26}

27 fl_TimerHandler(event: TimerEvent) function: void {}

28 if (event.currentTarget.currentCount % 2 == 1) {}

29 myNum = Math.ceil (Math.random () * 8);

30 record (myNum);

31 / / mySound.play ();

32} else {}

33 / / mySound2.play ();

34 trace (myNum);

35}

36}

Tags: Adobe Animate

Similar Questions

  • How to set global variables for use by all THE #subform [0] items of form1. ?

    Hi all

    I don't know how to code javascript but am new to Adobe LiveCycle.  When I open the script editor, I have the following code (the code is in United Nations in bold):

    -form1. #subform [0]: initialize :-(FormCalc, client).

    //////////////////////////////
    TO START: SET GLOBAL PRICES.
    //////////////////////////////

    var Cityscope_Sydney_CostUser1 = 60,39;
    var Cityscope_Sydney_CostUsers2to5 = 3.02;
    var Cityscope_Sydney_CostUsers6to20 = 1.21;
    var Cityscope_Sydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_Sydney_CostHardCopyWithoutOnline = 54,67;
    var Cityscope_Sydney_CostHardCopyAdditional = 14.59;

    var Cityscope_NorthSydney_CostUser1 = 48,40;
    var Cityscope_NorthSydney_CostUsers2to5 = 2.42;
    var Cityscope_NorthSydney_CostUsers6to20 = 0.97;
    var Cityscope_NorthSydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_NorthSydney_CostHardCopyWithoutOnline = 43,54;
    var Cityscope_NorthSydney_CostHardCopyAdditional = 14.59;


    ////////////////////////////
    END: SET GLOBAL PRICES.
    ////////////////////////////

    -form1. #subform [0]: enter :-(FormCalc, client).

    -form1. #subform [0]: output :-(FormCalc, client).

    -form1. #subform [0]: calculate :-(FormCalc, client).

    -form1. #subform [0]: validate :-(FormCalc, client).

    -form1. #subform [0]: preSave - (FormCalc, client).

    < < = etc etc etc = > >

    -form1. #subform [0]. Item1Cost::initialize :-(JavaScript, client).

    -form1. #subform [0]. Item1Cost::enter :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::exit :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::calculate :-(JavaScript, client).

    Store the values of the form of friendly names.
    var AreaSelected = Item1Area.rawValue;
    var NumberOfUsersSelected = Item1Users.rawValue;

    Declare other variables.
    var Users1Calculation;
    var Users2to5Calculation;
    var Users6to20Calculation;


    Calculate the cost to the "components" user will depend on the number of users selected for the region.
    Switch (true)
    {
    If (NumberOfUsersSelected < 2):
    Users1Calculation = NumberOfUsersSelected * Cityscope_Sydney_CostUser1;
    Users2to5Calculation = 0.00;
    Users6to20Calculation = 0.00;
    break;
    If (NumberOfUsersSelected > 1 & & NumberOfUsersSelected < 6):
    Users1Calculation = Cityscope_Sydney_CostUser1;
    Users2to5Calculation = (NumberOfUsersSelected - 1) * Cityscope_Sydney_CostUsers2to5;
    Users6to20Calculation = 0.00;
    break;
    If (NumberOfUsersSelected > 5):
    Users1Calculation = Cityscope_Sydney_CostUser1;
    Users2to5Calculation = 4 * Cityscope_Sydney_CostUsers2to5;
    Users6to20Calculation = (NumberOfUsersSelected - 5) * Cityscope_Sydney_CostUsers6to20;
    break;
    by default:
    Alert ("BROKEN: calculate the individual components of cost of use will depend on the number of users selected for the region.");

    }

    apply the total cost for this article
    Item1Cost.RawValue = Users1Calculation + Users2to5Calculation + Users6to20Calculation;

    -form1. #subform [0]. Item1Cost::validate :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseEnter :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::mouseExit :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::change :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::full :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseUp :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseDown :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::click :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::preSave - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::postSave - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::prePrint - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::postPrint - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::preSubmit:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Cost::docReady - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::docClose - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::ready:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Cost::ready:layout - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::initialize :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::enter :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::exit :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::calculate :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::validate :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseEnter :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::mouseExit :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::change :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::full :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseUp :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseDown :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::click :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::preSave - (FormCalc, client).

    -form1. #subform [0]. Item1Users::postSave - (FormCalc, client).

    -form1. #subform [0]. Item1Users::prePrint - (FormCalc, client).

    -form1. #subform [0]. Item1Users::postPrint - (FormCalc, client).

    -form1. #subform [0]. Item1Users::preSubmit:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::docReady - (FormCalc, client).

    -form1. #subform [0]. Item1Users::docClose - (FormCalc, client).

    -form1. #subform [0]. Item1Users::ready:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::ready:layout - (FormCalc, client)-

    .. and so on and so forth...

    In short, I want the code in:

    -form1. #subform [0]. Item1Cost::calculate :-(JavaScript, client).

    .. .to be able to access the variables I created in:

    -form1. #subform [0]: initialize :-(FormCalc, client).


    (I guess that's where I store global variables)

    At this point, global variables are not accessible with the above configuration.  Was the only one I can get this working is to cut and paste the Globals in each item of form1. #subform [0], which of course defeats the purpose of global variables!  I intend to have a lot more items so wouldn't duplicate global variables for each of them!

    Can someone show me how to do this?

    Any help is very appreciated!

    Thank you

    Stanbridge

    Post edited by: stanbridgej - colors and fonts or not will not save.  Are bolded my question make (non-fat) code easier to read (I hope).

    I haven't used Formccalc, but I thought it would be the same regardless. Insert a script object to the top of the hierarchy and call it, for example "sco." Paste the Globals. Then refer to variables of the extent that sco. Cityscope_Sydney_CostUser1, etc. Make one

    App.Alert (sco. Cityscope_Sydney_CostUser1);

    one of the fields. If the debugger is activated, it will tell you if it cannot resolve the reference as "sco. In this case, you may need to use the som expression to reference the script object, for example

    var scoScript = xfa.resolveNode ("topOfHierarchy.sco");

    scoScript.Cityscope_Sydney_CostUser1

    But if as close as possible to the top of the hierarchy above should work.

  • How do I set the power for different time?

    Hello everyone,

    I try to set the different value of RF power for different time as shown in the figure. To do this, I tried using the timer 'Elapsed time '. A counter that counts each time is an array index, as shown in the attached VI. But, the meter does not not.  I didn't know what went wrong. would you lelp me please?

    I thank very you much.

    I would like it.

  • How to set a variable to a string with special characters?

    I want to set a variable

    < cfset inputstring = "< img src ="... /... /.. "/ Server/Win/Form/Stamp/string_1" / > "/ >"

    but I get the error message:

     Invalid CFML construct found on line 184 at column 32.
    ColdFusion was looking at the following text:
    
    
    .
    

    I try different ways, what I am, I am doing wrong?

    You must escape the inner quotes or mix single and double quotes.  Try:

    "/>

    or

    Oh, and oblique aft are not necessary in the tag.

    -Carl V.

  • Why Windows 7 setting would deliver a black screen with the cursor visible before you load the Office?

    I had a very unusual event this morning.  I am running Windows 7 on a desktop computer.  On startup, I reached the login screen and proceeded to connect to my name.  Prior to loading the desktop computer, however, I was in a black screen with the cursor visible.

    1. I am able to load successfully under another user ID.
    2. I am able to boot in safe mode (with networking) using my own code.
    3. I did a system restore with no luck.  The problem persists.
    4. I don't think it's a driver issue because it would affect the two IDS and who does not.
    5. I have a touch screen and the white slider moves even in the place where I touch.  (what works)

    Issues related to the:

    1. what "custom" setting would result in a shift of the display of this type?

    2. If I go to Windows 8, will I have the opportunity to 'reset' my display options?  Or it will automatically upgrade to the wrong setting?

    Thank you.  Any guidance would be greatly appreciated.

    Thank you for your solution.

    The problem turned out to be the result of a combination of events.

    1. I did a change of media display a week ago but never restarted.
    2 MS did the periodic security update that rebooted the machine overnight.
    3. the update may have actually been in the middle of the installation when I got to my machine in the morning.
    4. when the screen has not responded, I restarted manually by pressing the power button.

    Ultimately, I was able to access Task Manager and found several instances of several components running.  When I "force stop" several of them, the office completed and I was in business.

    I still have the wide black border around my 'Live TV' screen in Windows Media Center, but that's another question for another time.

    Once again, thank you for the time spent to help me.

    Best regards

    Steve

  • HP ENVY h8 - 1520t: set the bios for the site with riders

    I need jumper to clear the BIOS settings in the CMOS. Does not start to any menu or menu setup after getting out of battery and replacement.

    Thank you

    Chet wood

    Product number:

    C9D47AV #ABA

    • HP ENVY h8 - 1520t CTO desktop PC
    • Win 8 64-bit
    • Microprocessor Intel core i7-3770 CPU @ 34.0 Ghz
    • 8 GB MEM
    • Mem slot 1 8 GB 1600 Mhz Micron
    • Chart AMD Radeon HD-7570
    • Current RES 1920 x 1080
    • refresh rate 60
    • 2AD5 Board of Directors system 1.03

    BIOS 8.14

    2AD5 Board of Directors system 1.03

    The motherboard is the same as indicated, BUT the jumper CMOS block illustrated on the Web page must be another block I watched card mother pictures of this model from EBay and they show the jumper in the position that you indicated.  There are two blocks.  There are two blocks of blue jumpers with the configuration pins as shown in the picture I posted.  I think that what the picture posted is saying leave the jumper on the right side block is and only move the jumper on the left side of the position shown, then again.  Just to clarify, there is a block under this block, we want, and who says "ROM_RECOVERY" and this block has a single rider together 1-2.  Jumper block we are debating is actually marked "CMOS-PW.

    Hope that helps clear things upward.

  • wireless set in place for first time use

    HI my name is Amit Bahuguna

    I want wireless configuration that I have router now I want that this set up by myself please what will be the first step to go

    Concerning

    Amit bamba

    Here is a page that explains it better that I could: http://windows.microsoft.com/en-us/windows/connect-internet#1TC=windows-8

    After you have an access provider and that you have connected your hardware by following the instructions of the ISP, you might already be connected to the Internet. To find, open your web browser and try to visit a Web site. If the site does not appear, try this:

    • To connect to a network by striking swipe in the right screen edge, stitching settings (or if you use a mouse, pointing to the bottom right of the screen, move the cursor upward and then clicking on settings), and then type or by clicking on the network icon (or ). Press or click the network you want to connect, and then press or click on connect.

    If you are still having problems connecting to the Internet, see why I can't connect to the Internet?.

  • set up forms for the execution with pure java

    I know that the file formsweb.cgf is where I can fix this, but that someone has
    with java WORKNG pure (without jinitiator) and has any problem to navigate between fields?

    EMH is my java section in formsweb.cfg

    [appjava]
    pageTitle = Java Forms Version 10.1.2
    Form = init.fmx
    envFile = javaenv.env
    baseHTML = webutilbase.htm
    baseHTMLjinitiator = webutiljpi.htm
    baseHTMLjpi = webutiljpi.htm
    baseHTMLie = webutiljpi.htm
    webUtilArchive = webutil.jar, jacob.jar
    Archive = gif.jar, frmall.jar, laf_1012.jar
    lookAndFeel = oracle
    imageBase codeBase =
    separateFrame = true
    networkRetries = 30

    and the file javaenv.env (without the commented lines)
    -------------------------------------------
    ORACLE_HOME = / opt/oracle/ias
    FORMS_PATH = / opt/legadmi/formas: / opt/legadmi/pll: / opt/oracle/ias/forms: / opt/legadmi/webutil/forms
    WEBUTIL_CONFIG=/opt/legadmi/webutil/Server/webutil.cfg
    FORMS_RESTRICT_ENTER_QUERY = FALSE
    CLASSPATH=/opt/Oracle/IAS/forms/Java/laf_1012.jar:/opt/Oracle/IAS/forms/Java/gif.jar
    PATH = / opt/oracle/ias/bin
    GRAPHICS60_PATH =
    LD_LIBRARY_PATH = / opt/oracle/ias/lib: / opt/oracle/ias/jdk/jre/lib/i386: / opt/oracle / / jdk/jre/lib/i386/ias Server
    -------------------------------------------------

    He begins to java, but I can't navigate between fields, in some forms,
    any help?
    Thank you!

    Solution: migrated to 11g

  • Table row with loop for each group to set the variable.

    HI: There is probably a simple answer for this, but I don't the have not found...

    I have a single row table to move through a group to set a variable containing a sum running. I'm not display the amount in the table but when I saw the report, I see that the table is expanding (add lines) for each loop.

    The only line table has 3 columns.

    1st column
    <? for-each: AC_GROUP? >

    2nd column
    <? xdoxslt:set_variable ($_XDOCTX, 'xAmtVar', xdoxslt:get_variable($_XDOCTX,'xAmtVar') + CURRENT_AMOUNT)? >

    3rd column
    <? end foreach? >

    Can I use <? for each group? > or something else. My requirement is to set the value of the variable with the total running, but because the loop is adding lines for each value he travels (though not displayed), it's also affecting other areas of the presentation of the page.

    Hope it makes sense. Thanks in advance.

    You can do it many ways.

    No need to loop
    You can create a variable and specify the amount of the sum directly to that.

    
    

    or

    loop through, then add as you do.

    
    

    give any space or enter characters in a word between them, just put it in a single form field will be

    But as I said, I'd definitely go with the first option.

  • Help with setting/get variables in app

    Hello

    I have an application that behaves as follows:

    1. the user connects.
    2. the user is presented with a list of projects; user clicks a project to drill down for this project.
    3. the user is presented with project information that includes 4 separate lists tasks grouped by week. So there are tasks for the current week in what is more task for 3 weeks on.
    4. the user can change the talks or create new ones for each of the 4 weekly groups.

    Given that, on the home page for a project I have set up a report and the form for each weekly group. I also have an element for the project as well as each weekly group id id. Here, the goal is that when a user clicks on the 'create' button, they can create a new task for a group of the weekly. However, this does not work.

    For the first group of weekly when I click on 'create' I am presented with the form to fill out for the task. All the information is there, including the correct id for this weekly group so that the task is assigned to this property. However, when I save I get an error that says that this identifying particular is set to null.

    For the next three groups when I click on 'create' I give myself the same thing as above, but without the weekly group id. Even if I put it and record things, I get the same error.

    So, I wonder what I did wrong in the flow of the app. I put these variables too early, too late? Am I really not pick up their despite what I see on my screen? I missed some foundations of the Apex here?

    Thanks in advance for your time and help.

    Jon

    It should be

    : ASK = "CREATE";

    'CREATE' is the name of the create"" button.

    CITY

  • Setting up the Environment Variables for the unit

    Hello

    I'm trying the license of the unit on an internet connection that requires a proxy. The unit for some reason any he manages really evil and tries to communicate without using the proxy server. I've been looking around and can't seem to find a clear answer on how to do it. Unity forums suggest to use Environment Variables, but only to give me a method (the ~ /.) MacOSX/environment.plist method) for (what they claim is Yosemite) but seems to be the Lion of the mountains or earlier as far as I can tell.

    What I have to use Environment Variables or is there another way to do it?

    It must also be that variables apply globally to all users on the computer not only la I would be connected at this time.

    Concerning

    Running Mac OS 10.10.5

    aunchd-conf-no-longer-works-in-os-x-yosemite https://StackOverflow.com/questions/25385934/setting-environment-variables-via-l

    http://lajosd.blogspot.be/2015/06/place-following-content-enhance-it-to.html

  • Im trying to sinc my email contacts from my iphone to my new computerhow I can do I pluged my phone in my computer and he asked to do it but sinc everthing contacts im having a hard time with windows 10 is for the younger generation

    I am trying to sync my contacts from my iPhone to my new computer email how I do I plugged my phone into my computer and he asked to do everything but synchronize the contacts that I have a hard time with 10 windows, that's for the younger generation

    If you synchronize contacts using iCloud, you cannot synchronize them in iTunes. More information would be useful.

  • Since the installation on my Windows 7 64 - bit installed, Firefox has constantly gotten slow that hour passes, hangs for 10-15 seconds at a time and just gets worse over time with updates and all.

    Since the installation on my Windows 7 64 - bit installed, Firefox has constantly gotten slow that hour passes, hangs for 10-15 seconds at a time and just gets worse over time with updates and all. It was fast when I installed first, but of the six latest mos has slown to a crawl.

    upgrade your browser Firefox 8 and try

  • Cannot set the password for hard drive on the W530 with Intel SSD 520

    Hello

    I have a w530 with an Intel SSD 520 in primary hard drive Bay. Whenever I try to set a password for the primary hard drive, it doesn't stick. If I chose master + user or simply user, I will enter the password, it will take the passwords without producing an error and then just dump back me to the screen of passwords while leaving the disabled hard drive password.

    BIOS is on the latest version for the w530 and SSD, the machine seems fairly normally operate differently.

    Does anyone have ideas how I can activate the password? Thank you!

    Hi, ctenorman

    I did some research and came across this thread of Intel. There are a few people in the thread who were able to set the password on this particular drive. It seems that changing the BIOS "SATA" compatibility mode, set the password, restart, and then change it to "AHCI" worked for some, but not all customers with this player.

    Good luck and let me know how it goes

    Adam

  • How to set the clock for the hours, minutes, and seconds with Windows XP

    How to set the clock for the hours, minutes, and seconds with Windows XP

    I don't know of your question.  If you ask how to show the clock in the tray system with hours, minutes and seconds, then download & run "Tclock Light".  Windows will not natively display the seconds.

    TClock Light: <> http://homepage1.nifty.com/kazubon/tclocklight/index.html >

    HTH,
    JW

Maybe you are looking for