Loaded movie pathing problem - quick one i promise

right

the swfs are loading fine (and playing automatically).

on swf2 i have an mc button.

on the stage i have the .onPress AS for the button that is in swf2.

The instance names are all correct, there are no typos.

what is going on!!!


in my real project i am loading in swfs (seriously big ones) and i want the loaded swfs to execute functions on the main timeline.

But i really don’t want to complicate this thread!!!

please help…

hey Stringy,

if the child movie is playing, then it’s loaded - right?

yes it is but maybe it has passed your button code before it loads

yeah but i tried putting the .onPress code a few frames further on as well.

if you want to upload the files,i`ll have a quick look.

Put a trace on the button see if it returns anything.

e.g.


_root.mcPlaceholder2.button.onRelease = function(){
trace("button has been pressed");
}

here are the files.

lunatic - yeah i tried that but seeing as i can’t make the button active, not of much use!

see if you can see anything in the files.

thanks!

Unexpected file format - are you in MX2004? Can you save as MX?

http://www.gifsrus.com/testfile/master.swf
i put a stop action in the first frames of the movies you are loading and then a bytesloaded preloader type thing in master with a command to play() and the button action.

hey

try this.

Just got Flash MX 2004, didn’t even think about it!

hey Stringy.

Could you upload the fla please?

That would be brill

cheers,

you could also give your button in mc2 the actions
on(release){
_root.mcPlaceholder1.stop();
}
that does work… but i guess you want to use the .onPress function?

yeah, that works fine. I just want to be able to keep all my coding in 1 place (+ this is just a very basic test). i need the child swfs to call functions etc from the main timeline.

thanks for the reply

I moved the following code:


_root.mcPlaceholder2.butt1.onPress = function(){
_root.mcPlaceholder1.stop();
}

from main to that empty layer3 you have on mc2.fla and it works fine. Have to republish mc2 once its moved.

:hr:

you should put an mc on the main timeline and add these actions to it:
onClipEvent (enterFrame) {
_root.mcPlaceholder2.butt1.onPress = function() {

    _root.mcPlaceholder1.stop();
};

}
then it will work because is checks for press very often this way

I`ve attached the file if you need it.
You originally thought this might be a path problem. Because you have used a mc button, if you type trace(this) on the timeline of butt1, it will tell you the path.

No I don’t think it will because string is right (and I just noticed kdzines that you want all the actions on the main fla - sorry).

Yes you have to make sure the external swf is fully loaded before your buttons will work but because it starts playing immediately this scenario may not work for you. You might have to put the code on the external swf itself, depending on what you want to be able to do when.

:hr:

well with my option all the code will be on a mc in the main fla… but stingy’s option is better… but it was a nice puzzle =)

Stringy!!!

thanks matey, that works a treat now. now to apply it to my actual project…

thanks all you guys for getting involved, really appreciate the support!

cheers,

kd

welcome