PDA

View Full Version : [MX]Path problem???


friz2002
12-28-2002, 10:58 PM
Hi,

I'm loading an external swf (called band.swf) into my movie on Level 1.
In this ext. swf there's a mc called bbar_mc and in this mc there is a button called b_btn.
When a user clicks that button, I want a jpg to load.


I used this code in my original movie

_level1.bbar_mc.b_btn.onRelease = function(){
loadMovieNum("sub2.jpg",2);
}

I also tried loading it in a mc

_level1.bbar_mc.b_btn.onRelease = function(){
_root.holder_mc.loadMovie("sub2.jpg");
}

But both codes do nothing??

Any ideas what I'm doing wrong?

Thx in advance

jimburton
12-29-2002, 12:43 PM
I think you said it yourself - "Path problem" - have you checked that this is the right path and that instances on the stage are named?

friz2002
12-29-2002, 12:53 PM
Hi Jim,

Yes I checked. When I test the movie and then 'debug'>'list objects' I get -> Button: Target="_level1.bbar_mc.b_btn"

jimburton
12-29-2002, 01:02 PM
In that case I'm not sure...have you tried to just do a trace on the onRelease to see whether it is being called?

friz2002
12-29-2002, 01:11 PM
yes, I tried a trace and nothing happened :confused:
It's probably because I'm attaching an action to a button that isn't loaded at that time.
I just like to keep my code in 1 place, but I guess it's not possible in this case.

farafiro
12-29-2002, 01:26 PM
u said it man, the object must be loaded, fully loaded before you assign an action to it

friz2002
12-29-2002, 05:27 PM
is there a way to check this?
something like

if (_level1.bbar_mc.b_btn is loaded){
_level1.bbar_mc.b_btn.onRelease = function(){
loadMovieNum("sub2.jpg",2);
}
}

jimburton
12-29-2002, 07:28 PM
I would put the code in the swf you're going to load - I know it's maybe not the neat way to do it, but because onLoad is useless (you can't define it until after a clip is loaded, by which time you missed the onLoad event) you don't have a neater alternative...

friz2002
12-29-2002, 07:36 PM
thx for the replies :D