QA Testing


Since our development environment consists of high-speed connections and fast machines, we'll want to test how the jukebox will operate on a variety of machines and connections. When submitting a request to QA, I provid a list of features to test, user scenarios, and things to watch out for. After testing the jukebox, the QA lab emailed me back with the results.

graphics/01fig21a.gif

graphics/01fig21b.gif

Based on Lucy's email, we'll have to make a few changes to the jukebox. The first thing is to add a progress bar. Thankfully we'll be able to use the ProgressBar component, which came with Flash UI Components Set 2. This component should be relatively easy to set up. It can be used for loading MovieClips or for the main movie, which is where we'll use it. For the jukebox, we'll add another scene and use it to hold only the ProgressBar. Once the ProgressBar is added to the stage, we'll set a few component parameters, and then we'll be set (Figure I-4.1).

Figure I-4.1. ProgressBar component parameters.

graphics/01fig22.gif

The ProgressBar component has three parameters: DisplayGraphics, DisplayText, and ChangeHandler. We'll leave the ProgressBar graphics displayed but turn off the display text, which shows the size of the movie as it downloads. This is because the getBytesLoaded() and getBytes Total() methods do not use the size of the compressed movie. If these values were displayed, then the incorrect sizes of the movie would appear.

Although the numbers do not take compression into account, the ProgressBar component still loads movies correctly. Next, a change handler, progressComplete, is set that will be called when the movie is finished loading.

For the ProgressBar ActionScript, we'll first use the setLoadTarget() method to designate the movie being loaded. For the jukebox, we'll want to check the loading status of the entire movie, so _root will be passed in as the parameter:

 progressBar_mc.setLoadTarget(_root);  

Next, the progressComplete() function is defined, and the ProgressBar is all set.

 functionprogressComplete(){   nextScene(); } 

When the jukebox is finished loading, it will move to the next scene that contains the main part of the jukebox. Re-skinning will follow the same color scheme as the other components and will be done through the library.

To address the second problem, we'll have to reexamine the functions that determine the value of the loaded and total kilobytes. Since the development work was done locally without bandwidth restrictions, the loading of MP3s was almost transparent. Unfortunately, we weren't able to see the problems when loading MP3s. In further testing, we found that the getBytesTotal() method of the Sound object does not work correctly. The value returned by this method appears to update as a song loads, which results in an incorrect conditional when comparing getBytesTotal() to getBytesLoaded(). To work around this problem, we'll have to modify the loadSong() function so it does not call the intervals that retrieve the relevant kilobyte data. Instead, a status message in the ticker will need to be displayed.

 functionloadSong(id){   //Setthestatusintheticker.  ticker_mc.setLabel("Pleasewait...songloading.");  //Resetthetimes.  elapsedTime_txt.text="00:00";  totalTime_txt.text="of\n00:00";  song.loadSound("music/" + id + ".mp3", false); } 

Next, the onLoad event for the song Sound object will be changed so it doesn't call only the start()methodoftheSoundobject,ratheritwillcallthefunction,startSong(),instead.

 song.onLoad=startSong;  

After that, we'll need to create the startSong() function.

 functionstartSong(){   //Setthescrollingtickerlabel.  ticker_mc.setLabel(tickerLbl);  song.start();  //Callthemethod,whichsetsthethetotalsongtime,using  //"setInterval".Thisisduetoproblemswithretrievingthe  //totalsonglength.  totalTime_int=setInterval(getTotalTime,25);  //Gettheelapsedtimeeverysecond.  elapsedTime_int=setInterval(getElapsedTime,1000); } 

Next, a variable in the playSong() function will be set that will be used for the ticker when the song finishes loading.

 tickerLbl=item.label;  

With these changes, the startSong() function will be called when a song is finished loading. This function will first update the ticker with the song information that was saved as tickerLbl. Next, the song is started and then the timings on the songs can begin.

After looking into the second problem, we discovered that the statement clearInterval(elapsedTime_int) in the stopSong() function was not always clearing the interval elapsedTime_int. It was a mystery because sometimes the interval would clear and other times it would not. To work around this problem, the following statement is inserted in the stopSong() function:

 songStopped=true;  

Next, in the getElapsedTime() function a conditional is added to make sure that a song had not been stopped before calculating the elapsed time.

 if(!songStopped){    elapsedTime_txt.text=formatTime(song.position); } 

For the final step, a corresponding flag is set in the startSong() function that was defined above.

 songStopped=false;  

The next problem Lucy found had to do with the search results. Upon further testing we found out that if the search button was pressed too quickly, then more than one search would be made, which would cause more than one result to be returned. To overcome this problem, the state of the button is set to disabled after the search button is pressed, and then enabled when the results are returned. This will be done by calling the setEnabled() method and passing false for the parameter:

 search_pb.setEnabled(false);  

With the QA problems resolved, it's time to show the jukebox to Angie.



Reality Macromedia ColdFusion MX. Macromedia Flash MX Integration
Reality Macromedia ColdFusion MX: Macromedia Flash MX Integration
ISBN: 0321125150
EAN: 2147483647
Year: 2002
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net