A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Button nested inside MC

  1. #1
    Senior Member [SH]Doc's Avatar
    Join Date
    May 2002
    Location
    Belgium
    Posts
    149

    Button nested inside MC

    First of all, sorry to ask this question again, for it's bound to have been answered several times, but unfortunetly the Search function gave me a DBase error...

    Anyhow... I have a Movieclip and inside is an invisible button. I want the movie to jump to frame 30 on the main timeline (or to "Enter" which is the framelabel at frame 30)

    So I attached this code to my invisible button.
    Code:
    on (release){
    	_root.gotoAndPlay(30);
    }
    however, this doesn't seem to work, when clicked, the movie jumps to where the button was introduced to the timeline (frame 13 instead of frame 30)

    Thx in advance
    To accomplish great things, we must dream as well as act.
    - Anatole France

  2. #2
    Guest
    Join Date
    Jan 2001
    Location
    Timeline,Frame No.260
    Posts
    1,365
    try using the frame label instead of frame number, its fairly simple, should work like a charm, if the problem presist, upload the file on this thread so some one can check..or email it to me [email protected]


    God Gives every bird it's food, but He does not throw it into it's nest

  3. #3
    climbing shoots and ladders feigner's Avatar
    Join Date
    Jun 2003
    Location
    IOP
    Posts
    263
    you dont want to use _root.
    you want to use _parent. instead so on(release) the button in your MC will gotoAndPlay("enter") on the main timeline.

    the code for the button should look like this:
    Code:
    on(release){
    _parent.gotoAndPlay(30);
    }
    if that doesnt work tell me
    FEIGNER
    Before you post, do you search?

  4. #4
    Senior Member [SH]Doc's Avatar
    Join Date
    May 2002
    Location
    Belgium
    Posts
    149
    _parent did the trick, thx I always thought _root and _parent were the same?


    try using the frame label instead of frame number, its fairly simple, should work like a charm, if the problem presist, upload the file on this thread so some one can check.. => I had already done that

    Thx for helping me out peepz
    To accomplish great things, we must dream as well as act.
    - Anatole France

  5. #5
    climbing shoots and ladders feigner's Avatar
    Join Date
    Jun 2003
    Location
    IOP
    Posts
    263
    just so you know:
    _root is used to affect a MC from your main timeline
    _parent is used to affect the main timeline from a MC
    Note: Thats just generally there are other uses also.
    FEIGNER
    Before you post, do you search?

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