A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: need help with a simple task

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Location
    Hollywood, CA
    Posts
    9

    need help with a simple task

    I have an mc with instance name audiomc. I want it to play only once but when accessed again to go to the end and stop. I have a label at the end called "theend".

    first try was to put the following above the movieclip:

    if(audiomc.playcount == true){
    audiomc.gotoAndStop("theend");

    }


    then on the last frame which is also the one labeled "theend" I put:
    stop();
    playcount = true;

    the idea is that once played through, then "playcount" is true and subsequent plays will just go the last frame and stop. Of course it doesnt work and I am probably do a million things wrong but appreciate help if someone could tell me how to do this.

    thanx,

    Peter
    ------P e t e r C o n n--------
    >>>information design<<<
    peter@milesconsulting.org

  2. #2
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Add this var to the main timeline:

    PHP Code:
    var plays_count:Number 0
    on the last frame of audiomc put this code:
    PHP Code:
    _root.plays_count++; 
    than for your if statement put:

    PHP Code:
    if(_root.plays_count 0){
    _root.counter++;
    audiomc.gotoAndStop("theend");
    }else{
    audiomc.gotoAndPlay(1);

    if you liked that script feel free to buy me a drink on paypal: giancarloquarta@yahoo.com
    and I will help you further for free.

  3. #3
    Senior Member
    Join Date
    Aug 2012
    Posts
    115
    exampe is simplest.
    Attached Files Attached Files

  4. #4
    Junior Member
    Join Date
    Nov 2000
    Location
    Hollywood, CA
    Posts
    9

    Red face thanx

    Quote Originally Posted by Terrencing View Post
    exampe is simplest.
    that Alloy Bacon person gave me a solution back in November that worked. Yours looks good too. thanx for helping.
    -Peter

    http://board.flashkit.com/board/images/icons/icon11.png
    ------P e t e r C o n n--------
    >>>information design<<<
    peter@milesconsulting.org

  5. #5
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Thanks for the contribution by paypal back in november peter

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