Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loadmovie question 1

Status
Not open for further replies.

Bignewbie

Programmer
Feb 22, 2001
351
PH
Hi guys,

i need a sort of an explanation or a better way of doing this. Here's the scenario.

I loaded an external jpg to an MC (MC1) in the root timeline. also within the root timeline, I have another MC (MC2) which contain another MC (MC3). I loaded the same external jpg file to MC3 using this code:
Code:
MC1JPG=_root.MC1.URL;

loadmovie("MC1JPG","_root.MC2.MC3")

but it seems MC3 didnt take the file from the user's cache (the preloaded file) but from the server again, any explanation on this? How can I preload a jpg then assign it to another MC with using loadMovie?


biggie





The Man of Tomorrow is forged by his battles today.
 
You have to be sure your picture is actually loaded in mc1 before assigning the URL (which is _url and not URL) to the variable...

First load...

stop();
_root.mc1.loadMovie("image.jpg");

When sure image is loaded...

trace(_root.mc1._url);
my_jpeg = _root.mc1._url;
_root.mc2.mc3.loadMovie(my_jpeg);
stop();

Regards,

cubalibre2.gif
 
old,

I tried a similar approach, somewhere in the root timeline, in between MC1 and MC2, i have this code:
Code:
if (MC1.getBytesLoaded()==MC1.getBytesTotal()) 
{
   play();
}
else
{
   prevFrame();
}


it does continue to MC2 but I find that I have to repeat this code for MC3 within MC2:

Code:
if (MC3.getBytesLoaded()==MC3.getBytesTotal()) 
{
   play();
}
else
{
   prevFrame();
}

(note: I always have
Code:
 play();
in the frames where
Code:
prevFrame();
goes)


you see, the reason I have MC1 in the first place is to "preload" the jpg for MC3 so as to eliminate the delay. I haven't tried this using external swf files though, maybe it behaves differently than jpg files.

biggie


 
Your loadMovie actions are more important here than how you're making sure the first image is loaded & cached. And when are you assigning the variable?

Regards,

cubalibre2.gif
 


on frame 5 on the root timeline, i have this:

Code:
loadMovie(jpg1,"MC1");

the value for jpg1 is set via javascript and the code for checking MC1 is loaded is on frame 7.


on frame 3 of MC2:
Code:
MC1url=_root.MC1.url;
loadMovie(MC1url,"MC3");

the code for checking MC3 is loaded is on frame 5.


i hope this clear up some things.

biggie

p.s.

Thanks for going with me on this, old.


The Man of Tomorrow is forged by his battles today.
 
Can you add a trace here to see what comes up?
And use _url...

MC1url=_root.MC1._url;
trace (MC1url);
loadMovie(MC1url,"MC3");

Not to sure about "MC3" alone also, no harm in adding the full path, so I'd try...

_root.MC2.MC3.loadMovie(MC1url);


Regards,

cubalibre2.gif
 
The trace gave the exact URL of the jpg file:

Code:
[URL unfurl="true"]http://www.bmxt.com/images/biggie.jpg[/URL]


biggie



The Man of Tomorrow is forged by his battles today.
 
So is it working or not? Or what's not working?
Can you create a quick mockup .fla of your setup and post a link to it?

Regards,

cubalibre2.gif
 
old,

it does work, problem is I have to check if the jpg in MC1 is done loading in MC3. Kind of like a redundancy check.

Thanks old, I'll try to do this using an swf, and see if it still behaves like this.

Good day, and thanks very much for helping me on this.


biggie.

The Man of Tomorrow is forged by his battles today.
 
That would be a goodnight for me...

And don't see why you would have to re-check it!

Regards,

cubalibre2.gif
 
i forgot we were not the the same time. good nite then.

As for the redundancy check, I guess i'll stick with until i have time to tinker with it again, (my boss wants me to get over this ASAP). in which case, I'll revive this thread.

Thanks old and good night! Get some sleep, I may need your help again, hehehe!



biggie



The Man of Tomorrow is forged by his battles today.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top