MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Especificações Página 140

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 369
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 139
Chapter 462
6 Copy and paste the following code to the Actions panel for the first frame of the movie:
stop();
var userAnswer = false;
function doRecord() {
// If user selects button to record...
if (Record_btn.getLabel() == "Record") {
// Call function to get user’s approval to record.
getApproval();
// When user has provided an answer, if the answer’s
// yes, begin to record, otherwise, send a status
// message
WarnNow_mc.onUnload = function () {
// If user approved, Record.
if (userAnswer == true) {
//
// Record
// .
// .
// .
//
trace("Recording...");
// Change the button label
Record_btn.setLabel("Stop");
// Else if user refused, give status.
} else {
trace("User did not approve streaming.");
}
}
// Else if user selects button to stop recording...
} else if (Record_btn.getLabel() == "Stop") {
trace("Stopped Recording.");
// Change the button label
Record_btn.setLabel("Record");
}
}
function getApproval(){
// Attach the movie clip to prompt user input,
// and align it on the stage.
_root.attachMovie("warnRec_mc", "WarnNow_mc", 1);
var x = 275;
var y = 160;
setProperty("WarnNow_mc", _x, x);
setProperty("WarnNow_mc", _y, y);
// If the user selects the Yes button, they
// approved the recording. So, set userAnswer
// to true, unload the movie clip and return
// the updated userAnswer value.
WarnNow_mc.Yes_btn.onRelease = function () {
userAnswer = true;
trace("userAnswer: " + userAnswer);
WarnNow_mc.unloadMovie();
trace("Returning: " + userAnswer);
return userAnswer;
}
Vista de página 139
1 2 ... 135 136 137 138 139 140 141 142 143 144 145 ... 368 369

Comentários a estes Manuais

Sem comentários