A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] Need help with button

  1. #1
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84

    resolved [RESOLVED] Need help with button

    i try to put script on this button to go to specific scene

    but it alway error, can anyone help me ?

    here's the button
    buttons-1.fla
    maybe I'm old, but I want to learn more

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    HTML Code:
    onClipEvent (mouseDown) {
    	if (hitTest(_root._xmouse, _root._ymouse, false))
    	{
    		trace("click"+ name);
    		_root.gotoAndStop(2);
    	}
    	else
    	{
    	}
    }

  3. #3
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    Quote Originally Posted by fruitbeard View Post
    Hi,

    HTML Code:
    onClipEvent (mouseDown) {
    	if (hitTest(_root._xmouse, _root._ymouse, false))
    	{
    		trace("click"+ name);
    		_root.gotoAndStop(2);
    	}
    	else
    	{
    	}
    }
    not work sir

    i've try it, but the frame didn't go to other frame, just popup some output
    maybe I'm old, but I want to learn more

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,
    well post some more of the fla, the button.fla one only had one frame and no scenes, cant do it all for you

  5. #5
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    here's my project
    http://s000.tinyupload.com/index.php...85257141488303

    the button.fla was the sample

    i was trying to make when the "Mulai" button pressed, the frame will go to "soal1" scene

    can you help me ?
    maybe I'm old, but I want to learn more

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    try this, remove the onclipevent code from each button.
    Inside Mulai movieclip, give the button a name of "Clicker"
    On the first frame of main timeline use this code

    PHP Code:
    stop();
    Mulai.Clicker.onPress = function()
    {
        
    trace("clicked: " this._parent._name);
        
    gotoAndPlay("soal 1"1);
    }; 
    Hope that makes sense

  7. #7
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    thanks
    maybe I'm old, but I want to learn more

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