# Syntax question

**URL:** <https://forum.kirupa.com/t/syntax-question/16929>\
**Category:** Uncategorized\
**Created:** [March 30, 2003, 8:14am UTC](https://forum.kirupa.com/t/syntax-question/16929 "2003-03-30T08:14:48Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melissa\_Anne](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Melissa\_Anne](https://forum.kirupa.com/u/Melissa_Anne)\
**Post date:** [March 30, 2003, 8:14am UTC](https://forum.kirupa.com/t/syntax-question/16929/1 "2003-03-30T08:14:48Z")

</div>

Hi,

I am working with external movies and  
I would like to know the real difference between:

loadMovie(“one.swf”,emptyMC);

loadMovieNum(“one.swf”, 1);

emptyMC.loadMovie(“one.swf”);

Which one is better to use when working on a fla. (CDrom work)?  
What is the advantage of using empty MC’s?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:30am UTC](https://forum.kirupa.com/t/syntax-question/16929/2 "2003-03-30T08:30:21Z")

</div>

Ok…on va essayer…

Items 1 and 3 are basically the same, n°1 uses a function, n°3 a movie clip method, but the result is the same: the content s loaded into an empty clip. advantage: you can use all movieclip methods on that: make it invisible untill the swf is fully loaded, then place it where you want (\_x and \_y) and make it visible…change the alpha…

N°2 loads into a level (level 1 here), which means  
-the swf will always be places at x=0, y=0  
-the swf will “loose” it’s background color, it’s the level0/main swf that dictates the bgcolor to all levels

So it really depends on the use. For example, I load in an swf with snow over my menu; at the moment it’s in a level so it covers the whole menu; if i wanted the snow to show just in a certain part, i would load into a clip, set the x and y and the size as desired…

Helps?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:40am UTC](https://forum.kirupa.com/t/syntax-question/16929/3 "2003-03-30T08:40:40Z")

</div>

yes it helps …thx

But is it possible to use level(like in example 2) in :

emptyMC.loadMovie(“one.swf”);  
emptyMC.\_level = 1;

Also to unload , is this correct?

unloadMovieNum(1);

Mel\*

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:41am UTC](https://forum.kirupa.com/t/syntax-question/16929/4 "2003-03-30T08:41:44Z")

</div>

[inEdit:got distracted - all above came while I had reply open]

after creating an “emptyMovieClip” then one could:

on (specifyEvent);  
loadMovie(“nameofMovietoload”, “nameofEmptyClip”)  
to play a loaded swf inside of a clip within the parent clip  
the third ver. works the same as this  
-or-  
on (specifyEvent);  
loadMovieNum(“nameofMovietoLoad”, (levelNumber))  
to play loaded content ‘over’ lower numbered levels and/or replace movies prev. loaded on same level

I couldn’t tell you whether or not one is better for CD’s

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:44am UTC](https://forum.kirupa.com/t/syntax-question/16929/5 "2003-03-30T08:44:52Z")

</div>

You can’t assign a \_level to a clip.  
With existing clips, all you can use is swapDepth to make them appear higher or lower in the stacking order.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:50am UTC](https://forum.kirupa.com/t/syntax-question/16929/6 "2003-03-30T08:50:13Z")

</div>

Yeah, levels are for layering movies not clips…  
… I left out “-or - without using a clip”…  
it’s late

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:54am UTC](https://forum.kirupa.com/t/syntax-question/16929/7 "2003-03-30T08:54:34Z")

</div>

Like this?

emptyMC.loadMovie(“one.swf”);  
emptyMC.\_x = -230;  
emptyMC.\_y = -178;  
emptyMC.swapDepths(100);

emptyMC.loadMovie(“two.swf”);  
emptyMC.\_x = -230;  
emptyMC.\_y = -178;  
…?

But then how do i force the other external swf to go behind?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 9:02am UTC](https://forum.kirupa.com/t/syntax-question/16929/8 "2003-03-30T09:02:44Z")

</div>

no no no 🙂  
if you load into the same clip,  
you will replace the previous content!  
each clip can only contain one loaded swf.

what is it you wanna do? (wanadoo, lol)

and if you use the swapDepths like this, you’ll switch the depth of emptyClip with whatever other clip was at depth 100 in \_root…  
I have the feeling this is not so clear, huh?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 9:17am UTC](https://forum.kirupa.com/t/syntax-question/16929/9 "2003-03-30T09:17:40Z")

</div>

hum,…yes its all confusing to me…

i 'll try to explain my problem:

On my main scene, I have several external mcs loading into emptymcs…

When i press button A, I want :  
emptyMC.loadMovie(“one.swf”); to come forward

When i press button B, I want:  
emptyMC.loadMovie(“two.swf”); to come forward and one to disappear…

I dont want to be just behind…but totally disappear because i have some sounds in there…

grrr… hope its clear ! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 9:24am UTC](https://forum.kirupa.com/t/syntax-question/16929/10 "2003-03-30T09:24:36Z")

</div>

well why not just load them one at a time on demand into the same clip then ? … prev loaded swf will get ‘bumped’ as next one loads - one clip…changeable swf’s

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 9:30am UTC](https://forum.kirupa.com/t/syntax-question/16929/11 "2003-03-30T09:30:02Z")

</div>

Well, perfect!  
If you WANT each new loaded clip to replace the previous, just load into the same empty clip all the time…except if you’re wanting one.swf to fade out before showing/loading two.swf…  
As you’re doing this loading , apparently, on quite a few buttons, it would be better coding just writing a function to which you pass as a parameter the name of the swf to load…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 9:45am UTC](https://forum.kirupa.com/t/syntax-question/16929/12 "2003-03-30T09:45:21Z")

</div>

yes thats what i did first, but that doesnt work…

when i press buttonA, the external swf loads fine, but when i press button B nothing happens.

This is the code for each button,…

on (press) {  
emptymc1.loadMovie(“subone.swf”);  
emptymc1.\_x = -230;  
emptymc1.\_y = -178;  
}

(to recap on my main scene, i call an external movie “one.swf”.  
In that one.swf i have a mc where buttons call another externals movies.) Is it a path problem than? Do i need to add \_root before emptymc1 ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 9:51am UTC](https://forum.kirupa.com/t/syntax-question/16929/13 "2003-03-30T09:51:06Z")

</div>

sorry i replied before …

Just read your post…

Yes i will try loading into the same emptymc…

thanx again !

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 10:01am UTC](https://forum.kirupa.com/t/syntax-question/16929/14 "2003-03-30T10:01:13Z")

</div>

Merci beaucoup !  
Thank you!

I use one emptymc…and it works now…!!

🙂
