A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Using conditions to control button actions

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    2

    Using conditions to control button actions

    I used a tutorial to attempt to set up my code so that after a button is released and an external .swf is loaded the same button can't be activated again (on release or on rollover) until a different button is released.

    Here is an example of my actionscript. What I'm trying to do here is just have the button not replay the mc in the over state if it's movie clip is already loaded in:

    var canrelease:Boolean = false;
    can_mc.can_btn.onRelease = function() {
    if (canrelease == false) {
    _root.empty_mc.loadMovie("paper1.swf",0);
    } else {
    can_mc.can_btn.spray_mc.gotoAndStop(25);
    }
    };

    I've tried numerous times to get this to work but nothing is happening.

    I'd also like the button to not reload the movie clip alreasy being played if it is currently loaded.

    Thanks!

  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    2
    Forgot to add - I'm using AS 2.0

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