TIMER PROBLEM! Help, please! AS3

I have this drag and drop shape game... I have this again "try" button Reset the timer, the score and the location of movable forms and «start' button that starts the timer and like «10,9,8,7...» until she paid 0 and "try again" and "next" button will appear... my main problem is, whenever I have click the "try" button again, and then click 'Start'... my timer increment decrement State... first he "10,9,8,7.." then when I click on try again and click Start Timer will '10,8,6,4... '. then when I click on try again and again it goes "10,7,4.." would you help me on this... I want this decrement, only 1 number at the same time I have click on try twice the key... Thanks in advance

Stop();

import flash.events.KeyboardEvent;

import flash.utils.Timer;

import flash.events.MouseEvent;

var countDownIncShapes:Number = 1;

var totalSecsShapes = 10;

var countDownSecsShapes = totalSecsShapes;

var score_Shapes:int = 0;

next14. Visible = false;

tryAgain14.visible = false;

var timeShapes:Timer = new Timer(countDownIncShapes*1000);

var dragArrayShapes:Array = [square14, triangle14, circle14, rectangle14];

var matchArrayShapes:Array = [tv, pyramid, ball, envelope];

var posArrayShapes:Array = [{x: 1113.7, y: 205.90}, {x: 812, y: 205.90}, {x: 207.55, y: 205.90}, {x: 506.25, y: 205.90}];

var currentClipShapes:MovieClip;

var Shapes_startX:Number;

var Shapes_startY:Number;

Start_Shapes.addEventListener (MouseEvent.CLICK, startShapesdrag);

function startShapesdrag(e:MouseEvent):void

{

timeShapes.start ();

timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

function tickShapes (e:TimerEvent): void

{

If (counterShapes.text is "0")

{

timeShapes.stop ();

countDownSecsShapes = totalSecsShapes;

circle14.buttonMode = false;

square14.buttonMode = false;

triangle14.buttonMode = false;

rectangle14.buttonMode = false;

circle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

square14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

triangle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

rectangle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

If (scoreShapes.text > = "300")

{

next14. Visible = true;

tryAgain14.visible = true;

tryAgain14.addEventListener (MouseEvent.MOUSE_DOWN, tryAgain14_onMouseDown);

next14.addEventListener (MouseEvent.MOUSE_DOWN, next14_onMouseDown);

}

If (scoreShapes.text < "300")

{

tryAgain14.visible = true;

tryAgain14.addEventListener (MouseEvent.MOUSE_DOWN, tryAgain14_onMouseDown);

}

}

on the other

{

countDownSecsShapes = countDownSecsShapes - 1;

counterShapes.text = countDownSecsShapes;

circle14.buttonMode = true;

square14.buttonMode = true;

triangle14.buttonMode = true;

rectangle14.buttonMode = true;

trylang.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

circle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

square14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

triangle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

rectangle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

}

}

}

function shapesItem_onMouseDown(event:MouseEvent):void

{

currentClipShapes = MovieClip (event.currentTarget);

Shapes_startX = currentClipShapes.x;

Shapes_startY = currentClipShapes.y;

addChild (currentClipShapes);

currentClipShapes.startDrag ();

stage.addEventListener (MouseEvent.MOUSE_UP, shapesStage_onMouseUp);

}

function shapesStage_onMouseUp(event:MouseEvent):void

{

stage.removeEventListener (MouseEvent.MOUSE_UP, shapesStage_onMouseUp);

currentClipShapes.stopDrag ();

var indexShapes:int = dragArrayShapes.indexOf (currentClipShapes);

var matchClipShapes:MovieClip = MovieClip (matchArrayShapes [indexShapes]);

If (matchClipShapes.hitTestPoint (currentClipShapes.x, currentClipShapes.y, true))

{

currentClipShapes.x = posArrayShapes [indexShapes] .x;

currentClipShapes.y = posArrayShapes [indexShapes] there;

currentClipShapes.removeEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

currentClipShapes.buttonMode = false;

score_Shapes is score_Shapes = 100;.

scoreShapes.text = score_Shapes.toString ();

}

on the other

{

currentClipShapes.x = Shapes_startX;

currentClipShapes.y = Shapes_startY;

}

}

function next14_onMouseDown(e:MouseEvent):void

{

gotoAndPlay (15);

}

function tryAgain14_onMouseDown(e:MouseEvent):void

{

square14.x = 1110.15;

square14.y = 533.75;

circle14.x = 227,05;

circle14.y = 541,3;

triangle14.x = 818.85;

triangle14.y = 537;

rectangle14.x = 506.30.

rectangle14.y = 529.85;

score_Shapes = 0;

scoreShapes.text = "";

counterShapes.text = countDownSecsShapes;

tryAgain14.visible = false;

next14. Visible = false;

timeShapes.reset ();

Start_Shapes.addEventListener (MouseEvent.CLICK, startShapesdrag);

}

