Problème d'action de bouton dans un clip

cs_141264 Messages postés 2 Date d'inscription jeudi 19 mars 2009 Statut Membre Dernière intervention 3 avril 2009 - 1 avril 2009 à 15:09
cs_141264 Messages postés 2 Date d'inscription jeudi 19 mars 2009 Statut Membre Dernière intervention 3 avril 2009 - 3 avril 2009 à 11:31
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Cfbouchet%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->

Bonjour,





J’ai un problème d’action sur
un bouton se trouvant sur un clip…





Je me suis servi d’un tutorial
trouvé sur ce site pour réaliser une visite virtuelle d’un bâtiment (merci Mr.
Shaun WOURM : http://www.flashkod.com/code.aspx?ID=31333).





Ce tutorial permet de faire
défiler une photo panoramique à l’aide d’un scrollbar. J’ai suivi les
instructions et tout fonctionne très bien.





Pour réaliser cette animation
la photo panoramique doit être transformée en clip, ce que j’ai fait.





Le scrollbar est situé en
dessous de ce clip.





J’ai essayé de mettre des
boutons sur le clip (photo d’un hall d’entrée) pour accéder à d’autres scènes
de l’animation mais cela ne marche pas.






 






Merci d’avance… :





Frédéric






 







 






Voici les codes :





(scrollbar) :






poignee.onPress = function(){




this.startDrag(false,0,0,350,0);


};







poignee.onRelease = function(){




this.stopDrag()


}






clip) :






panorama.targetX = panorama._x;










panorama.onEnterFrame
= function() {




var speed = 3;


this._x += (this.targetX - (this._x / 3)) / speed;


}







(bouton sur le clip) :






on (release) {








                gotoAndPlay("lasequence",
1);







}

2 réponses

cs_Girou Messages postés 1203 Date d'inscription lundi 10 mars 2003 Statut Membre Dernière intervention 23 juillet 2009 2
1 avril 2009 à 19:47
Bonjour,

a mon avis, ton gotoAndPlay() est ciblé sur le clip panorama...
essaye avec
on (release) {

                this.parent.parent.gotoAndPlay("lasequence", 1);

}
ou aussi un
on (release) {

                _root.gotoAndPlay("lasequence", 1);

}

mais c'est pas bien d'utiliser _root...

@+
0
cs_141264 Messages postés 2 Date d'inscription jeudi 19 mars 2009 Statut Membre Dernière intervention 3 avril 2009
3 avril 2009 à 11:31
Bonjour et merci d'avoir répondu à ma question aussi rapidement.
J'ai essayé les deux solutions (parent et root) et cela ne fonctionne pas malheureusement.
J'ai essayé ces codes en faisant une autre animation toute simple (sans scrollbar sur le clip) et cela fonctionne avec la fonction root par contre.
Amicalement
Frédéric
0
Rejoignez-nous