A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: [RESOLVED] script for my button

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

    resolved [RESOLVED] script for my button

    does anyone know how to make my button go to other scene ?

    here is my button

    http://s000.tinyupload.com/index.php...39244794682264
    maybe I'm old, but I want to learn more

  2. #2
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Scene or frame? There is a huge difference between these two.

  3. #3
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    scene sir

    i've try using _root.gotoAndStop

    but it wont work
    maybe I'm old, but I want to learn more

  4. #4
    Junior Member
    Join Date
    May 2013
    Posts
    6
    You can't do gotoAndStop with scenes.
    I don't remember if this works with as2, but try:


    gotoScene(scene number here);

  5. #5
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    how to know the scene number ?

    from the order of scene list ?

    the gotoScene wont work on AS 2
    maybe I'm old, but I want to learn more

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

    Try
    PHP Code:
    gotoAndStop("Scene1"1); 
    or
    PHP Code:
    gotoAndStop("Scene2"1); 
    depending upon which scene it is you want to go to as I can not make head or tail of your fla file.

  7. #7
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    fruitbeard : it not work sir, i've try it
    maybe I'm old, but I want to learn more

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

    which is the button, is it the big green box and you want to go to scene2

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

    Try this, give the main movie clip on scene 1 a name of "a", then put this on the timeline of scene 1
    PHP Code:
    stop();
    a.b.onPress = function()
    {
        
    gotoAndStop("Scene 2"1);
    }; 

  10. #10
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    if i use that script, the motion become not working
    maybe I'm old, but I want to learn more

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

    When I use the code it works, perhaps you are putting the code in the wrong place, it needs to go on the main timeline of scene 1, and not inside the movieclip, i could post the fla, I use CS6, but can make it CS5.

    There you go, CS5, I had to remove the twirling smoke images to make it smaller, you can add them back at your end
    Last edited by fruitbeard; 05-08-2013 at 11:53 AM.

  12. #12
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    so its not working in flash 8 ?
    maybe I'm old, but I want to learn more

  13. #13
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    oh, its work

    thanks sir
    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