If you are out of the frame that contains the button of your Start_Shapes you will need to add this listener each time you come back on the frame with _Start_Shapes.

Thus, it may be your timer listener that is causing the problem.  and when I checked I see a known problem: you're nesting functions named.  never do this:

function startShapesdrag(e:MouseEvent):void

{

timeShapes.start ();

timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

function tickShapes (e:TimerEvent): void

{

.

.

.

}

}

should be

function startShapesdrag(e:MouseEvent):void

{

{if (! timeShapes.hasEventListener (TimerEvent.Timer))}

timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

}

timeShapes.start ();

}

function tickShapes (e:TimerEvent): void

{

.

.

.

}

Tags: Adobe Animate

Similar Questions

  • The payment change ADOBE info Web page fails - I can't scroll down to save the changes. My subscription is expired and I am dead in the water! I can't find a support customer portal to this problem - HELP PLEASE!

    I can't scroll down to save the changes. My subscription is expired and I am dead in the water! I can't find a support customer portal to this problem - HELP PLEASE!

    catsrock

    Great salvation,

    We are sorry for the inconvenience caused to you!

    I recommend you contact customer service regarding this issue.

    Kind regards

    Rahul

  • Import and copy from one catalog to another has some problems-help please

    Hi people,

    I have two catologs on two different disks. I imported a number of raw images from one to another using the copy. He did also copy xmp files, but most of the images do not appear to have been developed. I did something wrong? Is this a new stage so these images acknowledge the work accomplished since the xmp file?

    Second, the virtual copies have been copied not more as well. They are in the first catalog, but not when I imported and copied.

    Help please while I can still understand what images I imported because they are in every sense, and maybe I need to recreate my steps.

    Lightroom 3 more up-to-date, Windows XP.

    Thank you.

    ~ Bob

    Bob,

    You import or catalog? You need to do the latter.

    If you are importing a catalog, remove the images that you have brought to and use the above menu option.

    HAL

  • Volume AS3 problem - help please

    I have two audio players in the same framework in my file with the following code:

    PLAY/PAUSE BUTTON

    BOTAOPLAY.addEventListener (MouseEvent.CLICK, ALEXANDER);

    var SOMCANAL:SoundChannel; var PLAY: Boolean = true;

    function BOTAO(evt:MouseEvent):void {if (PLAY) {}

    var s:Sound = new Sound (new URLRequest("oceano.mp3")); LAND AUDIO

    SOMCANAL = s.play (0.9999) ;} else {SOMCANAL.stop ;}) PLAY =! PLAY;

    }

    OBS:

    SOMCANAL = s.play loop (0.9999) audio, repeat audio o 9999 vezes

    VOLUME SLIDER

    Import fl.events.SliderEvent; import flash.media.SoundTransform;

    var VOLUMETRANSFORM: SoundTransform = new SoundTransform (1);

    SLIDER.addEventListener (SliderEvent.THUMB_DRAG, VOLUME);

    function VOLUME(event: SliderEvent): void {}

    VOLUMETRANSFORM.volume = SLIDER.value; SoundMixer.soundTransform = VOLUMETRANSFORM;

    }

    ///

    PLAY/PAUSE BUTTON

    BOTAOPLAY1.addEventListener (MouseEvent.CLICK, BOTAO1);

    var SOMCANAL1:SoundChannel; var PLAY1:Boolean = true;

    function BOTAO1(evt:MouseEvent):void {if (PLAY1) {}

    var s:Sound = new Sound (new URLRequest("passaros.mp3")); LAND AUDIO

    SOMCANAL1 = s.play (0.9999) ;} else {SOMCANAL1.stop ;}) ACTUELLE1 =! ACTUELLE1;

    }

    VOLUME SLIDER

    Import fl.events.SliderEvent; import flash.media.SoundTransform;

    var VOLUMETRANSFORM1: SoundTransform = new SoundTransform();

    SLIDER1.addEventListener (SliderEvent.THUMB_DRAG, VOLUME1);

    function VOLUME1(event: SliderEvent): void {}

    VOLUMETRANSFORM1.volume = SLIDER1.value; SoundMixer.soundTransform = VOLUMETRANSFORM1;

    }

    My idea is that, when users click on the player 1 and player 2 affect the two videos simultaneously. However when the volume increases or in one of the audio players below is applied to both players.

    I wish that each volume was independent of each other is to do this?

    Hi JhonathanZamarch!

    Delete "SoundMixer.soundTransform = VOLUMETRANSFORM;" and "SoundMixer.soundTransform = VOLUMETRANSFORM1;' from your code.

    Use SoundChannel.soundTransform = new SoundTransform (volume);

    New code:

    PLAY/PAUSE BUTTON

    BOTAOPLAY.addEventListener (MouseEvent.CLICK, ALEXANDER);

    var SOMCANAL:SoundChannel;

    var PLAY: Boolean = true;

    function BOTAO(evt:MouseEvent):void {}

    If {(GAME)

    var s:Sound = new Sound (new URLRequest("oceano.mp3")); LAND AUDIO

    SOMCANAL s.play = (0,9999);

    } else {}

    SOMCANAL.stop ();

    }

    PLAY =! PLAY;

    }

    OBS:

    SOMCANAL = s.play loop (0.9999) audio, repeat audio o 9999 vezes

    VOLUME SLIDER

    Import fl.events.SliderEvent;

    import flash.media.SoundTransform;

    var VOLUMETRANSFORM:SoundTransform = new SoundTransform (1);

    SLIDER.addEventListener (SliderEvent.THUMB_DRAG, VOLUME);

    function VOLUME(event: SliderEvent): void {}

    SOMCANAL.soundTransform = new SoundTransform (SLIDER.value);

    VOLUMETRANSFORM.volume = SLIDER.value;

    SoundMixer.soundTransform = VOLUMETRANSFORM;

    }

    ///

    PLAY/PAUSE BUTTON

    BOTAOPLAY1.addEventListener (MouseEvent.CLICK, BOTAO1);

    var SOMCANAL1:SoundChannel;

    var PLAY1:Boolean = true;

    function BOTAO1(evt:MouseEvent):void {}

    If (actuelle1) {}

    var s:Sound = new Sound (new URLRequest("passaros.mp3")); LAND AUDIO

    SOMCANAL1 s.play = (0,9999);

    } else {}

    SOMCANAL1. Stop();

    }

    ACTUELLE1 =! ACTUELLE1;

    }

    VOLUME SLIDER

    Import fl.events.SliderEvent;

    import flash.media.SoundTransform;

    var VOLUMETRANSFORM1:SoundTransform = new SoundTransform();

    SLIDER1.addEventListener (SliderEvent.THUMB_DRAG, VOLUME1);

    function VOLUME1(event: SliderEvent): void {}

    SOMCANAL1. SoundTransform = new SoundTransform (SLIDER1.value);

    VOLUMETRANSFORM1.volume = SLIDER1.value;

    SoundMixer.soundTransform = VOLUMETRANSFORM1;

    }

    I hope this helps!

  • Cannot delete permission. "Failed to clear approval. Please try after some time. "Help, please!

    I'm having some problems with Digital Editions and I tried the options for discussion several times, but nobody seems to be able to help me. I can't express how disappointed I am with Adobe. I have an ebook that I paid a lot of money for and I need to go to work, but when I try to download the e-book I get the E_ACT_NOT_READY error message. Forums that I need deauthorise my account, but when I try to erase approval I get the message "cannot delete permission. Please try after some time. "This happened for weeks. For 2 weeks I tried to solve this problem. Can someone please help me or give me a phone number to dial for joining adobe? I am desperate at this point.

    If for some reason you cannot withdraw the authorization of ADE, follow the steps below:

    Mac:

    1. go-> go to folder.

    Go to the folder dialog box will appear.

    2. Enter ~/Library/Application Support/Adobe/Digital Editions

    Drag the activation.dat file to the trash.

    ADE will be cancelled now.

    Now allow ADE new.

    ADE will be cancelled now.

    Now allow ADE new.

    Windows:

    Click Start > run.

    Open, type regedit in the text box and press ENTER. The Registry Editor opens.

    In the left pane of the registry editor, find the following registry key:

    HKEY_CURRENT_USER\Software\Adobe\Adept

    Right click on the key to the follower, and then choose Remove.

    In the dialog box confirm the key deletion, click OK.

    Your permission is removed.

    ADE will be cancelled now.

    Now allow ADE new.

  • I clicked on "entire page" and I hate it and now I don't know how to get back to where I can see all the tabs all the time. Help, please!

    I think that the question is quite clear: I don't know what additional details would be useful. Questions?

    The F11 key activates / turns off Mode full screen or not.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You may need to update some plug-ins. Check your plug-ins and update if necessary:

  • IPMMB-FM motherboard: computer beeps 6 long time need help please

    HII gave a computer with a card hp envy mother IPMMB-FM. When I turn it on it give me a white screen six long beeps and remains lit. The power LED light flashes in orange with every beep. I'm not trying to add a video card to this topic. I use the o/b video. I had to get an adapter for IVF/VGA. I tried out the battery put in. I unplugged everything and then took out the battery and put it back. But I still get the same six beeps a certain box please help me. Thank you.

    Hello

    You'll probably have to replace the motherboard.

    A technician will need to determine which component has failed.

    A failure of an integrated component requires a new motherboard.

    Jay

  • Playlist problems HELP Please!

    Hello! First post here and unfortunately, its about some problems.

    I'm having problems with plalists and don't know how to fix. Okay, I create the playlist in Nero M3U format, encode files

    off a CD to MP3 and then using Wexplore, copy them into the Clip. The playlist is in the Playlist folder and MP3s

    in the folder of songs. OK, it sorta well worked during the first three playlists.  Herer are now the problems:

    1. when I try to play a playlist in the playlist folder, it shows the playlist in a vacuum. The playlist appears however

    in the Albums folder and the first three have played fine from there.

    2. ok, the fourth one that I've added shows in the unknown album for a title folder. He plays very well however songs.

    He appears in the playlist as unknown and 'empty' folder when I try to play from there.

    3. the fifth one I added does not appear in the Albums folder at all (the only place I can play any of the playlists).

    It appears in the playlist folder, but appears as empty when I try to play.

    I used the exact same design and copy for each method and of course make me different results. All the songs

    I copied to see the place of songs and play very well. The playlist feature is not very reliable at this point.

    If anyone has experienced this problem and have a solution, please let me know. I enjoy my video, when it acts right.

    I just properly finish loading all my music and playlists so I can listen to my favorite things when I practice my golf

    Swing on the driving range.

    Thank you people!

    Did last night and got the problem solved using WMP. Thanks for your expert advice :-)!

  • Have lost the coloum on the left was next to the windows mail inbox cannot solve this problem help please

    Have lost the information column on the left side of my page of the Inbox, please help

    SE repair Vista and recovery Forum.

    On the view menu at the top, choose "layout... '. "and make sure that the list of"files"is checked, then the left side displays.

  • System volume information stolen hard drive. VERY slow computer and windows show only (not answer) for 2 to 10 seconds at a time. Help, please.

    After starting my computer to Windows 7 Enterprise, I noticed that it runs very slowly.  for example, the scrolling of a window of firefox crashes every 10 seconds or more.  The gel lasts between 2 and 10 seconds with the little blue wheel, spinning, (not answer) in the toolbar.

    I pulled the top of resource monitor and to see that 4 PID - C:\System Volume Information\ {guid} {guid} is running non-stop with about 720ko read by writing dry and 6 MB per second Disk 0 length of the queue is pegged at 5.  from time to time (once every 10 to 15 minutes), the queue goes to 0 and the computer starts acting normally (i.e. fast) again.  But once the length of the queue points to 5, the problems continue.

    I am running in raid 5.

    I noticed that vssvc.exe is running (PID 4144) with a reference to c:\System Volume Information and the same GUID as PID 4 - system and kernel.

    Any idea what I can do to get back on my computer?  At this point, it is absolutely unusable.

    Thank you

    Marshall

    For any question on Windows 7:

    http://social.answers.Microsoft.com/forums/en-us/category/Windows7

    Link above is Windows 7 Forum for questions on Windows 7.

    Windows 7 questions should be directed to the it.

    You are in the Vista Forums.

    See you soon.

    Mick Murphy - Microsoft partner

  • No audio output is installed in Toshiba Portege M600, for several times! Help, please...

    HII,

    I have the Toshiba Portege M600 with Vista Home Premium 32-bit SP.1. It is about 3 years old now. This for 3 months, I experience "no audio output device is installed" repeatedly. The first three times that I feel it, it's solve by doing:
    -Run-> service.msc-> restart audio windows (first occurrence; problem solved with this method)
    --> Device Manager disable and then enable the controller HD audio (second instance; problem solved with this method)
    (- Installed realtek third occurrence; problem solved and last for a month)
    Yesterday again I have another occurrence of this problem. And this time, none of the foregoing strives to solve the problem. Now, I'm a bit desperate. Is he someone ever lived the same thing? I will very grateful if you are willing to share or have any suggestions on what I should do...
    Thank you in advance!

    RIA

    Hi Ria,

    You can try to install Windows Vista SP2 and check. Vista SP2 will strengthen the stability and performance of the system.

    You can consult the following articles and check.

    Learn how to install Windows Vista Service Pack 2 (SP2)

    How to obtain the latest Windows Vista service pack

    Hope this information is useful.

  • Internet connection problem help please

    When I try to connect to the Internet it will not and when I click to troubleshoot the convenience store does not open. Also through cmd, I used fig icon and everything saying media disconnected

    You have McAfee?  The problem is only recently emerged?  McAfee has been updated at the same time as the last batch of updates from Windows 7 and it seems to be the cause of this problem for most, if not all, users.

    See the communication from this "criticism" - McAfee

    Some customers may experience a loss of network connectivity and/or errors in McAfee Security Center after a recent update

    You should make the fix McAfee, if necessary.  There are corresponding communications for their enterprise products.

    I got McAfee, but the connection has started working again on its own so I thought I was clear of problems. However, when I checked it says he was doing routine checks the updates in vain when I told it to do a manually. So stick with McAfee you don't follow their procedure of fix would have upgraded my PC at risk by not updated and, as other listings of McAfee said since then, the application did not refer to his database of threats correctly. Actually, I removed and then installed Microsoft Security Essentials rather & my answer IE is faster I knew it [even though I had the Add-ons McAfee disabled for centuries].

    I had to run the removal of McAfee Development tool a few times before and it caused a problem with the license if the PC was not connected to the internet during the abduction. Due cat of McAfee support reset their files in order to allow the relocation-reactivation. Here is their link cat - McAfee - media contains the link to the cat

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

    If you do not have McAfee then Windows update than kb2705219 can also be a cause as the uninstall that appeared to solve the problem for some users [but I'm not particularly convinced by this]. To uninstall an update - control panel, programs & features, [left side of the window] see installed updates. Wait until the system has finished the research for the list of updates. Select update required, then right click and Uninstall.

  • Adobe Acrobat 2.0 problem - help please!

    I had Adobe Acrobat Standard 2.0 works well for years (and it is quite appropriate for what I need for) until about 2 weeks ago, when it stopped. My OS is Windows 7. I uninstalled the software and reinstalled several times without result. When you create a pdf from a Word (my usual task with Acrobat) document, it starts the process and then reached a point where it freezes, and eventually I have to close the program. The progress window "Adobe PDFMaker" reached a point where it says: "convert to Adobe PDF...". "and then freezes. All advice and help to solve very much appreciated! Thank you, John

    If you have Windows 7 Pro or better you can try to use XP mode (assuming that you can always get it to Download Windows XP Mode from the official Microsoft Download Center ).

    For more information on the installation of Acrobat 7, see: error "Activation of server" unavailable in Adobe CS2, Acrobat 7 and hearing 3

  • When I copy the original document in Illustrator CS6 in Illustrator CC parts of the dough of document beyond their position. I have attached the images below. I have to go to each article and make a compound path that takes a lot of time. Help, please.

    Screen Shot 2015-07-21 at 10.54.13 AM.pngScreen Shot 2015-07-21 at 10.54.33 AM.png

    Please apply the latest patch 19.1 this should solve your problem.

    -Ashutosh

  • Before 4 FF I close FF and save my tabs, I have to reopen all my tabs everytime I open FF with 4 FF. A lot of time. Help please

    Before you download FF4, when I closed FF he would ask if I wanted to save my tabs. I use the same 6 or 7 core tabs keep open all online, so when I close FF, I don't want to open them all each time. How do I save my tabs before closing with 4 FF. I urge me to warn that I will close the tabs, but does not give me the option to save for the next session.

    It is now even easier.

    Firefox 4 records the previous session.

    You can use "Firefox > history > restore previous Session" for the previous session.

    There is also a button 'Restore previous Session' on the default on: Home home page.

    Another possibility is to use:

    • Tools > Options > general > startup: "When Firefox starts": "show my windows and tabs from last time '.
  • satellite boot and recovery disk problem, help please...

    Hello

    Well, here's the question. My satellite is a few years old all of a sudden, she leaves the start. Gets the starting address windows xp mode then hangs and repeats the process. So I thought, well... I just install my recovery discs...

    Well well, thank you for a reason, and his frustration as what... I get an error of bad machine. Don't allow me to install my recovery disks. Call toshiba, they say my warranty has expired have to go pay a service representative... Arrgh...

    This was purchased new and this is the correct machine...
    Anyway... when I'm bad machine, I get:
    Failed installation aborted/a process!
    A:/>_
    I'm assuming, there is something I can type here to recognize my machine... Any ideas? Toshiba was no help. Or... If you have an idea how can I start this thing without recoery disks.

    Thanks in advance...

    Hello
    before anyone can say anything, I would be nice to know what type of laptop you have.
    Cause Toshiba has in the meantime changed the recovery process.

    Good bye

Maybe you are looking for