attachMovie from Library

I know this has been discussed in the forum, I searched and sought, but still can’t get this to work.

I have my empty_mc, linkageID, instance names and so on. ButI can’t seem to get this clip to load from the library.

The code I have on the button is:

[AS]
port_btn.onRelease = function() {
myBlank_mc.attachMovie(subMenu,attachedSubMenu,1);
};
[/AS]

Anyones help will be greatly appreciated…

For the full .fla go: Here

You dont have any attach action on your last frame. Place this code on your last frame:[AS]port_btn.onRelease = function() {
myBlank_mc.attachMovie(“subMenu”,attachedSub,1);
};[/AS]

The parameter newName should be a string too… :sigh:
[AS]myBlank_mc.attachMovie(“subMenu”, “attachedSub”, 1);[/AS]

Ooooops thx Kax
:trout:

Thx kax and claudio…I appreciate the help… :wink:

Now I feel really stupid…
I missed those quotation marks and I assumed since the mc gets exported in the first frame that’s also where I should put the action.

Which brings up 2 more questions:

  1. Would it still work if I put the action in the first frame?

  2. In your opinion, is it better to use swf’s and loadMovie or the library and attachMovie for the navigation? (and Why?..OK, so this one is 2 parts…)

BTW, I love this website !!!
Great tutorials and instant help on the forums :wink:

You’re welcome :slight_smile:

Just because the movie clip was exported in first frame doesnt mean the actions should go on first frame too.

Your main timeline has 45 frames and a stop action on its last frame. So it means when the movie reachs its 45th frame, it will stop. Since the attachMovie action was defined on frames 1 to 44, when you reach frame 45 and click the button, nothing will happen because the action is not defined on the current frame.

[edit]and what you mean by navigation? you mean the content of your page?[/edit]

  1. Yes, it should work. Your set up allows you to define the event handler in the first frame.

  2. I’d load SWF’s dynamically. Probably because it makes things easier to edit/update.

:wink:

kax, that was my afterthoughts too. If I need to make changes to the menu I wouldn’t need to edit the main movie.

I’d be curious to know how long it takes to load the external movies over 56k though. I guess I’ll put a sample together and find someone who’s still on the slow end. (They’re getting harder to find).

Thx again guys!!!

No problem. =)

Give me the link to the sample, I still have 56K at home. Not for long, though. :stuck_out_tongue:

You could also try one of these… http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22518. :wink: