2016-10-07 1 views
0

Mon problème comme indiquéJe suis débutant dans FlashCS6. Programmation ActionScript

Scene 1, Layer 'Layer 19', Frame 1, Line 23 1061: Call to a possibly undefined method addEventListener through a reference with static type Boolean. 
Scene 1, Layer 'Layer 19', Frame 1, Line 28 1061: Call to a possibly undefined method addEventListener through a reference with static type Boolean. 
Scene 1, Layer 'Layer 19', Frame 1, Line 33 1061: Call to a possibly undefined method addEventListener through a reference with static type Boolean. 
Scene 1, Layer 'Layer 19', Frame 1, Line 38 1061: Call to a possibly undefined method addEventListener through a reference with static type Boolean. 

Mon code était bien jusqu'à ce que j'ajouter un mini bouton entre les images parce que je ne peux pas trouver un tutoriel mettre un codage entre. certains disent que je dois le mettre dans une nouvelle couche. Je me suis coincé. S'il vous plaît aider!

stop(); 

header_mc.home_btn.addEventListener(MouseEvent.CLICK, gohome); 
header_mc.logo_btn.addEventListener(MouseEvent.CLICK, gohome); 

function gohome (event:MouseEvent):void{ 
    gotoAndStop(1) 
} 

header_mc.about_btn.addEventListener(MouseEvent.CLICK, goabout); 

function goabout (event:MouseEvent):void{ 
    gotoAndStop(2) 
} 

header_mc.image_btn.addEventListener(MouseEvent.CLICK, goimage); 

function goimage (event:MouseEvent):void{ 
    gotoAndStop(3) 
} 

////////Button 1////////// 
thumb1_btn.enabled=true.addEventListener(MouseEvent.CLICK, GetFirstImage) 
function GetFirstImage (event:MouseEvent):void{ 
    gotoAndStop(4) 
} 
////////Button 2////////// 
thumb2_btn.enabled=true.addEventListener(MouseEvent.CLICK, GetSecondImage) 
function GetSecondImage (event:MouseEvent):void{ 
    gotoAndStop(5) 
} 
////////Button 3////////// 
thumb3_btn.enabled=true.addEventListener(MouseEvent.CLICK, GetThirdImage) 
function GetThirdImage (event:MouseEvent):void{ 
    gotoAndStop(7) 
} 
////////Button 4////////// 
thumb4_btn.enabled=true.addEventListener(MouseEvent.CLICK, GetForthImage) 
function GetForthImage (event:MouseEvent):void{ 
    gotoAndStop(6) 
} 

header_mc.contact_btn.addEventListener(MouseEvent.CLICK, gocontact); 

function gocontact (event:MouseEvent):void{ 
    gotoAndStop(7) 
} 

header_mc.demo_btn.addEventListener(MouseEvent.CLICK, godemo); 

function godemo (event:MouseEvent):void{ 
    gotoAndStop(8) 
} 

Répondre

1

probablement ce que vous voulez réaliser est:

thumb4_btn.addEventListener(MouseEvent.CLICK, gocontact); 

pas

thumb4_btn.enabled=true.addEventListener(MouseEvent.CLICK, gocontact) 

Seuls les objets qui mettent en œuvre IEventDispatcher ont méthode addEventListener

+0

Si la propriété 'enabled' devrait être en plus d'appeler la fonction, cela devrait se faire sur une ligne séparée. – null