A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: .swf file I want to plaay on roll over but only once

  1. #1
    Member
    Join Date
    Mar 2003
    Location
    San Jose, CA
    Posts
    50

    .swf file I want to plaay on roll over but only once

    Hi,
    I want an .swf file to play while in one of my movies but only on roll over and stop either as I move off the movie or after the movie has run once. I am new to action script but here is what I have so far.
    onClipEvent (load) {
    stop();
    }
    on (rollOver) {
    play();
    }

    So, this plays the movie but continues on and on....

    Any help appreciated.

    TIA
    When all else fails... Mainpulate the data...

    Rod Cohen

  2. #2
    AFX == P. Forsberg
    Join Date
    Nov 2001
    Posts
    439

    variable

    hey. I'm trying to figure out what you are after.

    If you only want the rollover to play once, you will need to set a variable in an if statement as such:

    on (rollOver) {
    if (playOnce == 0) {
    playOnce = "1";
    play();
    }
    }

    At the begining of the movie you will need to set playOnce to 0. This way the button will know the value is 0 when the rollOver script is executed.

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