Triggering a button with a function remotely

Hi i have a web page photo gallery and all the pics are loaded externally and the effect is the resize action effect. I have an opener (in the same fla) with 3 button and one of this is called portfolio and when it’s pressed it goes to a specif frame where the photo gallery buttons are loaded.
The first pics is loaded externally (on the frame)as soon as you get to the gallery but i can’t find a way to get the function of the resize effect , basically i want to trigger the button as soon as i get to that frame so the first pics can load with the resize effect instead of just loading it without.
It is very confusing but basically i wanna know if there a way to trigger this button without touching it.
This is the code that i have on the gallery
I wanna trigger btn1 function as soon as i get to the frame where this actions and the buttons are loaded so when i get to that frame the btn1 action will trigger remotely .
Thanks a lot and i apologize for being so confusing but i am a total beginner
CODE:
framespace = 10;
photo_mc._alpha = 0;

MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
var total = Math.round(photo_mc.getBytesTotal()/1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resize = function(w, h){
var speed = 4;
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;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
photo_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
btn1.onRelease = function() {
photo_mc.loadPhoto(“p.jpg”);
};
btn2.onRelease = function() {
photo_mc.loadPhoto(“p2.jpg”);
};
etc.etc