A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: button and action

  1. #1
    Member
    Join Date
    Feb 2008
    Location
    Turkey...Istanbul
    Posts
    83

    Arrow button and action

    hi,
    I want my button1 to tell my MC1 to play from FRAME1 to frame10
    I want my button2 to tell my MC2 to play from FRAME11 to frame20
    I want my button3 to tell my MC3 to play from FRAME21 to frame30
    all MCs are on different layers.
    and so on...
    but the problem is that when I press button1..it plays both MC1 and MC2 and MC3..
    How can I avoid it playing other MCs? ıs it possible to make others hiden as it plays a certain MC?
    thanks
    Last edited by genc27; 07-29-2008 at 05:18 PM.

  2. #2
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    could you possibly provide the code you are using?
    mmm signature

  3. #3
    Member
    Join Date
    Feb 2008
    Location
    Turkey...Istanbul
    Posts
    83
    here is my code;
    stop();
    btn1.onRelease = function () {
    gotoAndPlay(3);
    }
    btn2.onRelease = function (){
    gotoAndPlay(11);
    }
    btn3.onRelease = function (){
    gotoAndPlay(21);
    }
    Last edited by genc27; 07-29-2008 at 06:42 PM.

  4. #4
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    correct me if I'm wrong but I think you need the instance name of your MC for example it would be MC1.gotoAndPlay(3); does that help at all?
    mmm signature

  5. #5
    Member
    Join Date
    Feb 2008
    Location
    Turkey...Istanbul
    Posts
    83
    Please have look at my code. Whats wrong with it?
    it doesnT work..
    I m tring to play each Mc using corresponding button.



    PHP Code:
    but1.onRollOver=function()
    {
        
    _root.bir_mc.gotoAndPlay(2);
        }
        
    but2.onRollOver=function()
    {
        
    _root.iki_mc.gotoAndPlay(10);
        }
        
    but3.onRollOver=function()
    {
        
    _root.uc_mc.gotoAndPlay(20);
        } 
    Attached Images Attached Images

  6. #6
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    I think you need to go to frame 2, 10, and 20 and put the code stop();
    Tell me if that solves your problem.
    mmm signature

  7. #7
    Member
    Join Date
    May 2008
    Location
    Wellington, NZ
    Posts
    35
    what you have to stop is the MC1, MC2, MC3 movieclips, not the main timeline.

    Give a try to

    PHP Code:
    but1.onRollOver=function() { 
      
    mcStopAll()
      
    _root.bir_mc.gotoAndPlay(2); 

    but2.onRollOver=function()  { 
      
    mcStopAll()
      
    _root.iki_mc.gotoAndPlay(10); 

    but3.onRollOver=function()  {
      
    mcStopAll()
      
    _root.uc_mc.gotoAndPlay(20); 


    function 
    mcStopAll() {
      
    _root.bir_mc.stop();
      
    _root.iki_mc.stop();
      
    _root.uc_mc.stop();


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