Load external movie headache!

I have created a flash movie which shows the time and when you rollover it, the date is displayed in a drop-down menu! Everything works just fine! However, I now want to load this time.swf into main.swf!

I used this script written by electrongeek:

_root.containerMC.loadMovie("time.swf");

_root.containerMC._x=50;

_root.containerMC._y=50;

The problem is that it loads into main.swf, but it will no longer show the date in the drop-down! I get the following error:

Target not found: Target="drop_dateClip" Base="_level0.containerMC"

Note that "drop_dateClip is insider time.swf

What should I do!

??:sigh:

Ummm… does anything in your loaded moving contain _root? If so try changing to _parent or “this” (no quotes).

Can you provide the files?

hej …

Lost i have same problem …

i made swf with random moving circles (used suprabeener’s code)
when i load it into main movie it plays choppy …

Same reply as previous.

when i change all _root references in suprabeener’s code to _parent my movie doesn’t play smooth anymore …

aaarrgghhh

Try changing it to “this”

this.whatever.

Any difference?

nopes … same as when i change _root into _parent

darn … this really sucks …

i mean how did kirupa get them random moving circles on his site ??

what do i do wrong ??

Ok, well in a case like that… try removing all locators on those objects.

I checked the script… there is an _root when calling on the getdistance and hyp functions.

Remove the _root before those and it should work fine (just remove it, don’t replace it with anything)

thnx dude … is working now …

only problem i have now that i try to mask the loaded movie
but this doesn’t work …

check my site here to see what i mean …

(ps i haven’t refreshed my site yet so circles don’t move proper)

ok not working for me lost!:hair: in the external movie in the first frame i refer to two text fields which are in mc which are in buttons!

on the 1st frame i use _root and inside the mc on 1st frame i use _root

I have tried the diff… things you have mentioned but it doesn’t work! how should i make work when loaded into main.swf??

Can you post up example files of what you are doing. It is hard to figure it out when I don’t have anything in front of me.

Ok main.fla and date.fla

forgot date.fla

You must be on a mac or something. I get unexpected file errors.

Try putting them in a .zip file and uploading them so I can access them.

Problem I can’t zip at the moment so I’ll upload to my server! Give me 1min

k

Wow? Are you coding for Flash 4?

I am going to go through this with Flash 5+ syntax, but please feel free to revert it back to what you had before.

_root timeline Frame 1 actions…

// initial direction of drop_dateClip
direction = 0;
// date/time
days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
timedate = new Date();
todaydate = timedate.getDate();
day = timedate.getDay();
month = timedate.getMonth();
year = timedate.getFullYear();
dayname = days[day];
monthname = months[month];
clockH = timedate.getHours();
clockM = timedate.getMinutes();
clockS = timedate.getSeconds();
if (clockH<10) {
	clockH = "0"+clockH;
}
if (clockM<10) {
	clockM = "0"+clockM;
}
if (clockS<10) {
	clockS = "0"+clockS;
}
drop_dateClip.fulldate.text = dayname+", "+monthname+" "+todaydate+", "+year;
timeClip.fulltime.text = clockH+": "+clockM+": "+clockS;

drop dateClip frame 1 actions…

stop();
_parent.drop_dateClip = this;
originalPos = _y;
openPos = _y+_height;

drop dateClip frame 2 actions…

oldPos = _y;
newPos = oldPos+(direction*5);
if (direction == -1 and newPos>=originalPos) {
	this._y = newPos;
}
if (direction == 1 and newPos<=openPos) {
	this._y = newPos;
}

Timeclip frame 1 actions

_parent._parent.timeClip = this;

(requires 2 _parents because it is located in a clip in a clip).

Time Layer Button…

on (rollOver) {
	drop_dateClip.play();
	drop_dateClip.direction = 1;
}
on (rollOut) {
	drop_dateClip.play();
	drop_dateClip.direction = -1;
}

That is all. It worked great for me. Just had to change all the locators. And that old syntax (unless your coding for Flash 4) had to go :-\

Thanks lost! Just a question when you said the code was “old” where did you make the changes? Could it be changed further for MX?

What changed…

setProperty… rarely used anymore. I used this._y instead.

And tellTarget is gone… so I used the new dot syntax for your buttons. As you can tell, that code is different.

As for furthering with MX… you COULD, but everything works fine now, so there is no need to get a headache over figuring everything out all over again.

But… if you wanted… in your main.fla file you can create your empty movie clip dynamcially… since it will be easy, I will show you how.

_root.createEmptyMovieClip("container", 1);
_root.container.loadMovie("date.swf");
_root.container._x = _root.container._y=50;

It creates the clip called container on level 1. Then loads the movie to container. Then positions both the _x and _y position to 50. ANd voila… your main.fla is completely void of anything other than actions :slight_smile: