This is my first post so be patient please.
I am a newbie, but I think the scripting forum would be the best for this problem. I am combining script from three different Flash files and have managed to make everything work except for one detail.
I have four buttons that have fade in time controls and one button doesn't fade in properly. The CytBtn will only take on the fade in property of the TipBtn. The buttons have the right instance names and the code seems correct to me, but I'm obviously missing something.
The instance names for the buttons are correct and I can turn them on and off just fine.
Here is the code for anyone willing to look at it. I didn't include everything, just what I think is pertinent. Thanks!
Code:var needTechVideoBtn = true; var secondsDelay_techVideo = 1; var needTechTextBtn = true; var secondsDelay_techText = 0; var needTipBtn = true; var secondsDelay = 1; //select a teacher image to use // teacherOne = African American Woman // teacherTwo = Caucasian Male // teacherThree = Asian Woman tipTextObject.teacherImage.gotoAndPlay("teacherOne"); var needCytBtn = true; var secondsDelay_cytBtn = 0; //select a teacher image to use // teacherOne = African American Woman // teacherTwo = Caucasian Male // teacherThree = Asian Woman cytTextObject.teacherImage.gotoAndPlay("teacherTwo"); function removeTipBtn (){ if (needTipBtn == false) { delete btnFadeIn_tip; delete myInterval_tip; delete tipBtn; } } removeTipBtn(); tipTextObject._visible = false; tipBtn._visible = false; tipTextObject.textTarget.setTextFormat(tipFormat); tipTextObject.textTarget.embedFonts = true; tipTextObject.textTarget.htmlText = tipText; function btnFadeIn_tip (){ tipBtn._visible = true; clearInterval(myInterval_tip); //tipBtn.play(); } var myInterval_tip = setInterval(btnFadeIn_tip,(secondsDelay * 1000)); tipBtn.onPress = function() { if (ArtAPI.IsPlaying() == false && tipTextObject._visible == false) { wasPlaying = false; } if (wasPlaying == true) { if (tipTextObject._visible == false) { ArtAPI.Pause(); tipTextObject._visible = true; } else { ArtAPI.Play(); tipTextObject._visible = false; } } else { if (tipTextObject._visible == false) { tipTextObject._visible = true; } else { tipTextObject._visible = false; } } } tipTextObject.tipsCloseBut.onRelease = function() { if (wasPlaying == true) { tipTextObject._visible = false; ArtAPI.Play(); } else { tipTextObject._visible = false; } } /****************** Code that makes the CYT BUTTON work begins here ******************/ cytTitleFormat = new TextFormat(); cytTitleFormat.size = 14; cytTitleFormat.font = "Gill Sans" cytTitleFormat.color = 0xFFFFFF; cytFormat = new TextFormat(); cytFormat.size = 14; cytFormat.font = "Gill Sans" cytFormat.color = 0x000000; stop(); function removeCytBtn (){ if (needCytBtn == false) { delete btnFadeIn_cyt; delete myInterval_cyt; delete cytBtn; } } removeCytBtn(); cytTextObject._visible = false; cytBtn._visible = false; cytTextObject.textTarget.setTextFormat(cytFormat); cytTextObject.textTarget.embedFonts = true; cytTextObject.textTarget.htmlText = cytText; function btnFadeIn_cyt (){ cytBtn._visible = true; clearInterval(myInterval_cyt); //CytBtn.play(); } var myInterval_cyt = setInterval(btnFadeIn_cyt,(secondsDelay * 1000)); cytBtn.onPress = function() { if (ArtAPI.IsPlaying() == false && cytTextObject._visible == false) { wasPlaying = false; } if (wasPlaying == true) { if (cytTextObject._visible == false) { ArtAPI.Pause(); cytTextObject._visible = true; } else { ArtAPI.Play(); cytTextObject._visible = false; } } else { if (cytTextObject._visible == false) { cytTextObject._visible = true; } else { cytTextObject._visible = false; } } } cytTextObject.cytCloseBut.onRelease = function() { if (wasPlaying == true) { cytTextObject._visible = false; ArtAPI.Play(); } else { cytTextObject._visible = false; } } /*End CYT Button------------------------------*/


Reply With Quote

Bookmarks