# Load picture in movie?

**URL:** https://forum.kirupa.com/t/load-picture-in-movie/171560
**Category:** Uncategorized
**Created:** [December 6, 2005, 3:45pm UTC](https://forum.kirupa.com/t/load-picture-in-movie/171560 "2005-12-06T15:45:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thesainter](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@thesainter](https://forum.kirupa.com/u/thesainter)
#### Post date: [December 6, 2005, 3:45pm UTC](https://forum.kirupa.com/t/load-picture-in-movie/171560/1 "2005-12-06T15:45:34Z")

</div>

I’m trying to fix this for such a long time. I’ve used the scotty gallery but want to open the clicked thumnail in a new movie.  
Not the container already on te stage.

I completely lost it. I have no idea how to do this.

anyone?

this is the part where needs to be done I guess:

function makeMenu() {  
clearInterval(delay);

```
var item = sub_menu.createEmptyMovieClip("pic"+q, q);
item.loadMovie(pictArray[p]);

var temp = _parent.createEmptyMovieClip("tmp", 9999+q, 1000);
temp.onEnterFrame = function() {
    
    var tot = item.getBytesTotal();
    var loa = item.getBytesLoaded();
    var per = Math.round(((loa/tot)*100)/(pictArray.length*2));
    
    loadBar._xscale = loadper+per;
    if (tot == loa && tot&gt;4) {
        item.id = p;
        loadper += per;
        if (q&gt;0) {
            item._x = sub_menu["pic"+(q-1)]._x+sub_menu["pic"+(q-1)]._width;
        } else {
            item._x = 0;
        }
        
        item.onRelease = function() {
            
            containerMC.loadPic(this.id);
            
            
            
        };

```

here is the code that i’ve been using:

spacing = 10;  
containerMC.\_alpha = 0;  
pArray = new Array();  
pictArray = new Array();  
MovieClip.prototype.loadPic = function(pic) {  
this.\_alpha = 0;

```
this.loadMovie(pArray[pic]);

this._parent.onEnterFrame = function() {
    var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
    bar._visible = 1;
    per = Math.round((l/t)*100);
    if (t != 0 && Math.round(l/t) == 1 && containerMC._width != 0) {
        var w = containerMC._width+spacing, h = containerMC._height+spacing;
        border.resizeMe(w, h);
        bar._visible = 0;
        delete this.onEnterFrame;
    } else {
        bar._width = per;
    }
};

```

};  
MovieClip.prototype.resizeMe = function(w, h, pic) {  
var speed = 3;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
containerMC.\_x = this.\_x-this.\_width/2+spacing/2;  
containerMC.\_y = this.\_y-this.\_height/2+spacing/2;  
containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
};  
};

my\_xml = new XML();  
my\_xml.ignoreWhite = true;  
my\_xml.onLoad = function(success) {  
if (success) {  
for (var i = 0; i\<this.firstChild.childNodes.length; i++) {  
pictArray.push(this.firstChild.childNodes\*.attributes.thumb);  
pArray.push(this.firstChild.childNodes\*.attributes.image);  
}  
}  
delay = setInterval(makeMenu, 0);  
};

my\_xml.load(“gallery.xml”);

var menu = this.createEmptyMovieClip(“menu\_tot”, 100);  
menu.setMask(mask);  
var sub\_menu = menu.createEmptyMovieClip(“menu”, 99);  
var p = 0;  
var q = 0;  
var loadper = 0;  
function makeMenu() {  
clearInterval(delay);

```
var item = sub_menu.createEmptyMovieClip("pic"+q, q);
item.loadMovie(pictArray[p]);

var temp = _parent.createEmptyMovieClip("tmp", 9999+q, 1000);
temp.onEnterFrame = function() {
    
    var tot = item.getBytesTotal();
    var loa = item.getBytesLoaded();
    var per = Math.round(((loa/tot)*100)/(pictArray.length*2));
    
    loadBar._xscale = loadper+per;
    if (tot == loa && tot&gt;4) {
        item.id = p;
        loadper += per;
        if (q&gt;0) {
            item._x = sub_menu["pic"+(q-1)]._x+sub_menu["pic"+(q-1)]._width;
        } else {
            item._x = 0;
        }
        
        item.onRelease = function() {
            
            containerMC.loadPic(this.id);
            
            
            
        };
        nextItem();
        delete this.onEnterFrame;
    }
};

```

}  
var amount = pictArray.length-1;  
function nextItem() {

```
if (q&lt;((pictArray.length*2)-1)) {
    q++;
    if (p&lt;(pictArray.length-1)) {
        p++;
        makeMenu();
    } else {
        p = 0;
        makeMenu();
    }
} else {
    activateMenu();
}

```

}  
var center = Stage.width/2;  
var speed = .05;  
function activateMenu() {  
menu.onEnterFrame = function() {  
var distance = \_root.\_xmouse-center;  
if (mask.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.\_x += (distance\*speed);  
if (this.\_x\<-sub\_menu.\_width/2) {  
this.\_x = 0;  
}  
if (this.\_x\>0) {  
this.\_x = -sub\_menu.\_width/2;  
}  
}  
};  
}
