PDA

View Full Version : Movies within Movies - Advice please


salaro
05-04-2002, 04:08 PM
I am using Flash MX but I thought since this is a basic question I post it here.

In my main movie, I would like to link from navigation buttons to load swf movies into an empty place holder MC

So I created an empty movie clip and placed it at the desired location on the stage of Main.swf, then on my first button I placed the attached script. There are more actions to this button but the last statement is the one relevant.

The middle.swf is in the same folder as the middle.swf is. And the MC1 is the name of the place holder.

It all works fantastic; however, I do not know how to have a start movie. To understand it I used the analogy of a framed HTML page where in this case,

-----------------------------------------------------------

Parent.htm = Parant frame is here it is = Main.swf
Nav.htm = navigation frame = Menu.swf
Main.htm= Content frame = MC1

In HTML the parent frame starts off with Main.htm, but in my case it is an empy MC called MC1 – so how do I populate the MC1 when the movie starts off? At the moment Middle.swf only is loaded after the button is released. Where I want it to be there on load.

Kind regards

salaro

---------------------------------------------------
on (rollOver) {
tellTarget ("mousetracer/items/m1") {
gotoAndStop (2);
}
}
on (rollOut) {
tellTarget ("mousetracer/items/m1") {
gotoAndStop (1);
}
}
on (rollOver) {var0 = v1; var1= v2;
if (var3==0)
{tellTarget ("subbar/homesub") {gotoAndPlay (1)}; var3 = 1};
if (var4==1)
{tellTarget ("subbar/schemasub") {gotoAndPlay (12)} var4=0}
}
on (release) {
loadMovie("Middle.swf", "MC1");
}
-----------------------------------------------------

jimburton
05-04-2002, 07:19 PM
Do you just want Middle.swf movie to load straight into MC1b whan the movie loads? In that case just put the call to loadMovie on the frame rather than an event handler.

//frame1 or whatever
stop();
MC1.loadMovie("Middle.swf");

...any good?

salaro
05-04-2002, 08:30 PM
Many thanks for your help

I created an action layer and placed your code in it.

{
stop();
MC1.loadMovie("Middle.swf");
}

success as it works fine when I test movie in flash or if I test it in dreamweaver MX

However, in browser it works only if you click "home"

I would be greatful if you could have a look please.

http://217.34.139.133/how2salsa/index.htm

It also only works if I place the all the swfs in the same folder as the HTML.

The site is served from my PC and it is only on when I am connected.

Salaro
:confused:

jimburton
05-04-2002, 09:31 PM
I got to your site and had a look but before I could work out if it was working or not it went down...:(

The swf that's loaded doesn't need to be in the same directory - if you want to put it somewhere else you can use a relative or abs. path in loadMovie:

loadMovie("swfs/typea/theSwf.swf")

salaro
05-04-2002, 11:28 PM
Hi

I just placed it on the correct Server.

So please link to

http://www.how2salsa.co.uk

The main fact is that even though I placed the code below in the action layer. I still doesn’t load as the page loads and the only way is to click "home"

It looks I am almost there.

Thank you.

Regards

Solar

-------------------------------------------------------------
{
stop();
MC1.loadMovie("Middle.swf");
}

salaro
05-05-2002, 09:16 AM
Hi

Just to let you know that it works now, I placed the code below in an action layer of the empty placeholder movie.

Now I can get on with the rest of the site.

Kind regards

salaro

--------------------------------------------------------------
{
MC1.loadMovie("Middle.swf");
}
--------------------------------------------------------------

salaro
05-06-2002, 12:56 PM
Having said that now I have another problem!

When I use Stop()

it stops every thing including the little menu movements.

the menu structure works while none of the buttons are pressed but as soon as they are released the menu movement stops working for example pressing home in: -

www.how2salsa.co.uk/test.htm

Is there a way to stop play just in the MC1 and not globally?

I assume one can target within the stop(....) brackets.

Many thanks

Regards


salaro

jimburton
05-06-2002, 08:18 PM
like most inbuilt functions stop() is a global and a movieclip method - stop the timeline of an individual mc by calling MC1.stop(); or just calling stop() but from the timeline of the clip. Functions that you call in this way from the timeline of a clip are read as this.stop() (or _root.stop() if it's the main timeline) because it's read within the scope of that timeline.