several timers

Is it possible to have more than one timer running?

I have several clips that I want to do something for a while and then do something else, but I need them all to run at the same time. Before I start I would like to know if (for as long as the timer is running inside of the chronology of movieClips and not the main timeline) they work independently?

Tina

While you have not indicated your intentions for the creation of the timers, you should be able to run several simultaneously.  You can set up a simple test for you to respond to your request, such as...

Function f1 (val) {}
trace (Val);
}
setTimeout (f1, 1000, 1);
setTimeout (f1, 2000, 2).
setTimeout (f1, 3000, 3);
setTimeout (f1, 4000, 4);
setTimeout (f1, 5000, 5);

Tags: Adobe Animate

Similar Questions

  • structures of several timers event

    How would it be best to implement waiting periods of a statemachine event where there will be three independent counters for LV8.6? a 50ms, one to 300ms and the other 10 s. The control of the event already handles change events of value to a number of Boolean screws I would use timers to know when I should update my screen (50ms for LEDs, 300ms to measure the current through GPIB, 10s for temperature measurements).

    What I thought about so far:

    * I'm not sure that the time-out event is what I want, because it restarts every time that the structure of the event is entered and there is only a single clock value. I need to get the current time, look up when I expect it the next event to fire and to program that. That's how I'm leaning towards at the moment.

    Support parallel to the structure of the event loops would be problematic because it lives inside a state machine and could only advance when an event occurs and a timer has expired. It would be too complicated for what it is.

    jcurl wrote:
    [..]

    So you're saying there are no such thing as the "timer" events, where I put on a control and it can raise an event that the structure of the event can respond to?

    [...]

    Jason,

    I don't know if we are talking about the same thing here.

    I just wanted to point out that, from my experience, the time-out of the structure of the event leads to confussion and more often leads to applications programming based with polling stations in a single loop of mixture. And it's a bad idea.

    You can always set the user events and create a folder for the user event. The source of the user event could be a timer... so you have all the options you would like to.

    So for example:

    A loop contains the structure of the event (nothing more). Timing loops is defined by the frequency of incoming events. EventSources for example are several buttons, digital control and an event to a user.

    Loop B queries to some States of your system. If the desired set of States is given, you create a user event.

    So the loop B would somehow 'time' in A loop...

    I hope that now expressed in a better way,

    Norbert

    PS: Please keep in mind that it is recommended to use a single structure of single event in the app!

  • How can I reset several timers?

    I'm relatively new to Action Script and I'm having a hard time to find the solution to my timers

    loop after the last complete timer. Can someone please?

    Here is the code:

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;


    var learnDone:Timer = new Timer (3000);
    learnDone.addEventListener (TimerEvent.TIMER, timerDone1);
    learnDone.start ();

    var learnDoneMore:Timer = new Timer (6000);
    learnDoneMore.addEventListener (TimerEvent.TIMER, timerDone2);
    learnDoneMore.start ();

    var learnDoneMost:Timer = new Timer (9000);
    learnDoneMost.addEventListener (TimerEvent.TIMER, timerDone3);
    learnDoneMost.start ();


    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 7, true); This fades in the first object

    function timerDone1(e:TimerEvent):void {}
    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 1, 0, 7, true); This fainted the first object
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 0, 1, 7, true); This fades in the second object
    learnDone.stop ();
    }

    function timerDone2(e:TimerEvent):void {}
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 1, 0, 7, true); This disappears the second object
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 0, 1, 7, true); This fades in the subject of the third
    learnDoneMore.stop ();

    }

    function timerDone3(e:TimerEvent):void {}
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 1, 0, 7, true); This faints at the third object
    learnDoneMost.stop ();

    }

    function timerComplete(e:TimerEvent):void {}
    stopLearnDone3();
    nextFrame();
    }

    I don't know if timers are getting confused or simply the presentation because of the duration of the Tween.  Here is the code that I was describing, but I reduced the duration of the tweens so that they do not conflict with the schedule of the timers.

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    learn_mc.Alpha = 0;
    intentionally_mc.Alpha = 0;
    succeed_mc.Alpha = 0;

    var learnDone:Timer = new Timer (3000);
    learnDone.addEventListener (TimerEvent.TIMER, timerDone1);

    var learnDoneMore:Timer = new Timer (3000);
    learnDoneMore.addEventListener (TimerEvent.TIMER, timerDone2);

    var learnDoneMost:Timer = new Timer (3000);
    learnDoneMost.addEventListener (TimerEvent.TIMER, timerDone3);

    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the first object
    learnDone.start ();

    function timerDone1(e:TimerEvent):void {}
    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fainted the first object
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the second object
    learnDone.stop ();
    learnDoneMore.start ();
    }

    function timerDone2(e:TimerEvent):void {}
    var mySecondFade:Tween = new Tween (intentionally_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This disappears the second object
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the subject of the third
    learnDoneMore.stop ();
    learnDoneMost.start ();
    }

    function timerDone3(e:TimerEvent):void {}
    var myThirdFade:Tween = new Tween (succeed_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This faints at the third object
    var myFirstFade:Tween = new Tween (learn_mc, "alpha", Strong.easeOut, 0, 1, 3, true); This fades in the first object
    learnDoneMost.stop ();
    learnDone.start ();
    }

  • Several timers loop data acquisition

    Hi all

    I am developing a VI for FPGA Deployment. My equipment consists of a chassis/controller for cRIO-9072 with module 1-9211 thermocouple, card SD-1 module, 3-9215 HAVE modules and universal modules 2-9219. I will collect data of two thermocouples on the 9211, 14 channels on 9215 channels and 6 on 9219 modules. This system communicates to the host via ethernet.

    I have prepared a vi (see attachment), which used two DMA FIFO for writing data to data acquisition at a different speed. I will be sampling the s and 9211 9219 much more slow (500ms by samples), than other channels (40 ch/kech. / s). Currently, my FPGA vi trying only to taste two different modules. When I run the present on the host vi and try to read the data, I get only extracts of the data at different intervals. If either of her would reveal latency with the connection or the host vi failed to refresh quite quickly? I am relatively new to labview, so any help is appreciated. Thank you.

    Gaussy

    Hi Guassy,

    There are a few things that you need to change:

    (1) you must separate your acquisition in the FPGA in two separate loops if they have to operate at different speeds.  As it is, probably will run at the slower speed of the two parameters.

    (2) you must do the same in your VI in real time, or set up the DMA readings so that they will be read at the same pace.  For example, suppose that a single module acquires 1000 hz and the other at 200 hz.  If you want to read 100 samples from the first module (so your reading will occur at 1000 hz / 100 samples = 10 hz), you will need to read 20 samples from the slower module, so it is synchronized with the first module.

    (3) your timeouts are too short on your DMA readings.  Your slow acquisition is 500 us.  It will take 50 ms to read 100 samples requested, but the delay is set for 10 ms, so 4 times over 5 playback will return nothing.

    (4) you use graphics and no graphics.  A chart will only show the current data buffer that was written for her.  Refresh rate of the façade is nondeterministic, so that you can't see every update.  If you use a chart, the chart will record all data written on it to the indicated depth (default is 1024 elements).

    Also remember that you can have three FIFOs DMA between the host and the target FPGA, so use them wisely.  It is often easier to perform your purchases on the FPGA at the same pace and send them through the DMA FIFO even in VI in real-time.  If you need a few channels to connect at a lower rate, you can always throw the excess samples (there are some decimate wave screws that are perfect for this).

    I hope that helps!

  • error with several timers

    I basically have a compass and I want to have the pointer to stop every 15 ° for a certain period of time. The first timer works fine, but the rest pause longer. And they vary.

    It's code for the first break:

    Stop();

    var fl_TimerInstance_1: timer = new Timer(1000, 30);
    fl_TimerInstance_1.addEventListener (TimerEvent.TIMER, fl_TimerHandler_1);
    fl_TimerInstance_1.start ();

    var fl_SecondsElapsed_1: number = 1;

    function fl_TimerHandler_1(event: TimerEvent): void {}
    Play();
    fl_SecondsElapsed_1 ++;
    }

    For the second:

    Stop();

    var fl_TimerInstance_2: timer = new Timer(1000, 30);
    fl_TimerInstance_2.addEventListener (TimerEvent.TIMER, fl_TimerHandler_2);
    fl_TimerInstance_2.start ();

    var fl_SecondsElapsed_2: number = 1;

    function fl_TimerHandler_2(event: TimerEvent): void {}
    Play();
    fl_SecondsElapsed_2 ++;
    }

    With the help of Flash CC

    Thanks in advance

    AS3 has setTimeout, which can be much easier to use and less wrong. Try to put this script every 15 frames in your animation:

    Stop();

    setTimeout (play, 1000);

  • several timer + backup to the file

    Hi guys,.

    I'm new here and LabVIEW, and I'm trying to design a program with several timers. The user clicks on the first button to start the countdown, and when you click the second button, it stops the timer of the first, it records and start a second timer. And so now with the third and fourth buttons.

    I have a VI designed, but it doesn't really work, and I don't know why. Could someone suggest possible corrections? Thank you very much.


  • EventDispatcher and timers

    Hey. Additional post this week-do you need to get into the event dispatcher, so that timers work? I read that the queue to process may overflow if you do not. Simple illustration-

    main()

    Mytimer timer = new Timer();

    myTimer.Schedule (new ThisTimerTask(), 10000);

    myapp.requestBackground ();

    It worked on a handset of the torch, but not Curve 8520 (made in JDE 4.6). On the curve, the event log showed the processqueue overflow and the oldest event being dropped (it had several timers), who ceased the work of the app. Clearly, I need to learn how the event dispatcher, requestBackground etc., better work. When I added entereventdispatcher, it stopped working on the torch.

    If necessary, I can post the full thing with the code. What events, background apps and timers have pls? A kb article or link too...

    J.

    Inject the events in your application or in some integrated applications? Note that not all applications or the screens of the application supports injection of the event.

    Strategies the same COMPUTER are on the two BlackBerry Smartphones?  Have you looked at this article?

    Turn on the backlight and prevent the screen of the device turning off power or become locked BlackBerry

    http://supportforums.BlackBerry.com/T5/Java-development/enable-the-backlight-and-prevent-the-BlackBe...

  • Timers

    I want to know dedicated to timers in oracle forms. I use forms 6i. I will be great if I got some videos as material to understand.

    Are you aware that States/forms 6i was desupported for years?

    As mentioned, read the Forms Builder Help. It includes the syntax and in some cases, the sample code. For example, here is the text of the topic "Create timer":

    You can create a timer by using the built-in CREATE_TIMER routine.

    CREATE_TIMER (timer_name, milliseconds, an iteration).

    where:

    timer_name
    Specifies the name of the timer up to 30 alphanumeric characters. The name must begin with an alphabetic character. The data type of the name is of type CHAR.

    milliseconds
    Specifies the duration of the timer in milliseconds. The range of values allowed for this parameter is 1 to 2147483648 milliseconds. Values > 2147483648 will be rounded to 2147483648. Note that positive numbers only are allowed. The data type of the parameter is the NUMBER. For more information, see the limitations section below.

    iterate
    Specifies whether the timer should be repeated or not at the end. Takes one of the following constants as arguments:

    REPEAT indicates that the timer should be repeated at the end. By default.
    NO_REPEAT indicates that the timer does not resume at the end, but must be used only once, before calling explicitly again. >

    Open the help of generator. Click on the Index tab type the word: timers
    You should see entries such as:

  • on
  • creation
  • deletion of
  • control stripped
  • in response to several timers
  • usage rules
  • When-timer-expired

    Example of online help:

    -- The following example creates a timer called EMP_TIMER,
    -- and sets it to 60 seconds and an iterate value of NO_REPEAT: 
    
    DECLARE
        timer_id Timer;
        one_minute NUMBER(5) := 60000;
    BEGIN
        timer_id := CREATE_TIMER('emp_timer', one_minute, NO_REPEAT);
    END;
    

    You respond to the timer above which expire in a TIME-TIMER-EXPIRED

  • How to reference a global non-statique Timer var from a static context

    Hello. I need to have a single world clock for my application, which can be canceled and re-scheduled for a different date, to within a few static methods in the application.

    I confess that I do not understand how the static. I'm now declaring my Timer as static at the class level (so it could be accessed from static methods), but it does not seem to keeps its value and is null when it should have a value. To be exact, I set my Timer = new Timer() variable of in a method static and annex, then return to cancel it and reschedule, only to find the timer variable is null.

    What I want is to have a single global Timer, so some code runs when it gets to zero (I don't want to declare a local var Timer in my calendar and static methods because then I would have several timers). And I want to cancel the account countdown and the reporter at will. (There is an another Timer for another purpose, but I want just a thin Reset).

    I noticed that my level variable class static Timer (I thought that a timer could not be static) could be assigned to = new Timer() - it compiled correctly. My limited understanding is that static variables contain no instance, so I'm struggling with this. Reading, I think that in a static context, you cannot reference non static var because Java does not know which instance of the object you want.

    I found that if you want to access a non static var from a static context, you must first instantiate the class container and say classname.globalvar in the static context. Problem is when I tried that I found that I already had an instance of the application running, as I instantiated my UIApp in main() just before I entereventdispatcher - so an exception has been thrown. My application was created using JDE 4.6 and it's a UIApplication.

    How do you have a class-level Timer, referenced from a few static methods, cancelled and postponed? Or I go about it the wrong way? Never appreciated as ideas.

    Justin.

    @icefrost1.  We could discuss on this point, but since the Original Post, I think that the simplest solution is to use a Singleton.

    But in fact, we must be clear on what is actually the Singleton.  In this case, I have this code so that the Singleton contains a reference to a timer, i.e., it is not the timer itself.  The process may update the reference to the timer, so that any other treatment sees the update timer.  At least that's how I'd do.

  • Roll_Over/Out problem.

    Hello

    I have an animation image (10 images) that contains a box that leans to the right and to the left when you move with the mouse. This box contains a music video, with a few clickable images.

    My problem is that, somethimes if I quick move away and comes back on the box, the animation fails and plays more correctly, he will play only the first and the last image.

    So I used a timer to remove the EventListener when hovered over, but sometimes the animation still does not work.

    page_mc.thumbs_mc.addEventListener (MouseEvent.ROLL_OVER, over);
    function over(e:MouseEvent):void
    {
    page_mc.gotoAndPlay ("Right");
    page_mc.thumbs_mc. Enabled = false;
    page_mc.thumbs_mc. RemoveEventListener (MouseEvent.ROLL_OVER, over);

    enable: var = new Timer timer (1300,1);
    enable.addEventListener (TimerEvent.TIMER, enableOver);
    Enable.Start ();

    }
    function enableOver(e:TimerEvent):void {}
    page_mc.thumbs_mc.addEventListener (MouseEvent.ROLL_OVER, over);

    }

    page_mc.thumbs_mc.addEventListener (MouseEvent.ROLL_OUT, out);
    function out(e:MouseEvent):void
    {
    page_mc.gotoAndPlay ("left");
    page_mc.thumbs_mc. Enabled = false;
    page_mc.thumbs_mc. RemoveEventListener (MouseEvent.ROLL_OUT, out);

    var enable2:Timer = new Timer (1300,1);
    ENABLE2.addEventListener (TimerEvent.TIMER, enableOut);
    ENABLE2. Start();
    }
    function enableOut(e:TimerEvent):void {}
    page_mc.thumbs_mc.addEventListener (MouseEvent.ROLL_OUT, out);

    }

    Could someone help me please?

    One thing you don't want to do, is create new timers as you do:

    enable: var = new Timer timer (1300,1);

    Each time above or on the slopes, you create a _new_ timer - you do not replace activate... So, you will have several timers enable and enable2, not the one you think you have.

    So, move the timers and adding the listerners on functions and just to make the start of the function.

  • Synchronize several USRP using Octoclock

    Hello community!

    I'm trying to synchronize several Ettus USRP N210 using Octoclock. I send you a short tag to a USRP to each set second (using the timestamp on board), the other USRP choices until the tag and display the time. I put the clock at PpsIn two USRP source by using the node properties of niusrp, but it seems the two USRP to use even their internal clock: I see a fraction of a second relatively fixed the RX once it picks up a lighthouse and this fraction of a second does not change if I put the clock to internal or ppsin source. I don't know if this is the correct way of sync USRP external reference because I'm quite new to Labview Comms, anyone have any ideas? Thank you very much!

    Hello Maxcy,

    Welcome to the community!

    I highly recommend looking through aid NOR-USRP > Programming Reference > document MIMO synchronization. This will help you understand the synchronization.

    Synchronization requires two components, a shared time base and trigger to start. In this case to share the time base, you use synchronization and synchronization of the USRP properties reference to set the frequency to RefIn reference and the Source of the time base to be PPSIn. You will need to wire the system as Figure 9 in the following Document Ettus:
    http://www.ettus.com/content/files/KB/mimo_and_sync_with_usrp_updated.PDF

    In order to share the relaxation from the beginning, we want to use the time to start to set up to be in 1 second increments. More important, you want to reset timers USRP onboard all USRPs at the same time. This is done using the Set Time VI and ensure that the change is applied to the next edge PPS (together the entry timestamp apply 1). This will require the TX and RX both be started and configured in the same second on the other. For testing purposes, I have recommended to configure the RX and TX within the same VI. This will benefit of innate parallelism of LabVIEW and ensure that both are started at the same time.

    With synchronization, above all there will be a random amount of phase constant offset between the channels, as shown in figure 6 of:
    http://www.ettus.com/content/files/KB/mimo_and_sync_with_usrp_updated.PDF
    This could be responsible for your consistent fractional offset. These needs to be processed signal to ensure alignment.

    I hope this helps.

    Kind regards

  • timers stopped when removable Panel

    I am relatively new to LabWindows, and up to now, this has not been a problem, but now I write several critical applications of the time, it is. Simply, I need to find a way to put around the problem stop Timers reminders while manipulating panels - moving etc. My thoughts were if I could ecapsulate reminders of the timer in their own thread, this could solve that problem, but not sure if it of the simplest solution or how really has to implement.

    If I take the example of a simple stopwatch. I would not be concerned if the stopwatch mistletoe continues to update, if the Panel is currently handling - it's just that when it is released, the timer records the exact time and didn't tick right on the point where it has been frozen.

    Simple examples you want to go me to get an idea of how gave around this problem greatly received

    Concerning

    Gavin

    It's big... Thank you. I was looking at this as an option. I'll have a play around and see if I can make it work. Thanks for the advice btw... I don't think theres anything I do that is likely to create problems that are likely to create problems of access of file or potential blockages, but I'll keep them in mind.

    Keep you informed on the progress and could be back for more tips.

    Concerning

    Gavin

  • The user defined timers to introduce e-mails in request workflows

    Hello.

    Everyone you have suggestions for how to generate reminder (task e-mail) e-mail messages according to the requirements of time user?


    This is the scenario; We have a process complete planned work involving several parties.

    According to the planned work client process final approval/rejection may or may not be needed and the time required depends on the demand for scheduled jobs.

    I have not found a way how to get the e-mail tasks or delay the enabled tasks based on scheduled start/end time, time limits or custom date/time fields.  And because it is dynamic information, using OLA, ALS seems to manage the necessary need for flexibility either.

    A method that works somewhat but is very weak in that it can be easily missed, is having a special branch out to a separate task of late leading to a task send.
    He however didn't prompt/force users to visit the task late and is therefore easily missed.  To HRT I work then need to add another task before the delay task to ask the user to change the delay still active task.  Very awkward in my opinion.  Especially since this workflow will be 2-3 these timers.

    Can anyone think of a better solution for this (ideally, not involving development that our management is strongly against these.)

    Thank you

    PS, we're always on 9.1.2 (if 9.1.8 seems stable we could upgrade his in the near future)

    Hello

    FP7 delay task having been slightly improved. More options for delay have been added in order to use any field time of application as the basis for delay task. I can guess that could be useful in your case.

    And Yes, if you decide updated the system, then I strongly suggest stright goes forward to v.9.1.8. Although it has some problems, but not so big in FP7.

    If you want to always (will be) for sticking with the current version, try other options as well:

    * Change the delay task parameters (according to request field?) by using a Custom Action (stored Proc or a query) within a task of conditional branching:

    * Use the SQL to update the settings of task as requered. This can be difficult and might not work properly due to cached data.

    * Use custom voting service to manage the tasks/notification of the delay in your workflow. This solution requires programming skills, but you will have much more freedom for the things you can do.

    And sorry if I don't have your question just because it seems a bit complicated (at least for me).

  • "Actionscript file cannot have several external visible definitions:

    Armageddon_ReHash\StateMachine.as, line 15006: an ActionScript file cannot have several definitions visible from the outside: StateMachine, detectHitLevel2

    Hey thanks for checking this, I'm having an odd error that maybe just started, can you give me some comments about why this happens, here's my class and the error I get is above. Please get to me as soon as I need to know tonight.

    Thanks again!

    CODE:

    package {}

    import flash.display.MovieClip;

    import flash.events. *;

    import flash.utils.Timer;

    import flash.display.Stage;

    import flash.sampler.NewObjectSample;

    SerializableAttribute public class StateMachine extends MovieClip {}

    public static var player: Player;

    private var scoreHUD:HUD;

    public var enemyGhostTimer:Timer;

    public var enemyGhost2Timer:Timer;

    public var enemyGhost3Timer:Timer;

    public var levelTimer:Timer;

    health public var = 3;

    public var score = 0;

    public var timeleft = 80;

    Main menu

    public void StateMachine()

    {

    START menu

    var controls: Boolean = false;

    var credits: Boolean = false;

    var advice: Boolean = false;

    Event listeners

    btn_start.addEventListener (MouseEvent.MOUSE_DOWN, start_mouseDownHandler);

    btn_controls.addEventListener (MouseEvent.MOUSE_DOWN, controls_mouseDownHandler);

    btn_credits.addEventListener (MouseEvent.MOUSE_DOWN, credits_mouseDownHandler);

    btn_highscores.addEventListener (MouseEvent.MOUSE_DOWN, highscores_mouseDownHandler);

    Stop();

    Menu system

    function start_mouseDownHandler(event:MouseEvent):void

    {

    sym_pointer.y = 315;

    Stop (1, "Level 1");

    Level1();

    }

    function controls_mouseDownHandler(event:MouseEvent):void

    {

    orders = true;

    gotoAndStop ("controls");

    sym_pointer.y = 368;

    }

    function credits_mouseDownHandler(event:MouseEvent):void

    {

    credits = true;

    gotoAndStop ("credits");

    sym_pointer.y = 421;

    }

    function highscores_mouseDownHandler(event:MouseEvent):void

    {

    Tips = true;

    gotoAndStop ("hints");

    sym_pointer.y = 474;

    }

    }

    End of the game

    public void Gameover()

    {

    Stop();

    btn_restart.addEventListener (MouseEvent.MOUSE_DOWN, restart_mouseDownHandler);

    function restart_mouseDownHandler(event:MouseEvent):void

    {

    Stop (1, "Level 1");

    Level1();

    }

    }

    Timers

    function sendEnemy(e:Event)

    {

    enemy of the var = new Ghost();

    stage.addChild (enemy);

    }

    function sendEnemy2(e:Event)

    {

    var enemy2 = new Ghost2();

    stage.addChild (enemy2);

    }

    function sendEnemy3(e:Event)

    {

    var enemy3 = new Ghost3();

    stage.addChild (enemy3);

    }

    function countDown(e:Event)

    {

    If (timeleft > 0)

    {

    timeLeft-;

    }

    ElseIf (timeleft = 0)

    {

    Disable()

    GameOver();

    }

    }

    //////////////////////////////////////LEVELS////////////////////////////////////////////// ////////

    function Level1 (): void

    {

    reader = new player (internship, 400, 550);

    health = 3;

    stage.addChild (player);

    scoreHUD = new HUD (internship);

    stage.addChild (scoreHUD);

    enemyGhostTimer = new Timer (500);

    enemyGhostTimer.addEventListener ("timerEnemy", sendEnemy);

    enemyGhostTimer.start ();

    levelTimer = new Timer (1000);

    levelTimer.addEventListener ("timerLevel", count);

    levelTimer.start ();

    stage.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);

    stage.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler, false, 0, true);

    stage.addEventListener (Event.ENTER_FRAME, detectHitLevel1);

    }

    function Level2 (): void

    {

    reader = new player (internship, 400, 550);

    stage.addChild (player);

    enemyGhost2Timer = new Timer (2000);

    enemyGhost2Timer.addEventListener ("timerEnemy2", sendEnemy2);

    enemyGhost2Timer.start ();

    stage.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);

    stage.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler, false, 0, true);

    stage.addEventListener (Event.ENTER_FRAME, detectHitLevel2);

    }

    function Level3 (): void

    {

    reader = new player (stage, 25, 550);

    stage.addChild (player);

    enemyGhost3Timer = new Timer (5000);

    enemyGhost3Timer.addEventListener ("timerEnemy3", sendEnemy3);

    enemyGhost3Timer.start ();

    stage.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);

    stage.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler, false, 0, true);

    stage.addEventListener (Event.ENTER_FRAME, detectHitLevel3);

    }

    function detectHitLevel1(e:Event):void

    {

    Limits

    If (Player.hitTestObject (boundsright))

    {

    trace ("Bounds");

    Player.x = player.x-10;

    }

    If (Player.hitTestObject (boundsleft))

    {

    trace ("Bounds");

    Player.x = player.x + 10;

    }

    If (Player.hitTestObject (boundstop))

    {

    trace ("Bounds");

    Player.y = player.y + 10;

    }

    If (Player.hitTestObject (boundsbottom))

    {

    trace ("Bounds");

    Player.y = player.y-10;

    }

    Traps

    If (Player.hitTestObject (Lava1) | player.hitTestObject (Lava2) | player.hitTestObject (Lava3) | player.hitTestObject (Lava4) | player.hitTestObject (Lava5): player.hitTestObject (Lava6): player.hitTestObject (Lava7))

    {

    trace ("Lava");

    If (health < 0)

    {

    stage.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    stage.removeEventListener (Event.ENTER_FRAME, detectHitLevel1);

    stage.removeChild (player);

    for (var i in Ghost.list)

    {

    Ghost.list [i]. Kill();

    }

    Stop (1, "GameOver");

    Gameover();

    }

    -health;

    scoreHUD.updateLives(-1);

    Player.x = 400;

    Player.y = 550;

    }

    Output

    If (Player.hitTestObject (lvl1exit))

    {

    lvl1exit.x = - 10;

    trace ("Exitlvl1");

    score += 10;

    health ++;

    scoreHUD.updateLives (1);

    stage.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    stage.removeEventListener (Event.ENTER_FRAME, detectHitLevel1);

    stage.removeChild (player);

    for (var i in Ghost.list)

    {

    Ghost.list [i]. Kill();

    }

    }

    Stop (1, "Level 2");

    Level2();

    }

    Points

    If (player.hitTestObject (civa))

    {

    CIVA.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    If (player.hitTestObject (civb))

    {

    CIVB.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    If (player.hitTestObject (vicc))

    {

    CIVC.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    }

    function detectHitLevel2(e:Event):void

    {

    Limits

    If (Player.hitTestObject (boundsright))

    {

    trace ("Bounds");

    Player.x = player.x-10;

    }

    If (Player.hitTestObject (boundsleft))

    {

    trace ("Bounds");

    Player.x = player.x + 10;

    }

    If (Player.hitTestObject (boundstop))

    {

    trace ("Bounds");

    Player.y = player.y + 10;

    }

    If (Player.hitTestObject (boundsbottom))

    {

    trace ("Bounds");

    Player.y = player.y-10;

    }

    Traps

    If (Player.hitTestObject (Lava1) | player.hitTestObject (Lava2) | player.hitTestObject (Lava3) | player.hitTestObject (Lava4) | player.hitTestObject (Lava5): player.hitTestObject (Lava6): player.hitTestObject (Lava7))

    {

    trace ("Lava");

    If (health > 0)

    {

    stage.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    stage.removeEventListener (Event.ENTER_FRAME, detectHitLevel2);

    stage.removeChild (player);

    Stop (1, "GameOver");

    Gameover();

    }

    -health;

    scoreHUD.updateLives(-1);

    Player.x = 400;

    Player.y = 550;

    }

    Output

    If (Player.hitTestObject (lvl2exit))

    {

    lvl2exit.x = - 10;

    trace ("Exitlvl2");

    score += 10;

    health ++;

    scoreHUD.updateLives (1);

    stage.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    stage.removeEventListener (Event.ENTER_FRAME, detectHitLevel2);

    stage.removeChild (player);

    Stop (1, "Niveau3");

    Level3();

    }

    Points

    If (player.hitTestObject (civa))

    {

    CIVA.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    If (player.hitTestObject (civb))

    {

    CIVB.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    If (player.hitTestObject (vicc))

    {

    CIVC.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    }

    function detectHitLevel3(e:Event):void

    {

    Limits

    If (Player.hitTestObject (boundsright))

    {

    trace ("Bounds");

    Player.x = player.x-10;

    }

    If (Player.hitTestObject (boundsleft))

    {

    trace ("Bounds");

    Player.x = player.x + 10;

    }

    If (Player.hitTestObject (boundstop))

    {

    trace ("Bounds");

    Player.y = player.y + 10;

    }

    If (Player.hitTestObject (boundsbottom))

    {

    trace ("Bounds");

    Player.y = player.y-10;

    }

    Traps

    If (Player.hitTestObject (Lava1) | player.hitTestObject (Lava2) | player.hitTestObject (Lava3) | player.hitTestObject (Lava4) | player.hitTestObject (Lava5): player.hitTestObject (Lava6): player.hitTestObject (Lava7))

    {

    trace ("Lava");

    If (health > 0)

    {

    stage.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    stage.removeEventListener (Event.ENTER_FRAME, detectHitLevel3);

    stage.removeEventListener (Event.ENTER_FRAME, loop);

    stage.removeChild (player);

    Stop (1, "GameOver");

    Gameover();

    }

    -health;

    scoreHUD.updateLives(-1);

    Player.x = 400;

    Player.y = 550;

    }

    Output

    If (Player.hitTestObject (lvl3exit))

    {

    lvl2exit.x = - 10;

    trace ("Exitlvl3");

    score += 10;

    health ++;

    scoreHUD.updateLives (1);

    stage.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    stage.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    stage.removeEventListener (Event.ENTER_FRAME, detectHitLevel2);

    stage.removeEventListener (Event.ENTER_FRAME, loop);

    stage.removeChild (player);

    Stop (1, "GameOver");

    Gameover();

    }

    Points

    If (player.hitTestObject (civa))

    {

    CIVA.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    If (player.hitTestObject (civb))

    {

    CIVB.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    If (player.hitTestObject (vicc))

    {

    CIVC.x = - 10;

    trace ("bonus!");

    score + 5;

    scoreHUD.updateScore (5);

    }

    }

    }

    I believe that the error is indicating that your class file structure is not formatted properly as it seems to be trying to define several classes in one file.  I suspect it's going to be because of incorrect provision of braces.  Unfortunately, the pileup of the code is a bit much to go through you.

    I noticed that you have many nested named functions (functions within other functions) which causes problems as well.  All functions should stand on their own.

    Maybe you need to really do is to find a way to break this class file into separate files based on the feature class.

  • How can I change several download Sierra systems

    How can I change several download Sierra systems?  I have a Mac mini end of 2012 running El Capitan, over a mid-2010 Mac mini and MacBook Pro mid-2010 the two race Yosemite with limit of bandwidth on my internet connection and want to update all three systems in one download.  Is the process that apply with Yosemite and El Capitan (ie. Copy the Setup program to another location before you run it on the download system) still the way forward?  Thank you.

    You can do this or DiskMaker X allows to create a key to install it.

    (145170)

Maybe you are looking for