Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

loadMovie- loading an external swf into movieclip in AS3

New Here ,
Feb 20, 2008 Feb 20, 2008
Im extremely frustrated.........im trying to do something that was once very simple, which has now become over complicated unecessecarily.....i want to do a simple loadMovie type action and load an external clip into a movieclip called ph. my AS2 code would be:

loadMovie("ExternalMovieClip.swf","ph");

or

on(release) {
loadMovie("ExternalMovieClip.swf","ph");
}


This no longer works. Can somebody tell me the new code that i would use with AS3 to do exactly what i just demonstrated? I honestly dont even want to touch AS3. The only reason i want to use it is because it makes skinning the components SOOOOOO much easier than AS2. That is the one and only reason im trying to convert to AS3. All the new load movie AS3 examples ive seen on google look like half a page long to do what i used to do in 2 lines. There must be a simpler and much easier way. I am a designer. It looks to me like Adobe went back to making flash for programmers only again leaving us designers out of the mix. Someone please help me, im desperate. I also have other old code that im sure im going to have to convert to AS3 for it to still work, and i may eventually need help with that as well, but ill stick with this loadMovie problem for now. Any and all help is appreciated. Thanks
TOPICS
ActionScript
11.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 20, 2008 Feb 20, 2008
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 20, 2008 Feb 20, 2008
so your saying i have to write 12 lines of code instead of just 2 to get the same result? is that the least amount to get the job done?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2008 Feb 21, 2008
you could do it with 4 lines if you really wanted to.

var request:URLRequest = new URLRequest("content.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 21, 2008 Feb 21, 2008
... OR you could do it with 2 lines if you really wanted to. :)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 21, 2008 Feb 21, 2008
oops! too many semi-colons.

correction:
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 21, 2008 Feb 21, 2008
quote:

Originally posted by: Raymond Basque
... OR you could do it with 2 lines if you really wanted to. :)

Now that's some scary script Raymond lol :)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2008 Feb 21, 2008
nameOfTheMovieClipYouWantToPlaceItIn.addChild(movieClipToBeAdded);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2008 Feb 21, 2008
where do i write in the movieclip that im loading the content.swf into though?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 25, 2008 Feb 25, 2008
ok.......i can get the movie clip to load onto the stage using this code:

var loader:Loader = addChild(new Loader()) as Loader;
loader.load(new URLRequest("ExternalFile.swf"));

BUT

I dont know where to type the code for my movie clip to load my external file into. the name of the movieclip on the stage is called "ph"......where do i type that to make it work. This code dosent work. I got an error trying it:

nameOfTheMovieClipYouWantToPlaceItIn.addChild(movieClipToBeAdded);

So what do i do?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 25, 2008 Feb 25, 2008
are you trying to place ExternalFile.swf into the movie clip ph?
if ph is already on the stage then you can use an oncomplete event for the loader and in the function put

loader.addEventListener(Event.COMPLETE, onComplete);
trace('loader has loaded');
function onComplete(event:Event):void {
ph.addChild(loader);
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 25, 2008 Feb 25, 2008
and now where am i to place the movie clip ExternalFile.swf? Im sorry if i seem like im beating a dead horse here but i am not skilled AT ALL with programming, so im trying very hard to understand this.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 02, 2008 Apr 02, 2008
have a look here:

http://www.smithmediafusion.com/blog/?p=381

use this:

var i =new Loader();
i.load(new URLRequest(”yourSwf.swf”));
myMC.addChild(i)

myMC is the name of your clip on the stage.

--
Dan Smith > adobe community expert
Flash Helps > http://www.smithmediafusion.com/blog/?cat=11
http://www.dsmith.tv
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 19, 2008 Jun 19, 2008
Thanks to all of you for asking this question when I needed it, and providing different replies for different situations. It does seem rather more complicated in AS3.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2008 Aug 17, 2008
If you have any reference to "stage" in the swf to be loaded, say stage.stageWidth for instance, all of these methods fail.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2008 Aug 17, 2008
LATEST
addChild() doesn't fail and that's the only method mentioned in this thread.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines