# \[FMX\] preloading and mc comunication question

**URL:** <https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350>\
**Category:** flash\
**Created:** [February 25, 2003, 11:36am UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350 "2003-02-25T11:36:20Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![icicle](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@icicle](https://forum.kirupa.com/u/icicle)\
**Post date:** [February 25, 2003, 11:36am UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/1 "2003-02-25T11:36:20Z")

</div>

## i’m making a preloading in which the animation is a mc externally loaded. but the problem is that i would syncronize the percent loaded and the position (frame number in the time line) on the mc loaded. The percent preloading work fine, but i can’t comunicate with mc that remain in it’s first frame.

in the main movie  
on the first frame:

flag = 0;  
i = 0;  
CreateEmptyMovieClip(“mc”, 2);  
loadMovie(“mcarica.swf”, “mc”);

on the second:

i = i++;  
flag = 100-i;  
bytes\_loaded = Math.round(getBytesLoaded());  
bytes\_total = Math.round(getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
varloadtxt = Math.round(getPercent\*100)+"%";  
vaia=((bytes\_total/100)\*i)  
if (bytes\_loaded \<= vaia) {  
\_root.mc.gotoAndStop(i);  
}  
if (bytes\_loaded == bytes\_total) {  
gotoAndPlay(“Scena 1”, 1);  
unLoadMovie(“mc”)  
}

on the third:

## gotoAndPlay(2);

my mc (called “mc” 🙂 is on second and third frame (only the second is the keyframe).

what’s my error??? please help me!!!

bye icicle

---

<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:** [February 25, 2003, 11:53am UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/2 "2003-02-25T11:53:10Z")

</div>

> gotoAndPlay(“Scena 1”, 1);

Does this refer to the mc?  
try:

```php
mc.gotoAndPlay("Scena 1", 1);

```

---

<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:** [February 25, 2003, 11:55am UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/3 "2003-02-25T11:55:45Z")

</div>

Sorry me being stupic your refering to the next scene in the root mc

Try unloading the mc before you move to next scene

---

<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:** [February 25, 2003, 12:09pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/4 "2003-02-25T12:09:39Z")

</div>

4 davos: i’ve unloaded my mc.

## my error should be in the first condition:

## if (bytes\_loaded \<= vaia) { \_root.mc.gotoAndStop(i); }

the second work fine.  
It’s correct use i as index?

ahhhhhhhhhh

---

<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:** [February 25, 2003, 12:31pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/5 "2003-02-25T12:31:22Z")

</div>

> i=i++ ;

wont do anything, if you want to increment its just

```php

i++;

```

how many frames are there in your mc movieclip??

---

<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:** [February 25, 2003, 12:37pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/6 "2003-02-25T12:37:49Z")

</div>

100 frames in my loaded MC :-))))

i’ll try your hint… and after reply

i’m wrong… eh eh

---

<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:** [February 25, 2003, 12:44pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/7 "2003-02-25T12:44:21Z")

</div>

nothing happen!!!

i don’t understand… i can’t control it!!!

nothing to sugger?

bye Icicle

---

<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:** [February 25, 2003, 12:45pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/8 "2003-02-25T12:45:46Z")

</div>

if i is only going to be 1-100 then that wont work properly  
is i the percentage of load???

if your file is in flash 5 post it up and ill take a look

---

<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:** [February 25, 2003, 1:07pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/9 "2003-02-25T13:07:54Z")

</div>

## not properly… “i” is a counter that should take the player at certain frame (frames 1-100 of loaded mc) of “mc”.

## vaia=((bytes\_total/100)\*i) if (bytes\_loaded \<= vaia) { \_root.mc.gotoAndStop(i); }

“vaia” define the 1%, 2% etc limit, step by step, and the condition (if) put forward the time line of loaded mc (with the index “i”).

my code:

bytes\_total = Math.round(getBytesTotal());  
bytes\_loaded = Math.round(getBytesLoaded());  
i++;

getPercent = bytes\_loaded/bytes\_total;  
varloadtxt = Math.round(getPercent\*100)+"%";  
vaia = ((bytes\_total/100)\*i);  
if (bytes\_loaded\<=vaia) {  
nextFrame();  
if (bytes\_loaded == bytes\_total) {  
gotoAndPlay(“Scena 1”, 1);  
}  
}

* * *

i think should be a comunication problem with “mc”.  
my fla is for FMX.

---

<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:** [February 25, 2003, 1:24pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/10 "2003-02-25T13:24:45Z")

</div>

why not use the percentage u already have from

> getPercent = bytes\_loaded/bytes\_total;

and round it.??

```php

flag = 100-i;
bytes_loaded = Math.round(getBytesLoaded());
bytes_total = Math.round(getBytesTotal());
getPercent = bytes_loaded/bytes_total;
varloadtxt = Math.round(getPercent*100)+"%";
i=Math.round(getPercent);
_root.mc.gotoAndStop(i);
if (bytes_loaded == bytes_total) {
gotoAndPlay("Scena 1", 1);
unLoadMovie("mc")
}

```

---

<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:** [February 25, 2003, 1:37pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/11 "2003-02-25T13:37:32Z")

</div>

your code is cool!!!1

but the problem still remain… the loaded mc (“mc”) remain always at the first frame … i don’t know, really i don’t know.

it ignore the line:

\_root.mc.gotoAndStop(i);

i think.

dammation .:.:.:.:.

---

<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:** [February 25, 2003, 1:54pm UTC](https://forum.kirupa.com/t/fmx-preloading-and-mc-comunication-question/14350/12 "2003-02-25T13:54:22Z")

</div>

i notice when you create the mc you dont position it anywhere.

If you havent then you need to set its .\_x and .\_y

If this doesnt work try and go to the save option and check to see if you can save it to flash 5 as i have been told there should be the option to. then post your 2 flash 5 flas here
