Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    swf con componenti e caricamento esterno

    il mi problema è il seguente...ho creato un quiz semplicemnte utilizzando un modello già esistente in flash-mx...
    alla fine del quiz vengono visualizzati i totali....
    tutto questo funziona correttamente quando il quiz lo eseguo da solo ma se lo inserisco sul livello 1 di un altro filmato i totali restano sempre a zero

    in poche parole carico in quiz tramite un bottone nel modo seguente

    on (press){
    unloadMovieNum(1);
    loadMovieNum("Test.swf",1);
    }

    il quiz funziona sn i totali ke nn vanno! cm mai?

  2. #2
    Aggiungi al primo frame del quiz:
    this._lockroot = true;

    adesso funziona??

  3. #3

  4. #4
    te l'ho detto perchè può essere che ci siano dei "_root." nel calcolo dei dati che una volta caricato l'swf in un altro non trovano più il percorso.
    Ci sono dei "_root." da qualche parte nella programmazione??

  5. #5
    ehm si! credi sia meglio sostiuiri cn _level1????

  6. #6
    cmq se ti può essere di aiuto il codice che controlla il conteggio dei risulati èil seguente
    codice:
    /*--------------VERSION CONTROL INFORMATION----------------------
    
    	Quiz Template Global Toolbox Class
    	Developed by Dan Carr
    	Quality Assurance by Andrew Chemey
    	Last Modified for Flash MX: November 25, 2001
    	Copyright 2001 Macromedia Inc. All rights reserved.
    	
      ------------------END VERSION CONTROL--------------------------
    */
    
    #initclip 1
    
    // SECTION 1: BUILD THE QUIZ CLASS FOR EVENT HANDLING
    
    // 1-1: Set the contructor function for the Quiz Class
    
    _global.Quiz = function ()
    {
    	this.total_correct = 0;
    	this.total_wrong = 0;
    	this.percent_correct = 0;
    	this.percent_display = undefined;
    	
    	this.quest_to_ask = 0;
    	this.randomize = undefined;
    	this.login_file = undefined;
    	this.activity_ID = undefined;
    	this.activity_name = undefined;
    	this.results_page = undefined;
    	
    	this.Quest_Frames = new Array();
    	this.quest_num = 0;
    	this.page_num = undefined;
    	this.endFlag = false;
    }
    
    _global.Quiz.prototype = new Object();
    
    Object.registerClass("QuizSuperClass",Quiz);
    
    // 1-2: Initialize Quiz tracking session
    
    Quiz.prototype.initStartQuiz = function () 
    {
    	this.start_time = getTimer();
    	var start_param = this.login_file+";"+this.activity_ID+";"+this.activity_name;
    	
    	fscommand("CMIInitialize");
    	fscommand("MM_cmiSetLessonStatus", "i");
    	fscommand("MM_StartSession", start_param);
    }
    
    
    // 1-3: Initialize a new quiz page
    
    Quiz.prototype.initNewPage = function(num) 
    {
    	fscommand("CMISetLocation", num);
    }
    
    
    // 1-4: Conclude the Quiz session and submit score
    
    Quiz.prototype.initSubmitScore = function() 
    {	
    	this.stop_time = int(getTimer()/1000);
    	this.elapsed_time = this.getLatency(this.stop_time - this.start_time);
    	this.percent_correct = Math.round(this.total_correct/(this.total_correct+this.total_wrong)*100);
    
    	fscommand("MM_cmiSetLessonStatus", "c");
    	fscommand("CMISetTime", this.elapsed_time);
    	fscommand("CMISetScore", this.percent_correct);
    	fscommand("CMIFinish");
    	fscommand("CMIExitAU");
    }
    
    
    // 1-5: Format Latency for correct tracking
    
    Quiz.prototype.getLatency = function (timeInSec) 
    {
    	var l_seconds, l_minutes, l_hours, timeInHours;
    	
    	if (timeInSec <= 9) {
    		l_seconds = "0"+timeInSec;
    		l_minutes = "00";
    		l_hours = "00";
    	} else {
    		l_seconds = timeInSec;
    		l_minutes = "00";
    		l_hours = "00";
    	}
    	if (l_seconds > 59) {
    		l_minutes = int(l_seconds / 60);
    		l_minutes = this.formatNum(l_minutes);
    		l_seconds = l_seconds - (l_minutes * 60);
    		l_seconds = this.formatNum(l_seconds);
    		l_hours = "00";
    	}
    	if (l_minutes > 59) {
    		l_hours = int(l_minutes/ 60);
    		l_hours = this.formatNum(l_hours);
    		l_minutes = l_minutes - (l_hours * 60);
    		l_minutes = this.formatNum(l_minutes);
    	}
    	timeInHours = l_hours+":"+l_minutes+":"+l_seconds;
    	return timeInHours;
    }
    
    
    // 1-6: Return formatted number - convert from single digit to double digit
    
    Quiz.prototype.formatNum = function (num) {
    	
    	if (num <= 9) {
    		num = "0"+num;
    	}
    	return num;
    }
    
    
    // 1-7: Set the pooling number and build an array of page numbers
    
    Quiz.prototype.setQuestArray = function() 
    {
    	this.pooling_array = new Array();
    	this.start_page;
    	this.end_page;
    	
    	for (var i = 0; i < _root._totalframes; i++) {
    		this.pooling_array[i] = i+1;
    	}
    	this.start_page = this.pooling_array.shift();
    	this.end_page = this.pooling_array.pop();
    	
    	if (this.randomize == true) {
    		this.setRandomArray(this.pooling_array);
    	}
    	
    	if (this.quest_to_ask > this.pooling_array.length || this.quest_to_ask < 1) {
    		this.quest_to_ask = this.pooling_array.length;
    	} else {
    		this.quest_to_ask = int(this.quest_to_ask);
    	}
    	
    	for (var i = 0; i < this.quest_to_ask; i++) {
    		this.Quest_Frames[i] = this.pooling_array[i];
    	}
    }	
    
    
    // 1-8: Randomize the array of page numbers if requested
    
    Quiz.prototype.setRandomArray = function(array)
    { 	
    	for (var i=0 ; i < array.length; i++) {
    		newLoc = Math.round(Math.random() * (array.length-1));
    		currLoc = array[i];
    		array[i] = array[newLoc];
    		array[newLoc] = currLoc;
    	}
    }
    
    
    // 1-9: Set the navigation to the next page in the array
    
    Quiz.prototype.setNewPage = function() 
    {
    	
    	if (this.endFlag == false){
    		
    		this.page_num = this.Quest_Frames[this.quest_num];
    		this.quest_num++;
    		
    		this.initNewPage(this.page_num);
    		_root.gotoAndStop(this.page_num);
    		
    	} else if (this.endFlag == true) {
    		this.percent_format = this.percent_correct+"%";
    		_root.gotoAndStop(_root._totalframes);
    	}
    }
    
    
    // 1-10: Catch the result variables from the interactions
    
    Quiz.prototype.countScore = function (weightNum) 
    {
    	if (weightNum < 0) {
    		this.total_wrong += Math.abs(weightNum);
    	} else {
    		this.total_correct += Number(weightNum);
    	}
    	
    	this.quest_to_ask--;
    	
    	if(this.quest_to_ask > 0){
    		_root.nav.nextBtn.gotoAndStop(1);
    	
    	} else if (this.quest_to_ask == 0) {
    		this.initSubmitScore();
    		this.endFlag = true;
    		
    		if(this.results_page == true){
    			_root.nav.nextBtn.gotoAndStop(1);
    		} else {
    			_root.nav.nextBtn.gotoAndStop(2);
    		}
    	}
    }
    
    
    // 1-11: Trace a report of the Quiz Object properties to the Output window
    
    Quiz.prototype.reportToOutput = function(defined) 
    {
    	for (x in this){
    		if (typeof(this[x]) != "function" && typeof(this[x]) != "object"){
    			if(defined == true){
    				if (typeof(x) != undefined){
    					trace(x+" : "+this[x]);
    				}
    			} else {
    				trace(x+" : "+this[x]);
    			}
    		}
    	}
    }
    
    #endinitclip 1

  7. #7
    ma ce ne sn infiniti di _root...modificare un intero modello??? da suicidio!

  8. #8
    Probabilmente il motivo è quello.
    Al posto di sostituirli tutti la si può risolvere usando lockroot che permette di usare anche più root.
    E' strano che non funzioni.

  9. #9
    se fosse una proprietà di flash sarebbe evidenziata in blu.....ma a me nn viene evidenziata....ciò vuol dire ke nn esiste cm proprietà...sei sicuro che sia giusta?

  10. #10
    leggendo un pò in giro....qs proprietà _lockroot funziona solo cn as2 e cn impostazioni di pubblicazione cn flash player 7....domanda....io nn posso andare oltre il flash player 6....nelle impostazioni di pubblicazione non esite il flash player 7 quindi nn posso nemmeno provare...qs significa che nn ci posso far nulla e che devo mallare tutto??? VVoVe:

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.