That's great! - Exactly what I need!
...and I never heard of it before!
Thank you! ...so simple.
One thing though, somehow my transition still doesn't happen.
Here is the code:
Sending swf:
Actionscript Code:
mc.onMouseDown = function() {
if (this.hitTest(_xmouse,_ymouse,true)) {
val = this._parent._name.substr(7,2);
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_vars","getVars",_global.cID,val);
}
}
Receiving swf:
Actionscript Code:
var lc_receiver:LocalConnection = new LocalConnection();
lc_receiver.getVars = function(param1:Number,param2:Number) {
loc = param1;
num = param2;
//_root.querystring.text = "var 1 = "+param1+" and var 2 = "+param2;
if (num != undefined) {
tmp1 = loader.createEmptyMovieClip("tmp1",1);
tmp2 = loader.createEmptyMovieClip("tmp2",2);
levs = 2;
imgLoader.loadClip(path+loc+"/"+num+".jpg",_root["loader"]["tmp2"]);
} else {
_root.querystring.text = "Error loading file";
}
};
lc_receiver.connect("lc_vars");
imgLoaderListener.onLoadInit = function(mc:MovieClip) {
centX = Stage.width/2;
mc._x = centX - (mc._width/2);
//mc._x = (diffX - mc._width/2);
frame = _root.attachMovie("frame","frame",-10,{_x:0,_y:0});
frame._width = mc._width + 30;
frame._height = mc._height + 40;
frame._x = mc._x - 15;
frame._y = mc._y;
id2 = _root["loader"].getInstanceAtDepth(levs);
photo_msk = _root.attachMovie("photo_msk","photo_msk",100);
photo_msk._width = mc._width;
photo_msk._height = mc._height;
photo_msk._x = mc._x;
photo_msk._y = mc._y;
_root["loader"].setMask(photo_msk);
if (id2 != mc) {
mc._alpha = 0;
mc.swapDepths(id2);
id2.swapDepths(levs-1);
fadeIn(mc);
}
img_desc._x = mc._x;
img_desc._y = mc._y + mc._height;
desc.load(path+loc+"/descriptions.txt");
};
I don't think the onLoadInit function is happening at all? The pictures are loading fine, but no transition.
(This isn't all the code, just the bits affected. The code and transitions work when the variables are sent via php and flashvars...)
Any suggestions?