Skip navigation
ingenieurtunisien
Currently Being Moderated

[AS2] Navigation à partir d'un bouton dans clip vers une autre séquence

Nov 29, 2012 2:20 AM

Bonjour à tous,

 

Je suis entrain de développer une animation en AS2, mon problème est le suivant:

 

Je travaille avec clip qui contient des boutons, et en cliquant sur ces boutons je souhaite passer à d'autres séquences. J'ai réussi à naviguer dans la même séquence en utilisant "_root.gotoAndStop(num_image);" mais je n'ai pas réussi à naviguer vers d'autres séquences.

 

l'arborescence de mon animation est la suivante :

- séquence 1 (nommée "maquette") : elle contient un premier symbole clip "clip1", qui contient à son tour un clip "clip2" (cad clip2 est integré dans clip1). Clip 2 contient un bouton, en cliquant sur ce bouton je veux aller à l'image 1 de la séquence 2 (nommé seq2), mais je n'arrive pas.

 

Pouvez vous m'aider? Merci

 
Replies
  • Currently Being Moderated
    Jun 4, 2013 2:46 AM   in reply to ingenieurtunisien

    Moving this discussion to Flash Pro - General forum.

     
    |
    Mark as:
  • kglad
    72,213 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 4, 2013 8:06 AM   in reply to ingenieurtunisien

    if maquette is a movieclip on your main timeline that contains movieclip clip1 which contains movieclip clip2 which contains a button (with, for example, name button1) AND you want to control movieclip seq2 that's also on your main timeline AND your code is on the main timeline, use

     

    maquette.clip1.clip2.button1.onRelease=function(){

    seq2.gotoAndStop(1);

    }

     

    if your code is on clip2's timeline, use:

     

    button1.onRelease=function(){

    _parent._parent._parent.seq2.gotoAndStop(1);

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 4, 2013 9:33 AM   in reply to ingenieurtunisien

    English Translation from Google: Hello everyone, I am trying to develop an animation in AS2, my problem is this: I work with clip with buttons, and clicking on these buttons I want to move to other sequences. I managed to navigate through the same sequence using "_root.gotoAndStop (num_image)," but I was not able to navigate to other sequences. the tree of my animation is as follows: - Sequence 1 (called "model"): it contains a first symbol clip "clip1", which in turn contains a "clip2" clip (ie is integrated into clip1 clip2). Clip 2 contains a button, clicking this button I want to go to Frame 1 of the sequence 2 (named seq2), but I can not. Can you help me? thank you

     

     

    By "sequence" I assume you mean "scene", since you say you can navigate within the first sequence using "_root.gotoAndStop".  Unfortunately, Flash's gotoAndStop( [scene:String], frame:int ) overload just doesn't work when you try to specify a scene name.

     

    To work around that, just put a unique frame label on your 2nd scene's main timeline and navigate to it using _root.gotoAndStop("frame_label").  Flash will figure out which scene the label is on as long as you use _root.gotoAndStop.

     

    Your handler would look like this:

     

    clip1.clip2.button.onMouseDown = function() { _root.gotoAndStop( "frame_label_in_scene_2" ); }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points