A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: Navigating from One Movie Clip to another - please help !!

  1. #1
    Member
    Join Date
    Jan 2001
    Posts
    99

    Navigating from One Movie Clip to another - please help !!

    I have a button inside a movie clip, when i click on the button, it should go to and play a certain number of frame in another movie clip, please let me know how to do this.

    Both movie clips are in the same scene.

    Thanks.

  2. #2
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    depending how you are coding your buttons there are 2 ways to do this:

    if the code is on the button:
    on(press){
    _root.myMovie_mc.gotoAndPlay(5);
    }

    if you are coding on the main timeline:
    your buttons instance name would be:
    myButton
    the code:
    myButton.onRelease = function(){
    myMovie_mc.gotoAndPlay(5);
    }
    does this answer your question

    IMS

  3. #3
    Member
    Join Date
    Jan 2001
    Posts
    99
    On the first one should i replace myMovie_mc with the movie clip name?

  4. #4
    Member
    Join Date
    Jan 2001
    Posts
    99
    my code is on the button.

    How do i set the name of the movie clip to myMovie_mc ?!

    Forgot to add a thing. I need an action on press and another action onrollover on the button. my current code on the button looks like this -

    on (press) {
    _root.Symbol7.gotoAndPlay(186); // Symbol7 is the name of the movie clip
    }
    on (rollOver) {
    _root.Symbol9.gotoAndPlay(21); //Symbol9 is the name of the movie clip
    }

    the above code does not work
    Last edited by jeswin12; 04-11-2007 at 12:07 PM.

  5. #5
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    myMovie_mc is just an example, you can name your clips whatever you want.
    did you give the movie clips the instance names Symbol7 and symbol9?

    are the buttons and movie clips on the main timeline, or inside different movie clips?

    If you can, post your file.


    IMS

  6. #6
    Member
    Join Date
    Jan 2001
    Posts
    99
    how do i give the instance names to a movie clip?

    the buttons and movie clips are inside different movie clips.

    Thanks for the help so far IMS

  7. #7
    Member
    Join Date
    Jan 2001
    Posts
    99
    You can get the file from

    http://rapidshare.com/files/25463514/sample.fla.html

    You can see the buttons inside the movie clip - menu_sprite43

    on press should be targeted to Symbol7

    on rollout should be targeted to Symbol9

    Thanks mate

  8. #8
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    I can't seem to download.
    to give a movie clip an instance name. you click on the movie clip and then look at your properties panel. there will be a textbox on the left under the movieclip dropdown. you name your clip there. it can be whatever you want. that is the name your code will refer to.

    when you right the code on your button, you need to know the path to the movie clip.

    so if I had a button on the main timeline and wanted to call movieClip_B which is in movieClip_A on the main timeline, i would write my code like this:

    on(press){
    _root.movieClip_A.movieClip_B.gotoAndPlay(7);
    }

    you can post your file here. in the submitt section, click the "go advanced" button. you can then upload your file



    IMS

  9. #9
    Member
    Join Date
    Jan 2001
    Posts
    99
    sorry about the link. you can download it from

    http://www.roadsidesystems.com/images/sample.zip

    Buttons are in menu_sprite 43. I tried linking menu 01.

  10. #10
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    not sure if you uploaded the right file. there is no code in the file and it doesn't really make sense with what you said you wanted to do.

    on (press) {
    _root.Symbol7.gotoAndPlay(186); // Symbol7 is the name of the movie clip
    }
    on (rollOver) {
    _root.Symbol9.gotoAndPlay(21); //Symbol9 is the name of the movie clip
    }

    symbol 7 which appears to be the clip on the main timeline does not have 186 frames in it. symbol 9 which appears to be the button movie, has only one fram so it can't possibly go to frame 21

    I can only assume that what you are trying to do is:
    1. on rollover of the button??
    2. on press have the black square turn red.



    IMS

  11. #11
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    here is a little simple file to get you started.
    I am guessing you have flash 8.

    enjoy

    IMS
    Attached Files Attached Files

  12. #12
    Member
    Join Date
    Jan 2001
    Posts
    99
    Thanks a million IMS, got my first part working.

    My second part would be - if i rollout of the orange box (move my mouse out of the box - myButton_btn) it should go and play a frame from another movie clip !! how do i do this?

    Thanks again.

  13. #13
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    see attached.

    IMS
    Attached Files Attached Files

  14. #14
    Member
    Join Date
    Jan 2001
    Posts
    99
    Thanks, Thanks and More Thanks

  15. #15
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    no problem.
    now if movieclip2 was inside movieclip1 you would put your code like this:

    code:

    myMovie1_mc.myMovie2_mc.gotoandPlay(2);




    have fun

    IMS

  16. #16
    Member
    Join Date
    Jan 2001
    Posts
    99
    you are a genius

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