A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: ugh why is this not working? simple onclipevent

  1. #1

    ugh why is this not working? simple onclipevent

    OK here is what I'm trying to do.

    I have rotating floppy disk that is triggered by a button.
    When you roll over the button the floppy begins to rotate.
    When you roll out the floppy will continue to rotate until you reach frame 15 where it will go to frame 1 and stop. The movie clip is assigned a name of floppy. I think the problem is with the if statement for the rollout for the onclipevent. Currently it all works but the rollout.

    Any help would be appreciated.

    Here is a link to the page:
    www.zoosplace.com/preview/test.html

    Here is the action script.

    First frame in flash:

    stop();
    _root.floppy.stopfloppy=true

    Floppy disk action script:

    onClipEvent (enterFrame) {
    if (stopfloppy) {
    gotoAndStop(1);
    }
    }
    onClipEvent (enterFrame) {
    if (rolloverfloppy) {
    play();
    }
    }
    onClipEvent (enterFrame) {
    if (rolloutfloppy) {
    if (_currentframe<14) {
    _root.floppy.nextFrame();
    }
    if (_currentframe=15) {
    _root.floppy.gotoAndStop(1);
    }

    }
    }

    Button action script:

    on (rollOver) {
    _root.floppy.stopfloppy=false
    _root.floppy.rolloverfloppy=true
    _root.floppy.rolloutfloppy=false
    }
    on (rollOut) {
    _root.floppy.stopfloppy=false
    _root.floppy.rolloverfloppy=false
    _root.floppy.rolloutfloppy=true
    }

  2. #2
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    on the first frame
    put
    Code:
    _root.floppy.gotoAndStop(1)
    on the button put
    Code:
    on (rollOver) {
    	_root.floppy.move = true;
    	_root.floppy.gotoAndPlay(1)
    }
    on (rollOut) {
    	_root.floppy.move = false;
    }

    on the last frame of the floppy movieclip put
    Code:
    if (_root.floppy.move == false) {
    	gotoAndStop(1);
    } else {
    	gotoAndPlay(1);
    }

  3. #3

    thanks

    thanks you are the best.. I have been fighting this all day...
    I will try it and let you know how it goes...

  4. #4

    kinda works

    ok it works better than before but i did not want the rollover action to disrupt the movement if it was already in action...

    what does move equal.. or what value does it hold.

    I think i can figure something out but if you have the answer on top of your head it would be appreciated.

  5. #5
    OK now it works the way I want it to...

    I just put play(); in place of gotoAndPlay(1) in the button actionscript...

    Thanks again... you are a life saver

  6. #6
    [sleep.less.ness] euphoricGenius's Avatar
    Join Date
    Jan 2003
    Location
    insomnia
    Posts
    344
    Here's my allterations to your file

    eG
    Attached Files Attached Files
    &nbsp;Beware Of Programmers Who Carry A Screwdriver

  7. #7

    thank for the help...

    Thanks for the help...

    Here is the final of what I was trying to do
    http://www.zoosplace.com/preview/

    Once again thanks...

  8. #8
    [sleep.less.ness] euphoricGenius's Avatar
    Join Date
    Jan 2003
    Location
    insomnia
    Posts
    344
    which method did you end up using?



    eG
    &nbsp;Beware Of Programmers Who Carry A Screwdriver

  9. #9
    I ended up using fidodo's method. But I did like they way you did yours. I'm not sure the effects of using either way. As long as it does what I want I don't care too much about the code. Its just funny how my original code was off so much...

    I guess I should pick up an actionscript book and learn it...

  10. #10
    [sleep.less.ness] euphoricGenius's Avatar
    Join Date
    Jan 2003
    Location
    insomnia
    Posts
    344
    looking back and comparing they are very similar, depends on your prefernce for coding style


    eG
    &nbsp;Beware Of Programmers Who Carry A Screwdriver

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