dcsimg
A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: button in movieclip

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    7
    hi hi....this is my first post. I'm at bit new with MX but I'm learning....I've got a problem i can't seem to find my way around....I've created a movie clip and placed it in scene1...within the movie clip i've got a button. I like to be able to click this button and have it take me to scene2...this in my mind seems kinda easy...4hrs later...i'm kicking myself in the butt..helppppppp..I'd attach the .fla here if i could but i dont see the ability to do that

  2. #2
    chatbugs.com ***** flashTampaDotCom's Avatar
    Join Date
    Mar 2002
    Location
    Tampa, Florida
    Posts
    171
    Please check this thread out, I have an example posted there, too:

    http://board.flashkit.com/board/show...hreadid=321097

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Posts
    7

    still having problem

    hi hi .. thanks for replying flashTampaDotCom
    but im' still having the problem....the example you pointed me to had a button call another scene..but my button is withing an movie clip...I tried the soloution there and nada....also..is there a general place to past .fla's to so i can have some have a look at it..thanks

  4. #4
    Member
    Join Date
    Oct 2001
    Posts
    45
    try this code, Attach It To Your Button.

    on (release){
    _root.gotoAndStop."NameOfScene2" ;
    }

  5. #5
    Junior Member
    Join Date
    Jun 2002
    Posts
    7
    gave it a shot n8......got this as a problem
    Symbol=ServicesSubMenu, Layer=Layer 1, Frame=17: Line 2: Expected a field name after '.' operator.
    _root.gotoAndStop."Services" ;

    tried it with and without the quotes on Services...Services is the name of the scene.

  6. #6
    Member
    Join Date
    Oct 2001
    Posts
    45
    Let Me Check That Out.I Probbaly Missed Something Lil'. Ill Get Back To U In A few.

  7. #7
    Member
    Join Date
    Oct 2001
    Posts
    45
    on (release){
    _root.gotoAndStop(Services);
    }

    There It Is !

    If That Doesnt Work Try And Put "s Around Services Between The ( and ). Like This ("Services").

  8. #8
    Junior Member
    Join Date
    Jun 2002
    Posts
    7
    it worked for you...and not for me..lol..rats..i was asking before..can i send this .fla to you or to a general area.....

  9. #9
    Member
    Join Date
    Oct 2001
    Posts
    45
    You Can Sned It To Me Through Email, No Prob, I Dont Know If U Can Post It On This Board Though. n8t6x@hotmail.com

  10. #10
    Junior Member
    Join Date
    Jun 2002
    Posts
    7
    k..sent it.thanks

  11. #11
    chatbugs.com ***** flashTampaDotCom's Avatar
    Join Date
    Mar 2002
    Location
    Tampa, Florida
    Posts
    171
    http://www.flashtampa.com/flashtutorials/jumpScene2.swf
    http://www.flashtampa.com/flashtutorials/jumpScene2.fla

    There, it's code on a Button contained in a MC.. no biggie. It calls a function defined in the root on frame 1; and makes it go to the next scene.

    That what you need?

  12. #12
    Junior Member
    Join Date
    Jun 2002
    Posts
    7

    Smile

    sweetttttttttttttttttttttttttttttttt

    thanks..got it workin..i'm going to see about setting up a place where we can keep .fla's ....im a bit new and all but sometimes its easier recreating the problem in a small .fla and posting it....then asking some good targetted questions.....thanks again

  13. #13
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    to simplify and explain:

    you can't directly target scenes from within a movieclip.
    there are two workarounds, the first was given to you above,
    the second (and my preferred option) is:
    target labelled frames.
    scenes are simply an extension of the main timeline (_root)
    they are only used in the authoring process as a way to break up the main timeline into logical chunks.
    So if you give keyframes (in any scene) frame labels you can target those labels with
    Code:
    on(release) {
        _root.gotoAndPlay("labelname");
    }
    IMO thats a lot easier than calling a remote function.
    Just remember to label your frames uniquely.

  14. #14
    chatbugs.com ***** flashTampaDotCom's Avatar
    Join Date
    Mar 2002
    Location
    Tampa, Florida
    Posts
    171
    http://www.flashtampa.com/flashtutorials/jumpScene3.swf
    http://www.flashtampa.com/flashtutorials/jumpScene3.fla

    I conquer. The only problem is having to actually PUT a frame label where you need it on the relevent scenes.

    So, one only has to ask themselves: which is easier? to use a function, or a series of functions on one frame that are defined as "jumptoScene2()", "jumptoScene3()".. etc.. and referencing them as needed, where-ever, or, as even in my example as a proof based on Sonwah's suggestion, use what we believed should have worked all along [using our own label name], but, then having to seek out that 1st frame on each scene, and give it a unqiue frame label...

    I still say: SCENES SUCK.




  15. #15
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743

    ....scenes suck
    I couldn't agree more, I never use them myself.

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