# Blend Mode & Dynamic loading MC issue

**URL:** https://forum.kirupa.com/t/blend-mode-dynamic-loading-mc-issue/212898
**Category:** flash
**Created:** [January 15, 2007, 3:54pm UTC](https://forum.kirupa.com/t/blend-mode-dynamic-loading-mc-issue/212898 "2007-01-15T15:54:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![creatovisguru](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@creatovisguru](https://forum.kirupa.com/u/creatovisguru)
#### Post date: [January 15, 2007, 3:54pm UTC](https://forum.kirupa.com/t/blend-mode-dynamic-loading-mc-issue/212898/1 "2007-01-15T15:54:39Z")

</div>

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 &lt;= 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 &lt;= 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 );
