View Full Version : Load external movie headache!
cookie
February 21st, 2003, 04:45 PM
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!
cookie
February 22nd, 2003, 08:29 AM
??:sigh:
lostinbeta
February 22nd, 2003, 01:15 PM
Ummm... does anything in your loaded moving contain _root? If so try changing to _parent or "this" (no quotes).
Can you provide the files?
x.vector
February 22nd, 2003, 01:22 PM
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 ..
lostinbeta
February 22nd, 2003, 01:26 PM
Same reply as previous.
x.vector
February 22nd, 2003, 01:28 PM
when i change all _root references in suprabeener's code to _parent my movie doesn't play smooth anymore ....
aaarrgghhh
lostinbeta
February 22nd, 2003, 01:29 PM
Try changing it to "this"
this.whatever.
Any difference?
x.vector
February 22nd, 2003, 01:36 PM
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 ??
lostinbeta
February 22nd, 2003, 01:53 PM
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)
x.vector
February 22nd, 2003, 02:25 PM
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 (http://www.xvector.tomaatnet.nl) to see what i mean ..
(ps i haven't refreshed my site yet so circles don't move proper)
cookie
February 22nd, 2003, 03:00 PM
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??
lostinbeta
February 22nd, 2003, 05:38 PM
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.
cookie
February 22nd, 2003, 05:50 PM
Ok main.fla and date.fla
cookie
February 22nd, 2003, 05:51 PM
forgot date.fla
lostinbeta
February 22nd, 2003, 05:52 PM
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.
cookie
February 22nd, 2003, 06:01 PM
Problem I can't zip at the moment so I'll upload to my server! Give me 1min
lostinbeta
February 22nd, 2003, 06:03 PM
k
lostinbeta
February 22nd, 2003, 06:16 PM
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 :-\
cookie
February 22nd, 2003, 06:21 PM
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?
lostinbeta
February 22nd, 2003, 06:28 PM
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 :)
cookie
February 22nd, 2003, 06:33 PM
Thanks for the tips!;)
lostinbeta
February 22nd, 2003, 06:34 PM
No problem :) I am working on my Flash site now... and My main.fla file is completely void of anything in the library or on the stage.. it is all through AS....lol, hard to find a point to that file now :-\ :P (other than being the piece of the puzzle that holds it all together and stuf...haha)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.