Skip to main content
Participant
August 26, 2008
Question

Loading an external .swf then referencing to it's label

  • August 26, 2008
  • 1 reply
  • 268 views
I'm new with Actionscript and am currently working at building a website. I've got a lot figured out so far but one problem I'm running into is when I try to load an external .swf using the loader component and then reference it or try to point to it within my main .swf I can only load the "gallery.swf." through myLoader.contentPath = "gallery.swf";

I'm trying to load it and then point to a specific label so it loads that frame or label. I've created separate labels for each image in my gallery so that when I point to them with AS, it knows which image to load. It worked when I had the gallery in the main .swf but when I used the loader component it didn't work.

The AS I used that worked before I made a separate .swf and used a loader was:

on(release) {
_parent._parent._parent.photos_MC.gotoAndPlay("img1");
}

what I thought would work was:

on(release){
_parent._parent._parent.myLoader.contentPath = gallery.swf.photos_MC.gotoAndPlay("img1");
}

I'm probably totally off, but if anyone could help out I would appreciate it!



This topic has been closed for replies.

1 reply

Participating Frequently
August 28, 2008
This looks like AS2 code, you may want to post there. Assuming this is AS2 code, the contentPath of the Loader specifies the url to load. Once the swf is loaded, you can then gotoAndPlay() to the label you want.

Hope that helps.