Greetings,
I don’t know if anyone has encountered this before…or if I am doing something incorrectly.
I have an XML file which I have parsed into an array named “imageArr”.
I am attempting to load the images into “current_movie” and then have current movie load each image over time while using _alpha property to fade in and out during unload/load movie commands.
During all this…I wanted to use the belndMode multiply for the “current_movie” clip, because I have a simple black and white background I want to show through the white of the images which are loaded into “current_movie”.
I have been getting very inconsistent reactions from the use of the current_movie.blendMode = 3. I have placed the code everywhere…even in multiple places, and I still cannot get “current_movie” to retain and consistently apply the blendMode through all the transitions.
If anyone has some suggestions or tips I would greatly appreciate it.
Here is the code I have been using:
stop();
var current_movie:MovieClip = this.createEmptyMovieClip( “current_movie” , this.getNextHighestDepth() );
current_movie._alpha = 0;
current_movie.blendMode = 3;
current_movie._x = 41;
current_movie._y = 15;
var index:Number = 0;
var interval_handle:Number = 0;
var fade_level:Number = 0;
function start_load_image()
{
clearInterval( interval_handle );
var url:String = imageArr[index];
current_movie.unloadMovie();
current_movie.loadMovie(url);
current_movie.blendMode = 3;
index += 1;
if( imageArr.length == index )
{
index = 0;
}
interval_handle = setInterval( check_image_loaded , 10 );
}
function check_image_loaded()
{
if( current_movie.getBytesLoaded() == current_movie.getBytesTotal() )
{
clearInterval( interval_handle );
interval_handle = setInterval( fade_in , 10 );
}
}
function fade_in()
{
current_movie._alpha = fade_level;
if( 100 <= fade_level )
{
fade_level = 0;
clearInterval( interval_handle );
interval_handle = setInterval( end_show_image , 3000 );
current_movie.blendMode = 3;
}
else
{
fade_level += 1;
}
}
function end_show_image()
{
clearInterval( interval_handle );
interval_handle = setInterval( fade_out , 10 );
current_movie.blendMode = 3;
}
function fade_out()
{
current_movie._alpha = 100 - fade_level;
current_movie.blendMode = 3;
if( 100 <= fade_level )
{
fade_level = 0;
clearInterval( interval_handle );
interval_handle = setInterval( start_load_image , 1 );
current_movie.blendMode = 3;
}
else
{
fade_level += 1;
current_movie.blendMode = 3;
}
}
interval_handle = setInterval( start_load_image , 1 );