A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: How to pause a function?

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    58

    Unhappy How to pause a function?

    hey everyone,
    i want to just pause a function called timerun,which starts when a button
    is clicked.A want to do this only when another button is clicked.
    there is only 1 layer,1 frame.
    like this:
    //button1
    on(release)
    {
    function timerun()
    {.....}
    }
    //the other button
    on(release)
    {
    ..........//pause timerun

    }
    thanks

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    does this method help ?
    PHP Code:
    //button1
    on(release){
    timerun("go");
    }

    //button2
    on(release){
    timerun("nogo");
    }

    //main timeline
    function timerun(param){
    if(
    param=="go"){
    // run this function
    } else {
    // do something else
    }
    }; 

  3. #3
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    or possibly:

    on(release) {
    setTimeout(timerun,5000);// Delay function call for 5 seconds
    }

    function timerun() {
    trace('You rang?');
    }

  4. #4
    Member
    Join Date
    Aug 2008
    Posts
    58

    Unhappy it din help at all!!!!!

    to a_modified_dog,

    //button1
    on(release)
    {
    function timerun()
    {.....}
    }
    //the other button
    on(release)
    {
    ..........//pause the function:-'timerun'

    }
    i jus want u tell me what i shud type on the 10th line where i have typed
    //pause the function:-'timerun' ".
    does flash have a command for pausing a function.
    plz specify that command with respect to dis
    y shud i go to the main timeline?!?
    plz buddy i have got stuck wid dis since a month.

    to sstalder ,
    it is actually a stopwatch like thing that i m trying to do.
    not wat u said.
    thanks though.
    help.

  5. #5

  6. #6
    Member
    Join Date
    Aug 2008
    Posts
    58

    Unhappy now?

    that is quite different.
    now:
    Untitled-2.fla
    k plz help me wid have to type in pause button.
    Do refer to my logic.
    Thanks

  7. #7
    Member
    Join Date
    Aug 2008
    Posts
    58
    plz help,my head is swimming!!!

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    does flash have a command for pausing a function.

    NO.

    you must use the logic in mine and sstadlers posts

    ps.. if replying, please use good grammar and spell correctly.
    this is a professional forum, not a teen-chat room
    Last edited by a_modified_dog; 09-27-2008 at 11:51 AM.

  9. #9
    Member
    Join Date
    Aug 2008
    Posts
    58

    Request


    OK
    I got it wat u are saying and I tried it.
    But I am not able to make it work in the file.
    Please put the code in the file i have attached earlier(2 comments earlier)
    and attach the completed file and download it so that I can know the actual
    idea behind it.
    Thank You.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center